Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
I
indicators
Overview
Overview
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
zhangkb
indicators
Commits
804f7b2d
Commit
804f7b2d
authored
Oct 22, 2020
by
hzc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
增加筛选运行日期的条件(异步运算日志
parent
a50d2545
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
37 additions
and
50 deletions
+37
-50
DriveIndCalResultCtrl.java
...obile/indicators/api/hytobacco/DriveIndCalResultCtrl.java
+2
-2
ShortboardUnitCtrl.java
...eymobile/indicators/api/hytobacco/ShortboardUnitCtrl.java
+3
-0
ShortComparedLog.java
.../indicators/model/entity/shortboard/ShortComparedLog.java
+7
-6
CompareUnitCalLogMapper.java
...ators/model/mapper/indmapper/CompareUnitCalLogMapper.java
+1
-1
CompareUnitCalLogService.java
...ndicators/service/hytobacco/CompareUnitCalLogService.java
+5
-3
ShortboardUnitService.java
...e/indicators/service/hytobacco/ShortboardUnitService.java
+1
-0
CompareUnitCalLogMapper.xml
...ain/resources/mybatis/mapping/CompareUnitCalLogMapper.xml
+11
-4
ShortCompareLogMapper.xml
src/main/resources/mybatis/mapping/ShortCompareLogMapper.xml
+7
-34
No files found.
src/main/java/com/keymobile/indicators/api/hytobacco/DriveIndCalResultCtrl.java
View file @
804f7b2d
...
...
@@ -74,9 +74,9 @@ public class DriveIndCalResultCtrl {
@ApiOperation
(
value
=
"根据对标单元id分页获取日志详情"
,
notes
=
"根据对标单元id分页获取日志详情"
)
@PostMapping
(
value
=
"/findPageByCompareId"
)
public
Map
<
String
,
Object
>
findPageByCompareId
(
@RequestParam
String
compareId
,
public
Map
<
String
,
Object
>
findPageByCompareId
(
@RequestParam
String
compareId
,
@RequestParam
(
value
=
"date"
,
required
=
false
)
Integer
date
,
@RequestParam
(
defaultValue
=
"0"
)
int
page
,
@RequestParam
(
defaultValue
=
"10"
)
int
rows
){
return
compUnitCalLogService
.
findPageByCompareId
(
compareId
,
page
,
rows
);
return
compUnitCalLogService
.
findPageByCompareId
(
compareId
,
date
,
page
,
rows
);
}
@ApiOperation
(
value
=
"根据对标单元id和年份获取对标指标结果"
,
notes
=
"根据对标单元id和年份获取对标指标结果"
)
...
...
src/main/java/com/keymobile/indicators/api/hytobacco/ShortboardUnitCtrl.java
View file @
804f7b2d
...
...
@@ -168,13 +168,16 @@ public class ShortboardUnitCtrl {
@ApiOperation
(
value
=
"分页获取短板单元日志"
,
notes
=
"分页获取短板单元日志"
)
@PostMapping
(
value
=
"/findComparedLogPage"
)
public
Page
<
ShortComparedLog
>
findComparedLogPage
(
@ApiParam
(
"短板运算单元id"
)
@RequestParam
(
value
=
"shortUnitId"
)
Integer
shortUnitId
,
@ApiParam
(
"运算的时间date"
)
@RequestParam
(
value
=
"date"
,
required
=
false
)
Integer
date
,
@ApiParam
(
"页码,从1开始"
)
@RequestParam
(
"pageNo"
)
int
page
,
@ApiParam
(
"每页条数"
)
@RequestParam
(
"pageSize"
)
int
pageSize
){
PageRequest
request
=
PageRequest
.
of
(
page
-
1
,
pageSize
);
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"page"
,
request
.
getOffset
());
params
.
put
(
"pageSize"
,
pageSize
);
params
.
put
(
"date"
,
date
);
params
.
put
(
"shortUnitId"
,
shortUnitId
);
long
count
=
shortComparedLogService
.
selectComparedLogCountByParams
(
params
);
List
<
ShortComparedLog
>
shortComparedLogs
=
new
ArrayList
<>();
if
(
count
>
0
){
...
...
src/main/java/com/keymobile/indicators/model/entity/shortboard/ShortComparedLog.java
View file @
804f7b2d
...
...
@@ -36,12 +36,6 @@ public class ShortComparedLog implements Serializable {
@Column
(
name
=
"short_unit_id"
)
private
Integer
shortUnitId
;
/**
* 短板单元name
*/
@ApiModelProperty
(
"短板单元name"
)
@Column
(
name
=
"short_unit_name"
)
private
String
shortUnitName
;
/**
* 日记信息
...
...
@@ -72,6 +66,13 @@ public class ShortComparedLog implements Serializable {
private
String
creatUser
;
/**
* 创造者
*/
@ApiModelProperty
(
"创造者"
)
@Column
(
name
=
"date"
)
private
Integer
date
;
/**
* 创建时间
*/
@ApiModelProperty
(
"创建时间"
)
...
...
src/main/java/com/keymobile/indicators/model/mapper/indmapper/CompareUnitCalLogMapper.java
View file @
804f7b2d
...
...
@@ -14,5 +14,5 @@ import tk.mybatis.mapper.common.BaseMapper;
public
interface
CompareUnitCalLogMapper
extends
BaseMapper
<
CompareUnitCalLog
>{
public
List
<
CompareUnitCalLog
>
findByCompareId
(
Map
<
String
,
Object
>
param
);
public
int
countByCompareId
(
@Param
(
"compareId"
)
String
compareId
);
public
int
countByCompareId
(
Map
<
String
,
Object
>
param
);
}
src/main/java/com/keymobile/indicators/service/hytobacco/CompareUnitCalLogService.java
View file @
804f7b2d
...
...
@@ -33,14 +33,16 @@ public class CompareUnitCalLogService {
}
//分页根据对标单元id获取对应运行日志
public
Map
<
String
,
Object
>
findPageByCompareId
(
String
compareId
,
int
page
,
int
rows
){
public
Map
<
String
,
Object
>
findPageByCompareId
(
String
compareId
,
Integer
date
,
int
page
,
int
rows
){
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
paramMap
.
put
(
"compareId"
,
compareId
);
paramMap
.
put
(
"date"
,
date
);
//计算总数
int
count
=
compareUnitCalLogMapper
.
countByCompareId
(
compareId
);
int
count
=
compareUnitCalLogMapper
.
countByCompareId
(
paramMap
);
//计算start
int
start
=
page
*
rows
;
paramMap
.
put
(
"compareId"
,
compareId
);
paramMap
.
put
(
"start"
,
start
);
paramMap
.
put
(
"end"
,
rows
);
List
<
CompareUnitCalLog
>
datas
=
compareUnitCalLogMapper
.
findByCompareId
(
paramMap
);
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/ShortboardUnitService.java
View file @
804f7b2d
...
...
@@ -103,6 +103,7 @@ public class ShortboardUnitService {
shortComparedLog
.
setCreatTime
(
new
Date
());
shortComparedLog
.
setShortUnitId
(
shortBoardWarnData
.
getId
());
shortComparedLog
.
setStatus
(
2
);
shortComparedLog
.
setDate
(
shortBoardWarnData
.
getDate
());
shortComparedLogMapper
.
insert
(
shortComparedLog
);
LogManager
.
logInfo
(
Constants
.
LOG_INDICATOR_SHORTBOARD_UNIT_API
,
"短板运算id={},开始运算StartTime={}"
,
shortBoardWarnData
.
getId
(),
new
Date
());
...
...
src/main/resources/mybatis/mapping/CompareUnitCalLogMapper.xml
View file @
804f7b2d
...
...
@@ -3,15 +3,21 @@
<mapper
namespace=
"com.keymobile.indicators.model.mapper.indmapper.CompareUnitCalLogMapper"
>
<select
id=
"findByCompareId"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.indicators.CompareUnitCalLog"
>
select *
from compare_unit_cal_log
where compare_id=#{compareId}
from compare_unit_cal_log as cucl
where cucl.compare_id=#{compareId}
<if
test=
"date !=null"
>
and cucl.date = #{date}
</if>
order by create_time desc
limit #{start},#{end}
</select>
<select
id=
"countByCompareId"
parameterType=
"java.lang.String"
resultType=
"java.lang.Integer"
>
select count(1)
from compare_unit_cal_log
where compare_id=#{compareId}
from compare_unit_cal_log as cucl
where cucl.compare_id=#{compareId}
<if
test=
"date !=null"
>
and cucl.date = #{date}
</if>
</select>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/ShortCompareLogMapper.xml
View file @
804f7b2d
...
...
@@ -4,54 +4,28 @@
<select
id=
"findComparedLogPageByParams"
resultType=
"com.keymobile.indicators.model.entity.shortboard.ShortComparedLog"
>
select *
from short_compared_log
from short_compared_log
as scl
<include
refid=
"findWhereSql"
></include>
order by creat_time desc
order by
scl.
creat_time desc
limit #{page}, #{pageSize}
</select>
<select
id=
"selectComparedLogCountByParams"
resultType=
"long"
>
select count(id)
from short_compared_log
from short_compared_log
as scl
<include
refid=
"findWhereSql"
></include>
</select>
<sql
id=
"findWhereSql"
>
where 1= 1
<if
test=
"shortUnitId != null"
>
and short_unit_id = #{shortUnitId}
and scl.short_unit_id = #{shortUnitId}
</if>
<if
test=
"date != null"
>
and scl.date = #{date}
</if>
</sql>
<update
id=
"deleteByIds"
>
update affiche_info
set
state = 0,updater=#{updater}
where id in (
<foreach
collection=
"ids"
item=
"item"
separator=
","
>
#{item}
</foreach>
)
</update>
<insert
id=
"insertAfficheInfoToAllUser"
>
insert into affiche_user
(affche_id,user_id)
values
<foreach
collection=
"userIds"
item=
"user"
separator=
","
>
(
#{affcheId}, #{user}
)
</foreach>
</insert>
<delete
id=
"deleteAfficheUserByAffcheIds"
>
delete FROM affiche_user
where affche_id in (
<foreach
collection=
"affcheIds"
item=
"item"
separator=
","
>
#{item}
</foreach>
)
</delete>
</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