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
12533868
Commit
12533868
authored
Oct 27, 2023
by
litengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
双规小程序接口
parent
cab79c1f
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
94 additions
and
14 deletions
+94
-14
DateUtils.java
...ava/com/yeejoin/amos/boot/biz/common/utils/DateUtils.java
+45
-0
PlanTaskTypeStatusEnum.java
...join/amos/patrol/common/enums/PlanTaskTypeStatusEnum.java
+2
-2
CheckMapper.java
.../yeejoin/amos/patrol/business/dao/mapper/CheckMapper.java
+1
-1
CheckServiceImpl.java
...n/amos/patrol/business/service/impl/CheckServiceImpl.java
+40
-6
PlanTaskServiceImpl.java
...mos/patrol/business/service/impl/PlanTaskServiceImpl.java
+2
-2
ICheckService.java
...oin/amos/patrol/business/service/intfc/ICheckService.java
+2
-1
dbTemplate_check.xml
...-patrol/src/main/resources/db/mapper/dbTemplate_check.xml
+1
-1
plan_task_detail.xml
...-patrol/src/main/resources/db/mapper/plan_task_detail.xml
+1
-1
No files found.
amos-boot-biz-common/src/main/java/com/yeejoin/amos/boot/biz/common/utils/DateUtils.java
View file @
12533868
...
@@ -154,6 +154,44 @@ public class DateUtils {
...
@@ -154,6 +154,44 @@ public class DateUtils {
return
cal
.
getTime
();
return
cal
.
getTime
();
}
}
/**
* 获取某年某月的第一天日期
*
* @param date
* @param format
* @return
*/
public
static
Date
getStartMonthDate
(
String
date
,
String
format
)
{
if
(
date
==
null
||
date
.
length
()
<
6
||
format
==
null
)
{
return
null
;
}
int
year
=
Integer
.
parseInt
(
date
.
substring
(
0
,
4
));
int
month
=
Integer
.
parseInt
(
date
.
substring
(
5
,
7
));
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
year
,
month
-
1
,
1
);
return
calendar
.
getTime
();
}
/**
* 获取某年某月的最后一天日期
*
* @param date
* @param format
* @return
*/
public
static
Date
getEndMonthDate
(
String
date
,
String
format
)
{
if
(
date
==
null
||
date
.
length
()
<
6
||
format
==
null
)
{
return
null
;
}
int
year
=
Integer
.
parseInt
(
date
.
substring
(
0
,
4
));
int
month
=
Integer
.
parseInt
(
date
.
substring
(
5
,
7
));
Calendar
calendar
=
Calendar
.
getInstance
();
calendar
.
set
(
year
,
month
-
1
,
1
);
int
day
=
calendar
.
getActualMaximum
(
5
);
calendar
.
set
(
year
,
month
-
1
,
day
);
return
calendar
.
getTime
();
}
/**
/**
* 将长时间格式字符串转换为时间 yyyy-MM-dd HH:mm:ss
* 将长时间格式字符串转换为时间 yyyy-MM-dd HH:mm:ss
...
@@ -619,6 +657,13 @@ public class DateUtils {
...
@@ -619,6 +657,13 @@ public class DateUtils {
}
}
public
static
void
main
(
String
[]
args
)
throws
Exception
{
public
static
void
main
(
String
[]
args
)
throws
Exception
{
Date
startMonthDate
=
getStartMonthDate
(
"2023-09"
,
DATE_PATTERN
);
// Calendar calendar = new GregorianCalendar();
// calendar.setTime(new Date());
// calendar.add(Calendar.DATE, 2);
// int i = calendar.get(Calendar.DAY_OF_WEEK) - 1;
System
.
out
.
println
(
dateFormat
(
startMonthDate
,
DATE_PATTERN
));
/*System.out.println(dateTimeToDate(new Date()));
/*System.out.println(dateTimeToDate(new Date()));
System.out.println(dateParse("2017-02-04 14:58:20", null));
System.out.println(dateParse("2017-02-04 14:58:20", null));
System.out.println(dateTimeToDateStringIfTimeEndZero(new Date()));
System.out.println(dateTimeToDateStringIfTimeEndZero(new Date()));
...
...
amos-boot-module/amos-boot-module-api/amos-boot-module-patrol-api/src/main/java/com/yeejoin/amos/patrol/common/enums/PlanTaskTypeStatusEnum.java
View file @
12533868
...
@@ -4,8 +4,8 @@ package com.yeejoin.amos.patrol.common.enums;
...
@@ -4,8 +4,8 @@ package com.yeejoin.amos.patrol.common.enums;
public
enum
PlanTaskTypeStatusEnum
{
public
enum
PlanTaskTypeStatusEnum
{
day
(
"dayControl"
,
1
),
day
(
"dayControl"
,
1
),
month
(
"weeklySurvey"
,
2
),
week
(
"weeklySurvey"
,
2
),
year
(
"monthlyScheduling"
,
3
),
month
(
"monthlyScheduling"
,
3
),
;
;
/**
/**
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/dao/mapper/CheckMapper.java
View file @
12533868
...
@@ -47,7 +47,7 @@ public interface CheckMapper extends BaseMapper {
...
@@ -47,7 +47,7 @@ public interface CheckMapper extends BaseMapper {
*/
*/
List
<
Map
<
String
,
Object
>>
calendarData
(
CheckRecordParam
param
);
List
<
Map
<
String
,
Object
>>
calendarData
(
CheckRecordParam
param
);
List
<
Map
<
String
,
Object
>>
planCount
(
String
checkTime
,
String
orgCode
,
String
type
,
String
userId
);
List
<
Map
<
String
,
Object
>>
planCount
(
String
checkTime
,
String
orgCode
,
String
type
,
String
userId
,
String
startTime
,
String
endTime
);
List
<
Map
<
String
,
Object
>>
queryRecordByPointId
(
HashMap
<
String
,
Object
>
req
);
List
<
Map
<
String
,
Object
>>
queryRecordByPointId
(
HashMap
<
String
,
Object
>
req
);
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/impl/CheckServiceImpl.java
View file @
12533868
...
@@ -8,6 +8,7 @@ import com.google.common.base.Joiner;
...
@@ -8,6 +8,7 @@ import com.google.common.base.Joiner;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Lists
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.yeejoin.amos.boot.biz.common.bo.DepartmentBo
;
import
com.yeejoin.amos.boot.biz.common.bo.DepartmentBo
;
import
com.yeejoin.amos.boot.biz.common.utils.DateUtils
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.component.feign.model.FeignClientResult
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.AgencyUserModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
import
com.yeejoin.amos.feign.privilege.model.CompanyModel
;
...
@@ -33,10 +34,7 @@ import com.yeejoin.amos.patrol.business.util.Toke;
...
@@ -33,10 +34,7 @@ import com.yeejoin.amos.patrol.business.util.Toke;
import
com.yeejoin.amos.patrol.business.vo.CheckAnalysisVo
;
import
com.yeejoin.amos.patrol.business.vo.CheckAnalysisVo
;
import
com.yeejoin.amos.patrol.business.vo.CheckInfoVo
;
import
com.yeejoin.amos.patrol.business.vo.CheckInfoVo
;
import
com.yeejoin.amos.patrol.business.vo.DefectVo
;
import
com.yeejoin.amos.patrol.business.vo.DefectVo
;
import
com.yeejoin.amos.patrol.common.enums.CheckStatusEnum
;
import
com.yeejoin.amos.patrol.common.enums.*
;
import
com.yeejoin.amos.patrol.common.enums.PointLevelEnum
;
import
com.yeejoin.amos.patrol.common.enums.PointStatusEnum
;
import
com.yeejoin.amos.patrol.common.enums.RuleTypeEnum
;
import
com.yeejoin.amos.patrol.core.common.response.*
;
import
com.yeejoin.amos.patrol.core.common.response.*
;
import
com.yeejoin.amos.patrol.core.util.DateUtil
;
import
com.yeejoin.amos.patrol.core.util.DateUtil
;
import
com.yeejoin.amos.patrol.core.util.StringUtil
;
import
com.yeejoin.amos.patrol.core.util.StringUtil
;
...
@@ -58,6 +56,7 @@ import org.springframework.util.ObjectUtils;
...
@@ -58,6 +56,7 @@ import org.springframework.util.ObjectUtils;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
javax.transaction.Transactional
;
import
javax.transaction.Transactional
;
import
java.text.ParseException
;
import
java.text.SimpleDateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.*
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
...
@@ -484,6 +483,8 @@ public class CheckServiceImpl implements ICheckService {
...
@@ -484,6 +483,8 @@ public class CheckServiceImpl implements ICheckService {
if
(!
ObjectUtils
.
isEmpty
(
detail
))
{
if
(!
ObjectUtils
.
isEmpty
(
detail
))
{
check
=
checkDao
.
findByPlanTaskIdAndPointId
(
requestParam
.
getPlanTaskId
(),
requestParam
.
getPointId
());
check
=
checkDao
.
findByPlanTaskIdAndPointId
(
requestParam
.
getPlanTaskId
(),
requestParam
.
getPointId
());
planTask
=
planTaskDao
.
findById
(
requestParam
.
getPlanTaskId
()).
get
();
planTask
=
planTaskDao
.
findById
(
requestParam
.
getPlanTaskId
()).
get
();
Optional
<
PlanTaskDetail
>
planD
=
planTaskDetailDao
.
findById
(
Long
.
valueOf
(
detail
.
get
(
"id"
).
toString
()));
taskDetail
=
planD
.
get
();
routeParam
.
put
(
"routeId"
,
planTask
.
getRouteId
());
routeParam
.
put
(
"routeId"
,
planTask
.
getRouteId
());
routeParam
.
put
(
"pointId"
,
requestParam
.
getPointId
());
routeParam
.
put
(
"pointId"
,
requestParam
.
getPointId
());
...
@@ -584,6 +585,9 @@ public class CheckServiceImpl implements ICheckService {
...
@@ -584,6 +585,9 @@ public class CheckServiceImpl implements ICheckService {
}
else
{
}
else
{
checkInput
.
setIsOk
(
CheckStatusEnum
.
QUALIFIED
.
getCode
());
checkInput
.
setIsOk
(
CheckStatusEnum
.
QUALIFIED
.
getCode
());
}
}
checkInput
.
setRoutePointItemId
(
item
.
getRoutePointItemId
());
checkInput
.
setRoutePointItemId
(
item
.
getRoutePointItemId
());
checkInput
.
setInputValue
(
item
.
getInputValue
());
checkInput
.
setInputValue
(
item
.
getInputValue
());
checkInput
.
setPointClassifyId
(
item
.
getClassifyIds
());
checkInput
.
setPointClassifyId
(
item
.
getClassifyIds
());
...
@@ -608,9 +612,12 @@ public class CheckServiceImpl implements ICheckService {
...
@@ -608,9 +612,12 @@ public class CheckServiceImpl implements ICheckService {
if
(!
ObjectUtils
.
isEmpty
(
error
)
&&
error
.
endsWith
(
";"
))
{
if
(!
ObjectUtils
.
isEmpty
(
error
)
&&
error
.
endsWith
(
";"
))
{
error
.
substring
(
0
,
error
.
length
()
-
1
);
error
.
substring
(
0
,
error
.
length
()
-
1
);
check
.
setIsOk
(
CheckStatusEnum
.
UNQUALIFIED
.
getCode
());
check
.
setIsOk
(
CheckStatusEnum
.
UNQUALIFIED
.
getCode
());
taskDetail
.
setStatus
(
CheckStatusEnum
.
UNQUALIFIED
.
getCode
());
}
else
{
}
else
{
check
.
setIsOk
(
CheckStatusEnum
.
QUALIFIED
.
getCode
());
check
.
setIsOk
(
CheckStatusEnum
.
QUALIFIED
.
getCode
());
taskDetail
.
setStatus
(
CheckStatusEnum
.
QUALIFIED
.
getCode
());
}
}
planTaskDetailDao
.
saveAndFlush
(
taskDetail
);
check
.
setError
(
error
);
check
.
setError
(
error
);
check
.
setErrorClassify
(
StringUtils
.
join
(
errorClassifyNames
.
keySet
(),
","
));
check
.
setErrorClassify
(
StringUtils
.
join
(
errorClassifyNames
.
keySet
(),
","
));
//计划外巡检是否计分 ,计划内默认都是计分
//计划外巡检是否计分 ,计划内默认都是计分
...
@@ -1245,9 +1252,36 @@ public class CheckServiceImpl implements ICheckService {
...
@@ -1245,9 +1252,36 @@ public class CheckServiceImpl implements ICheckService {
}
}
@Override
@Override
public
Map
<
String
,
Object
>
checkCalendarNew
(
String
checkTime
,
String
orgCode
,
String
type
,
String
userId
)
{
public
Map
<
String
,
Object
>
checkCalendarNew
(
String
checkTime
,
String
orgCode
,
String
type
,
String
userId
)
throws
ParseException
{
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
List
<
Map
<
String
,
Object
>>
list
=
checkMapper
.
planCount
(
checkTime
,
orgCode
,
type
,
userId
);
Calendar
calendar
=
new
GregorianCalendar
();
String
startTime
=
""
;
String
endTime
=
""
;
if
(
type
.
equals
(
String
.
valueOf
(
PlanTaskTypeStatusEnum
.
week
.
getValue
())))
{
Date
startMonthDate
=
DateUtils
.
getStartMonthDate
(
checkTime
,
DateUtils
.
DATE_PATTERN
);
Date
endMonthDate
=
DateUtils
.
getEndMonthDate
(
checkTime
,
DateUtils
.
DATE_PATTERN
);
calendar
.
setTime
(
startMonthDate
);
int
i
=
calendar
.
get
(
Calendar
.
DAY_OF_WEEK
)
-
1
;
if
(
i
==
0
)
{
calendar
.
add
(
Calendar
.
DAY_OF_WEEK
,-
6
);
startTime
=
DateUtils
.
dateTimeToDateString
(
calendar
.
getTime
());
}
else
if
(
i
!=
1
)
{
calendar
.
add
(
Calendar
.
DAY_OF_WEEK
,-(
i
-
1
));
startTime
=
DateUtils
.
dateTimeToDateString
(
calendar
.
getTime
());
}
calendar
.
setTime
(
endMonthDate
);
int
j
=
calendar
.
get
(
Calendar
.
DAY_OF_WEEK
)
-
1
;
if
(
j
!=
0
)
{
calendar
.
add
(
Calendar
.
DAY_OF_WEEK
,
7
-
j
);
endTime
=
DateUtils
.
dateTimeToDateString
(
calendar
.
getTime
());
}
else
{
endTime
=
DateUtils
.
dateTimeToDateString
(
calendar
.
getTime
());
}
}
List
<
Map
<
String
,
Object
>>
list
=
checkMapper
.
planCount
(
checkTime
,
orgCode
,
type
,
userId
,
startTime
,
endTime
);
result
.
put
(
"calendarData"
,
list
);
result
.
put
(
"calendarData"
,
list
);
return
result
;
return
result
;
}
}
...
...
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 @
12533868
...
@@ -1463,7 +1463,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1463,7 +1463,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
if
(
check
!=
null
)
{
if
(
check
!=
null
)
{
List
<
CheckShot
>
checkShots
=
iCheckShotDao
.
findAllByCheckIdAndCheckInputId
(
check
.
getId
(),
List
<
CheckShot
>
checkShots
=
iCheckShotDao
.
findAllByCheckIdAndCheckInputId
(
check
.
getId
(),
0L
);
0L
);
List
<
String
>
photos
=
n
ull
;
List
<
String
>
photos
=
n
ew
ArrayList
<>()
;
if
(!
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
checkShots
))
{
if
(!
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
checkShots
))
{
photos
=
checkShots
.
stream
().
map
(
e
->
{
photos
=
checkShots
.
stream
().
map
(
e
->
{
if
(
e
!=
null
)
{
if
(
e
!=
null
)
{
...
@@ -1505,7 +1505,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
...
@@ -1505,7 +1505,7 @@ public class PlanTaskServiceImpl implements IPlanTaskService {
List
<
CheckShot
>
checkShotsNew
=
iCheckShotDao
.
findAllByCheckIdAndCheckInputId
(
check
.
getId
(),
List
<
CheckShot
>
checkShotsNew
=
iCheckShotDao
.
findAllByCheckIdAndCheckInputId
(
check
.
getId
(),
action
.
getCheckInputId
());
action
.
getCheckInputId
());
List
<
String
>
photosNew
=
n
ull
;
List
<
String
>
photosNew
=
n
ew
ArrayList
<>()
;
if
(!
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
checkShotsNew
))
{
if
(!
org
.
springframework
.
util
.
CollectionUtils
.
isEmpty
(
checkShotsNew
))
{
photosNew
=
checkShotsNew
.
stream
().
map
(
e
->
{
photosNew
=
checkShotsNew
.
stream
().
map
(
e
->
{
if
(
e
!=
null
)
{
if
(
e
!=
null
)
{
...
...
amos-boot-module/amos-boot-module-biz/amos-boot-module-patrol-biz/src/main/java/com/yeejoin/amos/patrol/business/service/intfc/ICheckService.java
View file @
12533868
...
@@ -18,6 +18,7 @@ import com.yeejoin.amos.patrol.exception.YeeException;
...
@@ -18,6 +18,7 @@ import com.yeejoin.amos.patrol.exception.YeeException;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Page
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.text.ParseException
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -85,7 +86,7 @@ public interface ICheckService {
...
@@ -85,7 +86,7 @@ public interface ICheckService {
* @param requestParam
* @param requestParam
* @return
* @return
*/
*/
Map
<
String
,
Object
>
checkCalendarNew
(
String
time
,
String
orgCode
,
String
type
,
String
userId
);
Map
<
String
,
Object
>
checkCalendarNew
(
String
time
,
String
orgCode
,
String
type
,
String
userId
)
throws
ParseException
;
/**
/**
* 根据点ID查询点巡检记录 手机APP
* 根据点ID查询点巡检记录 手机APP
...
...
amos-boot-system-patrol/src/main/resources/db/mapper/dbTemplate_check.xml
View file @
12533868
...
@@ -568,7 +568,7 @@
...
@@ -568,7 +568,7 @@
WHERE
WHERE
pl.plan_type = #{type}
pl.plan_type = #{type}
<if
test=
"type!=null and type==1"
>
AND DATE_FORMAT(pt.check_date, '%Y-%m') = left(#{checkTime}, 7)
</if>
<if
test=
"type!=null and type==1"
>
AND DATE_FORMAT(pt.check_date, '%Y-%m') = left(#{checkTime}, 7)
</if>
<if
test=
"type!=null and type==2"
>
AND
DATE_FORMAT(pt.check_date, '%Y-%m') = left(#{checkTime}, 7)
</if>
<if
test=
"type!=null and type==2"
>
AND
pt.check_date between #{startTime} and #{endTime}
</if>
<if
test=
"type!=null and type==3"
>
AND DATE_FORMAT(pt.check_date, '%Y') = left(#{checkTime}, 4)
</if>
<if
test=
"type!=null and type==3"
>
AND DATE_FORMAT(pt.check_date, '%Y') = left(#{checkTime}, 4)
</if>
<if
test=
"userId!=null and userId!=0"
>
AND FIND_IN_SET(#{userId}, pt.user_id)>0
</if>
<if
test=
"userId!=null and userId!=0"
>
AND FIND_IN_SET(#{userId}, pt.user_id)>0
</if>
<!-- <if test="orgCode!=null">AND org_code LIKE #{orgCode}</if>-->
<!-- <if test="orgCode!=null">AND org_code LIKE #{orgCode}</if>-->
...
...
amos-boot-system-patrol/src/main/resources/db/mapper/plan_task_detail.xml
View file @
12533868
...
@@ -8,7 +8,7 @@
...
@@ -8,7 +8,7 @@
<select
id=
"findPlanTaskByTaskIdAndPointId"
resultType=
"Map"
>
<select
id=
"findPlanTaskByTaskIdAndPointId"
resultType=
"Map"
>
SELECT
SELECT
p.name planName, pt.begin_time beginTime, pt.end_time endTime, pp.name pointName, pp.point_no pointNo, ptd.id planTaskDetailId, pt.route_id routeId, pr.name routeName
p
td.id , p
.name planName, pt.begin_time beginTime, pt.end_time endTime, pp.name pointName, pp.point_no pointNo, ptd.id planTaskDetailId, pt.route_id routeId, pr.name routeName
FROM
FROM
p_plan_task pt
p_plan_task pt
LEFT JOIN p_plan p ON pt.plan_id = p.id
LEFT JOIN p_plan p ON pt.plan_id = p.id
...
...
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