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
e2d755af
Commit
e2d755af
authored
Aug 27, 2020
by
xinglei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改bug
parent
51694ad2
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
93 additions
and
19 deletions
+93
-19
CheckServiceImpl.java
...atrol/service/business/service/impl/CheckServiceImpl.java
+15
-5
DateUtil.java
...a/com/yeejoin/amos/patrol/service/core/util/DateUtil.java
+12
-0
PoiUtil.java
...va/com/yeejoin/amos/patrol/service/core/util/PoiUtil.java
+26
-0
StringUtil.java
...com/yeejoin/amos/patrol/service/core/util/StringUtil.java
+24
-3
dbTemplate_check.xml
...olStart/src/main/resources/db/mapper/dbTemplate_check.xml
+16
-11
No files found.
AmosBankPatrolService/src/main/java/com/yeejoin/amos/patrol/service/business/service/impl/CheckServiceImpl.java
View file @
e2d755af
...
@@ -1175,7 +1175,7 @@ public class CheckServiceImpl implements ICheckService {
...
@@ -1175,7 +1175,7 @@ public class CheckServiceImpl implements ICheckService {
if
(!
stateMap
.
containsKey
(
finalSp
[
i
]))
{
if
(!
stateMap
.
containsKey
(
finalSp
[
i
]))
{
properties
.
put
(
finalSp
[
i
],
""
);
properties
.
put
(
finalSp
[
i
],
""
);
}
else
{
}
else
{
properties
.
put
(
finalSp
[
i
],
CheckStatusEnum
.
getEnum
(
stateMap
.
get
(
finalSp
[
i
]).
toString
()).
getName
(
));
properties
.
put
(
finalSp
[
i
],
stateMap
.
get
(
finalSp
[
i
]
));
}
}
}
}
try
{
try
{
...
@@ -1236,10 +1236,11 @@ public class CheckServiceImpl implements ICheckService {
...
@@ -1236,10 +1236,11 @@ public class CheckServiceImpl implements ICheckService {
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
1
,
1
,
0
,
mergeNum
));
sheet
.
addMergedRegion
(
new
CellRangeAddress
(
1
,
1
,
0
,
mergeNum
));
//第一行
//第一行
String
title
=
String
.
format
(
"%s %s 每日巡检情况表"
,
companyName
,
linkMap
.
get
(
"departmentName"
).
toString
());
String
title1
=
String
.
format
(
"%s %s 每日巡检情况表"
,
companyName
,
linkMap
.
get
(
"departmentName"
).
toString
());
PoiUtil
.
setTitleValue
(
sheet
.
createRow
(
rowNum
++),
title
,
headerStyle
);
String
title2
=
String
.
format
(
"巡检人:____________ 日期:%s 至 %s"
,
param
.
getBeginDate
(),
param
.
getEndDate
());
PoiUtil
.
setTitleValue
(
sheet
.
createRow
(
rowNum
++),
title1
,
headerStyle
);
//第二行
//第二行
PoiUtil
.
setTitleValue
(
sheet
.
createRow
(
rowNum
++),
"巡检人:____________ 日期: ___年___月___日至___日"
,
headerStyle
);
PoiUtil
.
setTitleValue
(
sheet
.
createRow
(
rowNum
++),
title2
,
headerStyle
);
HSSFRow
row
=
sheet
.
createRow
(
rowNum
++);
HSSFRow
row
=
sheet
.
createRow
(
rowNum
++);
HSSFCell
cell
=
null
;
HSSFCell
cell
=
null
;
...
@@ -1260,6 +1261,11 @@ public class CheckServiceImpl implements ICheckService {
...
@@ -1260,6 +1261,11 @@ public class CheckServiceImpl implements ICheckService {
//PoiUtil.exportLocal(wb, "D:/upload", "机构客户信息表.xls");
//PoiUtil.exportLocal(wb, "D:/upload", "机构客户信息表.xls");
}
}
/**
* 返回时间-状态Map
* @param idState
* @return
*/
private
Map
<
String
,
Object
>
getStateMap
(
String
idState
)
{
private
Map
<
String
,
Object
>
getStateMap
(
String
idState
)
{
Map
<
String
,
Object
>
idStateMap
=
Maps
.
newHashMap
();
Map
<
String
,
Object
>
idStateMap
=
Maps
.
newHashMap
();
if
(
ObjectUtils
.
isEmpty
(
idState
))
{
if
(
ObjectUtils
.
isEmpty
(
idState
))
{
...
@@ -1268,8 +1274,12 @@ public class CheckServiceImpl implements ICheckService {
...
@@ -1268,8 +1274,12 @@ public class CheckServiceImpl implements ICheckService {
String
[]
split
=
idState
.
split
(
","
);
String
[]
split
=
idState
.
split
(
","
);
for
(
int
i
=
0
;
i
<
split
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
split
.
length
;
i
++)
{
String
[]
sp
=
split
[
i
].
split
(
"_"
);
String
[]
sp
=
split
[
i
].
split
(
"_"
);
if
(
ObjectUtils
.
isEmpty
(
sp
[
1
]))
{
//文本类的输入值
idStateMap
.
put
(
sp
[
0
],
CheckStatusEnum
.
getEnum
(
sp
[
2
]).
getName
());
}
else
{
idStateMap
.
put
(
sp
[
0
],
sp
[
1
]);
idStateMap
.
put
(
sp
[
0
],
sp
[
1
]);
}
}
}
return
idStateMap
;
return
idStateMap
;
}
}
...
@@ -1403,7 +1413,7 @@ public class CheckServiceImpl implements ICheckService {
...
@@ -1403,7 +1413,7 @@ public class CheckServiceImpl implements ICheckService {
cell3
.
setCellValue
(
checkInputBo
.
getInputItemName
());
cell3
.
setCellValue
(
checkInputBo
.
getInputItemName
());
cell3
.
setCellStyle
(
alignLeftStyle
);
cell3
.
setCellStyle
(
alignLeftStyle
);
HSSFCell
cell4
=
row
.
createCell
(
4
);
HSSFCell
cell4
=
row
.
createCell
(
4
);
if
(
"选择"
.
equals
(
checkInputBo
.
getItemType
())
)
{
if
(
"选择"
.
equals
(
checkInputBo
.
getItemType
())
&&
ObjectUtils
.
isEmpty
(
checkInputBo
.
getInputValue
()))
{
cell4
.
setCellValue
(
checkInputBo
.
getIsOK
());
cell4
.
setCellValue
(
checkInputBo
.
getIsOK
());
}
else
{
}
else
{
cell4
.
setCellValue
(
checkInputBo
.
getInputValue
());
cell4
.
setCellValue
(
checkInputBo
.
getInputValue
());
...
...
AmosBankPatrolService/src/main/java/com/yeejoin/amos/patrol/service/core/util/DateUtil.java
View file @
e2d755af
...
@@ -707,4 +707,16 @@ public class DateUtil {
...
@@ -707,4 +707,16 @@ public class DateUtil {
public
static
String
splitDate
(
String
Date
){
public
static
String
splitDate
(
String
Date
){
return
Date
.
substring
(
11
,
Date
.
length
());
return
Date
.
substring
(
11
,
Date
.
length
());
}
}
/**
* 当前日期毫秒.xls
*
* @return
*/
public
static
String
formatName
()
{
Calendar
calen
=
Calendar
.
getInstance
();
SimpleDateFormat
sdf
=
new
SimpleDateFormat
(
"yyyyMMddhhmmss"
);
String
name
=
sdf
.
format
(
calen
.
getTime
());
return
name
;
}
}
}
AmosBankPatrolService/src/main/java/com/yeejoin/amos/patrol/service/core/util/PoiUtil.java
View file @
e2d755af
...
@@ -10,6 +10,7 @@ import java.io.File;
...
@@ -10,6 +10,7 @@ import java.io.File;
import
java.io.FileOutputStream
;
import
java.io.FileOutputStream
;
import
java.io.IOException
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.io.OutputStream
;
import
java.net.URLEncoder
;
/**
/**
* @Author: xinglei
* @Author: xinglei
...
@@ -81,6 +82,31 @@ public class PoiUtil {
...
@@ -81,6 +82,31 @@ public class PoiUtil {
}
}
/**
/**
* 导出(前端导出,带文件名)
*/
public
static
void
exportFile
(
HSSFWorkbook
wb
,
String
fileName
,
HttpServletResponse
response
)
{
OutputStream
out
=
null
;
try
{
out
=
response
.
getOutputStream
();
String
name
=
URLEncoder
.
encode
(
fileName
,
"UTF-8"
);
response
.
setCharacterEncoding
(
"UTF-8"
);
response
.
setContentType
(
"application/force-download"
);
response
.
setHeader
(
"Content-Disposition"
,
"attachment;filename="
+
name
+
".xls"
);
wb
.
write
(
out
);
out
.
close
();
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
}
finally
{
if
(
out
!=
null
)
{
try
{
out
.
close
();
}
catch
(
Exception
e2
)
{
}
}
}
}
/**
* 导出(本地导出,测试用)
* 导出(本地导出,测试用)
*/
*/
public
static
void
exportLocal
(
HSSFWorkbook
wb
,
String
path
,
String
name
)
{
public
static
void
exportLocal
(
HSSFWorkbook
wb
,
String
path
,
String
name
)
{
...
...
AmosBankPatrolService/src/main/java/com/yeejoin/amos/patrol/service/core/util/StringUtil.java
View file @
e2d755af
package
com
.
yeejoin
.
amos
.
patrol
.
service
.
core
.
util
;
package
com
.
yeejoin
.
amos
.
patrol
.
service
.
core
.
util
;
import
org.springframework.util.Assert
;
import
org.springframework.util.Assert
;
import
org.springframework.util.ObjectUtils
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.HashSet
;
import
java.util.List
;
import
java.util.Set
;
import
java.util.regex.Matcher
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
...
@@ -12,7 +17,6 @@ import static com.yeejoin.amos.patrol.service.constants.XJConstant.JOINT;
...
@@ -12,7 +17,6 @@ import static com.yeejoin.amos.patrol.service.constants.XJConstant.JOINT;
* 字符串工具类
* 字符串工具类
*
*
* @author as-youjun
* @author as-youjun
*
*/
*/
public
class
StringUtil
{
public
class
StringUtil
{
...
@@ -58,6 +62,7 @@ public class StringUtil {
...
@@ -58,6 +62,7 @@ public class StringUtil {
/**
/**
* 判断是否数字表示
* 判断是否数字表示
* 源字符串
* 源字符串
*
* @return 是否数字的标志
* @return 是否数字的标志
*/
*/
public
static
boolean
isNumeric
(
String
str
)
{
public
static
boolean
isNumeric
(
String
str
)
{
...
@@ -89,7 +94,7 @@ public class StringUtil {
...
@@ -89,7 +94,7 @@ public class StringUtil {
/**
/**
* 截取前后都不是0的数字字符串
* 截取前后都不是0的数字字符串
*
* <p>
* 12010102 => 12010102 12010100 => 120101 ab1201100b => 12011
* 12010102 => 12010102 12010100 => 120101 ab1201100b => 12011
*
*
* @param str
* @param str
...
@@ -106,7 +111,6 @@ public class StringUtil {
...
@@ -106,7 +111,6 @@ public class StringUtil {
}
}
/**
/**
*
* <pre>
* <pre>
* 移除字符串后面的0
* 移除字符串后面的0
* </pre>
* </pre>
...
@@ -161,4 +165,21 @@ public class StringUtil {
...
@@ -161,4 +165,21 @@ public class StringUtil {
String
str
=
str1
+
JOINT
+
str2
;
String
str
=
str1
+
JOINT
+
str2
;
return
str
;
return
str
;
}
}
/**
* List去重
*
* @param list
* @return
*/
public
static
List
getNewList
(
List
<
String
>
list
)
{
Set
set
=
new
HashSet
();
List
newList
=
new
ArrayList
();
for
(
String
cd
:
list
)
{
if
(!
ObjectUtils
.
isEmpty
(
cd
)
&&
set
.
add
(
cd
))
{
newList
.
add
(
cd
);
}
}
return
newList
;
}
}
}
AmosBankPatrolStart/src/main/resources/db/mapper/dbTemplate_check.xml
View file @
e2d755af
...
@@ -173,6 +173,7 @@
...
@@ -173,6 +173,7 @@
ci.id checkInputId,
ci.id checkInputId,
ci.input_id inputId,
ci.input_id inputId,
ci.input_value AS InputValue,
ci.input_value AS InputValue,
pc.order_no orderNo,
(
(
CASE ci.is_ok
CASE ci.is_ok
WHEN 1 THEN
WHEN 1 THEN
...
@@ -185,8 +186,8 @@
...
@@ -185,8 +186,8 @@
) AS IsOK,
) AS IsOK,
ii.`name` AS inputItemName,
ii.`name` AS inputItemName,
ii.item_type as itemType,
ii.item_type as itemType,
c.id checkId,
c.upload_time AS UploadTime,
c.upload_time AS UploadTime,
u.`name` AS RealName,
ci.score AS Score,
ci.score AS Score,
ci.point_classify_id classifyId,
ci.point_classify_id classifyId,
ci.point_classify_name classifyName,
ci.point_classify_name classifyName,
...
@@ -205,21 +206,23 @@
...
@@ -205,21 +206,23 @@
p_check_input ci
p_check_input ci
LEFT JOIN p_input_item ii ON ci.input_id = ii.id
LEFT JOIN p_input_item ii ON ci.input_id = ii.id
LEFT JOIN p_check c ON ci.check_id = c.id
LEFT JOIN p_check c ON ci.check_id = c.id
LEFT JOIN s_user u ON c.user_id = u.id
LEFT JOIN p_point p ON c.point_id = p.id
LEFT JOIN p_point p ON c.point_id = p.id
LEFT JOIN p_plan_task_detail ptd ON c.plan_task_detail_id = ptd.id
LEFT JOIN p_plan_task_detail ptd ON c.plan_task_detail_id = ptd.id
LEFT JOIN p_plan_task pt ON pt.id = ptd.task_no
LEFT JOIN p_plan_task pt ON pt.id = ptd.task_no
LEFT JOIN p_point_classify pc on pc.id = ci.point_classify_id
<trim
prefix=
"WHERE"
prefixOverrides=
"AND "
>
<trim
prefix=
"WHERE"
prefixOverrides=
"AND "
>
<if
test=
"beginDate!=null and endDate!=null"
>
and c.check_time BETWEEN #{beginDate} and #{endDate}
</if>
<if
test=
"beginDate!=null and endDate!=null"
>
and c.check_time BETWEEN #{beginDate} and #{endDate}
</if>
<if
test=
"orgCode!=null"
>
and c.org_Code like concat(#{orgCode},"%")
</if>
<if
test=
"orgCode!=null"
>
and c.org_Code like concat(#{orgCode},"%")
</if>
<if
test=
"departmentId!=null"
>
and c.dep_id = #{departmentId}
</if>
<if
test=
"departmentId!=null"
>
and c.dep_id = #{departmentId}
</if>
</trim>
</trim>
GROUP BY inputId, classifyId, beginTime
GROUP BY inputId, classifyId, beginTime
, checkInputId
ORDER BY
ORDER BY
beginTime is null,
beginTime is null,
beginTime ASC,
beginTime ASC,
pointId ASC,
pointId ASC,
classifyId ASC
planTaskId ASC,
checkDate ASC,
orderNo ASC
</when>
</when>
<otherwise>
<otherwise>
select
select
...
@@ -234,10 +237,11 @@
...
@@ -234,10 +237,11 @@
c.upload_time AS UploadTime,
c.upload_time AS UploadTime,
pt.id planTaskId,
pt.id planTaskId,
pt.begin_time beginTime,
pt.begin_time beginTime,
GROUP_CONCAT(DISTINCT pt.begin_time, '_', ci.is_ok) as idStateStr,
GROUP_CONCAT(DISTINCT pt.begin_time, '_',
IFNULL(ci.input_value,''), '_',
ci.is_ok) as idStateStr,
ci.id checkInputId,
ci.id checkInputId,
ci.input_id inputId,
ci.input_id inputId,
ci.input_value AS InputValue,
ci.input_value AS InputValue,
pc.order_no orderNo,
(
(
CASE ci.is_ok
CASE ci.is_ok
WHEN 1 THEN
WHEN 1 THEN
...
@@ -259,6 +263,7 @@
...
@@ -259,6 +263,7 @@
LEFT JOIN p_check_input ci ON c.id = ci.check_id
LEFT JOIN p_check_input ci ON c.id = ci.check_id
LEFT JOIN p_input_item ii ON ci.input_id = ii.id
LEFT JOIN p_input_item ii ON ci.input_id = ii.id
LEFT JOIN p_plan_task pt ON pt.id = ptd.task_no
LEFT JOIN p_plan_task pt ON pt.id = ptd.task_no
LEFT JOIN p_point_classify pc on pc.id = ci.point_classify_id
<trim
prefix=
"WHERE"
prefixOverrides=
"AND "
>
<trim
prefix=
"WHERE"
prefixOverrides=
"AND "
>
<if
test=
"beginDate!=null and endDate!=null"
>
and c.check_time BETWEEN #{beginDate} and #{endDate}
</if>
<if
test=
"beginDate!=null and endDate!=null"
>
and c.check_time BETWEEN #{beginDate} and #{endDate}
</if>
<if
test=
"orgCode!=null"
>
and c.org_Code like concat(#{orgCode},"%")
</if>
<if
test=
"orgCode!=null"
>
and c.org_Code like concat(#{orgCode},"%")
</if>
...
@@ -266,7 +271,7 @@
...
@@ -266,7 +271,7 @@
and (pt.id is NOT NULL or pt.id = '')
and (pt.id is NOT NULL or pt.id = '')
</trim>
</trim>
group by pointId, inputId, classifyId
group by pointId, inputId, classifyId
order BY pointId, classifyId
order BY pointId,
orderNo ASC,
classifyId
</otherwise>
</otherwise>
</choose>
</choose>
</select>
</select>
...
@@ -981,7 +986,7 @@
...
@@ -981,7 +986,7 @@
'漏检'
'漏检'
END
END
) AS IsOK,
) AS IsOK,
ii.`name` AS
NAME
,
ii.`name` AS
inputItemName
,
c.upload_time AS UploadTime,
c.upload_time AS UploadTime,
u.`name` AS RealName,
u.`name` AS RealName,
ci.score AS Score,
ci.score AS Score,
...
@@ -1912,8 +1917,8 @@
...
@@ -1912,8 +1917,8 @@
LEFT JOIN p_route r ON r.id = pnt.route_id
LEFT JOIN p_route r ON r.id = pnt.route_id
LEFT JOIN p_check c ON c.plan_task_detail_id = ptd.id
LEFT JOIN p_check c ON c.plan_task_detail_id = ptd.id
WHERE pnt.org_code LIKE CONCAT(#{orgCode}, '%')
WHERE pnt.org_code LIKE CONCAT(#{orgCode}, '%')
<if
test=
"startTime !=null and startTime!= '' "
>
<![CDATA[ AND pnt.
check_dat
e >= #{startTime} ]]>
</if>
<if
test=
"startTime !=null and startTime!= '' "
>
<![CDATA[ AND pnt.
begin_tim
e >= #{startTime} ]]>
</if>
<if
test=
"endTime !=null and endTime!='' "
>
<![CDATA[AND pnt.
check_dat
e <= #{endTime} ]]>
</if>
<if
test=
"endTime !=null and endTime!='' "
>
<![CDATA[AND pnt.
begin_tim
e <= #{endTime} ]]>
</if>
GROUP BY ptd.id
GROUP BY ptd.id
) a
) a
GROUP BY
GROUP BY
...
@@ -1992,8 +1997,8 @@
...
@@ -1992,8 +1997,8 @@
</when>
</when>
</choose>
</choose>
<if
test=
"isOk !=null and isOk != '' "
>
and c.isOk = #{isOk}
</if>
<if
test=
"isOk !=null and isOk != '' "
>
and c.isOk = #{isOk}
</if>
<if
test=
"startTime !=null and startTime!= '' "
>
<![CDATA[ AND pnt.
check_dat
e >= #{startTime} ]]>
</if>
<if
test=
"startTime !=null and startTime!= '' "
>
<![CDATA[ AND pnt.
begin_tim
e >= #{startTime} ]]>
</if>
<if
test=
"endTime !=null and endTime!='' "
>
<![CDATA[AND pnt.
check_dat
e <= #{endTime} ]]>
</if>
<if
test=
"endTime !=null and endTime!='' "
>
<![CDATA[AND pnt.
begin_tim
e <= #{endTime} ]]>
</if>
GROUP BY
GROUP BY
pnt.id
pnt.id
) a
) a
...
...
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