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
0c5194c7
Commit
0c5194c7
authored
Jun 15, 2020
by
张祺
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'hy-tobacco' of
http://132.232.112.242:7090/zhangkb/indicators
into hy-tobacco
parents
868d7f64
60785873
Hide whitespace changes
Inline
Side-by-side
Showing
72 changed files
with
939 additions
and
615 deletions
+939
-615
DriveIndCalculateActor.java
...ymobile/indicators/akka/actor/DriveIndCalculateActor.java
+1
-1
DriveIndCalculateRegionActor.java
...ors/akka/actor/specific/DriveIndCalculateRegionActor.java
+1
-1
DriveIndAverageAndRankMsg.java
...tors/akka/message/specific/DriveIndAverageAndRankMsg.java
+4
-4
IndCatalogCtrl.java
...om/keymobile/indicators/api/hytobacco/IndCatalogCtrl.java
+6
-6
IndScorecardCtrl.java
.../keymobile/indicators/api/hytobacco/IndScorecardCtrl.java
+8
-9
IndicatorsDefCtrl.java
...keymobile/indicators/api/hytobacco/IndicatorsDefCtrl.java
+4
-4
ObjScoreRuleCtrl.java
.../keymobile/indicators/api/hytobacco/ObjScoreRuleCtrl.java
+8
-9
ShortboardRuleCtrl.java
...eymobile/indicators/api/hytobacco/ShortboardRuleCtrl.java
+8
-8
BaseIndDef.java
...mobile/indicators/model/entity/indicators/BaseIndDef.java
+1
-1
BaseIndDefVersionData.java
...cators/model/entity/indicators/BaseIndDefVersionData.java
+9
-11
DriveIndCalResultDef.java
...icators/model/entity/indicators/DriveIndCalResultDef.java
+3
-0
DriveIndCatalog.java
...e/indicators/model/entity/indicators/DriveIndCatalog.java
+9
-12
DriveIndDef.java
...obile/indicators/model/entity/indicators/DriveIndDef.java
+2
-2
DriveIndDefVersionData.java
...ators/model/entity/indicators/DriveIndDefVersionData.java
+9
-11
IndCatalog.java
...mobile/indicators/model/entity/indicators/IndCatalog.java
+9
-13
IndicatorsData.java
...le/indicators/model/entity/indicators/IndicatorsData.java
+3
-0
ScoreRule.java
...obile/indicators/model/entity/objscorerule/ScoreRule.java
+14
-22
ScoreRuleCatalog.java
...ndicators/model/entity/objscorerule/ScoreRuleCatalog.java
+9
-13
IndScorecard.java
...obile/indicators/model/entity/scorecard/IndScorecard.java
+24
-32
ScorecardCatalog.java
...e/indicators/model/entity/scorecard/ScorecardCatalog.java
+9
-13
ShortboardCatalog.java
...indicators/model/entity/shortboard/ShortboardCatalog.java
+10
-13
ShortboardDriveIndRel.java
...cators/model/entity/shortboard/ShortboardDriveIndRel.java
+12
-15
ShortboardRule.java
...le/indicators/model/entity/shortboard/ShortboardRule.java
+13
-20
BaseIndDefMapper.java
.../indicators/model/mapper/indicators/BaseIndDefMapper.java
+1
-1
DriveIndDefMapper.java
...indicators/model/mapper/indicators/DriveIndDefMapper.java
+1
-1
BaseIndDefVersionDataMapper.java
...s/model/mapper/indmapper/BaseIndDefVersionDataMapper.java
+12
-0
DriveIndCatalogMapper.java
...icators/model/mapper/indmapper/DriveIndCatalogMapper.java
+19
-0
DriveIndDefVersionDataMapper.java
.../model/mapper/indmapper/DriveIndDefVersionDataMapper.java
+12
-0
IndCatalogMapper.java
...e/indicators/model/mapper/indmapper/IndCatalogMapper.java
+20
-0
IndScorecardMapper.java
...indicators/model/mapper/indmapper/IndScorecardMapper.java
+20
-0
ScoreRuleCatalogMapper.java
...cators/model/mapper/indmapper/ScoreRuleCatalogMapper.java
+20
-0
ScoreRuleMapper.java
...le/indicators/model/mapper/indmapper/ScoreRuleMapper.java
+22
-0
ScorecardCatalogMapper.java
...cators/model/mapper/indmapper/ScorecardCatalogMapper.java
+20
-0
ShortboardCatalogMapper.java
...ators/model/mapper/indmapper/ShortboardCatalogMapper.java
+19
-0
ShortboardDriveIndRelMapper.java
...s/model/mapper/indmapper/ShortboardDriveIndRelMapper.java
+15
-0
ShortboardRuleMapper.java
...dicators/model/mapper/indmapper/ShortboardRuleMapper.java
+20
-0
BaseIndDefVersionRepository.java
...persistence/hyindicators/BaseIndDefVersionRepository.java
+0
-9
DriveIndCatalogRepository.java
...s/persistence/hyindicators/DriveIndCatalogRepository.java
+0
-15
DriveIndDefVersionRepository.java
...ersistence/hyindicators/DriveIndDefVersionRepository.java
+0
-9
IndCatalogRepository.java
...cators/persistence/hyindicators/IndCatalogRepository.java
+0
-16
IndScorecardRepository.java
...tors/persistence/hyindicators/IndScorecardRepository.java
+0
-15
ScoreRuleCatalogRepository.java
.../persistence/hyindicators/ScoreRuleCatalogRepository.java
+0
-15
ScoreRuleRepository.java
...icators/persistence/hyindicators/ScoreRuleRepository.java
+0
-17
ScorecardCatalogRepository.java
.../persistence/hyindicators/ScorecardCatalogRepository.java
+0
-14
ShortboardCatalogRepository.java
...persistence/hyindicators/ShortboardCatalogRepository.java
+0
-14
ShortboardDriveIndRelRepository.java
...istence/hyindicators/ShortboardDriveIndRelRepository.java
+0
-11
ShortboardRuleRepository.java
...rs/persistence/hyindicators/ShortboardRuleRepository.java
+0
-14
BaseIndDefService.java
...obile/indicators/service/hytobacco/BaseIndDefService.java
+3
-7
BaseIndDefVersionService.java
...ndicators/service/hytobacco/BaseIndDefVersionService.java
+3
-3
DriveIndCalResultService.java
...ndicators/service/hytobacco/DriveIndCalResultService.java
+7
-4
DriveIndCatalogService.java
.../indicators/service/hytobacco/DriveIndCatalogService.java
+27
-28
DriveIndDefService.java
...bile/indicators/service/hytobacco/DriveIndDefService.java
+3
-7
DriveIndDefVersionService.java
...dicators/service/hytobacco/DriveIndDefVersionService.java
+3
-3
IndCatalogService.java
...obile/indicators/service/hytobacco/IndCatalogService.java
+26
-27
IndScorecardService.java
...ile/indicators/service/hytobacco/IndScorecardService.java
+64
-26
IndicatorsValueService.java
.../indicators/service/hytobacco/IndicatorsValueService.java
+0
-4
ScoreRuleCatalogService.java
...indicators/service/hytobacco/ScoreRuleCatalogService.java
+30
-30
ScoreRuleService.java
...mobile/indicators/service/hytobacco/ScoreRuleService.java
+38
-21
ScorecardCatalogService.java
...indicators/service/hytobacco/ScorecardCatalogService.java
+30
-30
ShortboardCatalogService.java
...ndicators/service/hytobacco/ShortboardCatalogService.java
+30
-31
ShortboardRuleService.java
...e/indicators/service/hytobacco/ShortboardRuleService.java
+42
-23
BaseIndDefVersionDataMapper.xml
...resources/mybatis/mapping/BaseIndDefVersionDataMapper.xml
+6
-0
DriveIndCatalogMapper.xml
src/main/resources/mybatis/mapping/DriveIndCatalogMapper.xml
+30
-0
DriveIndDefVersionDataMapper.xml
...esources/mybatis/mapping/DriveIndDefVersionDataMapper.xml
+6
-0
IndCatalogMapper.xml
src/main/resources/mybatis/mapping/IndCatalogMapper.xml
+30
-0
IndScorecardMapper.xml
src/main/resources/mybatis/mapping/IndScorecardMapper.xml
+26
-0
ScoreRuleCatalogMapper.xml
...main/resources/mybatis/mapping/ScoreRuleCatalogMapper.xml
+30
-0
ScoreRuleMapper.xml
src/main/resources/mybatis/mapping/ScoreRuleMapper.xml
+32
-0
ScorecardCatalogMapper.xml
...main/resources/mybatis/mapping/ScorecardCatalogMapper.xml
+30
-0
ShortboardCatalogMapper.xml
...ain/resources/mybatis/mapping/ShortboardCatalogMapper.xml
+30
-0
ShortboardDriveIndRelMapper.xml
...resources/mybatis/mapping/ShortboardDriveIndRelMapper.xml
+10
-0
ShortboardRuleMapper.xml
src/main/resources/mybatis/mapping/ShortboardRuleMapper.xml
+26
-0
No files found.
src/main/java/com/keymobile/indicators/akka/actor/DriveIndCalculateActor.java
View file @
0c5194c7
...
@@ -57,7 +57,7 @@ public class DriveIndCalculateActor extends AbstractActor{
...
@@ -57,7 +57,7 @@ public class DriveIndCalculateActor extends AbstractActor{
private
String
unit
;
private
String
unit
;
private
String
markType
;
private
Integer
markType
;
private
String
driveIndId
;
private
String
driveIndId
;
...
...
src/main/java/com/keymobile/indicators/akka/actor/specific/DriveIndCalculateRegionActor.java
View file @
0c5194c7
...
@@ -69,7 +69,7 @@ public class DriveIndCalculateRegionActor extends AbstractActor{
...
@@ -69,7 +69,7 @@ public class DriveIndCalculateRegionActor extends AbstractActor{
String
value
=
driveIndAverageAndRankMsg
.
getDriveIndValue
();
String
value
=
driveIndAverageAndRankMsg
.
getDriveIndValue
();
String
id
=
String
.
valueOf
(
driveIndAverageAndRankMsg
.
getId
());
String
id
=
String
.
valueOf
(
driveIndAverageAndRankMsg
.
getId
());
String
indType
=
driveIndAverageAndRankMsg
.
getIndType
();
String
indType
=
driveIndAverageAndRankMsg
.
getIndType
();
String
markType
=
driveIndAverageAndRankMsg
.
getMarkType
();
//评分卡id
Integer
markType
=
driveIndAverageAndRankMsg
.
getMarkType
();
//评分卡id
valueMap
.
put
(
id
,
value
);
valueMap
.
put
(
id
,
value
);
values
.
add
(
value
);
values
.
add
(
value
);
compareObjs
.
add
(
driveIndAverageAndRankMsg
.
getCompareObj
());
compareObjs
.
add
(
driveIndAverageAndRankMsg
.
getCompareObj
());
...
...
src/main/java/com/keymobile/indicators/akka/message/specific/DriveIndAverageAndRankMsg.java
View file @
0c5194c7
...
@@ -16,11 +16,11 @@ public class DriveIndAverageAndRankMsg implements Serializable{
...
@@ -16,11 +16,11 @@ public class DriveIndAverageAndRankMsg implements Serializable{
private
String
driveIndValue
;
private
String
driveIndValue
;
private
String
unit
;
private
String
unit
;
private
String
indType
;
private
String
indType
;
private
String
markType
;
private
Integer
markType
;
private
String
indFormula
;
private
String
indFormula
;
public
DriveIndAverageAndRankMsg
(
Integer
id
,
String
compareId
,
String
driveIndId
,
String
compareObj
,
public
DriveIndAverageAndRankMsg
(
Integer
id
,
String
compareId
,
String
driveIndId
,
String
compareObj
,
Integer
date
,
String
driveIndValue
,
String
unit
,
String
indType
,
String
markType
,
String
indFormula
)
{
Integer
date
,
String
driveIndValue
,
String
unit
,
String
indType
,
Integer
markType
,
String
indFormula
)
{
this
.
id
=
id
;
this
.
id
=
id
;
this
.
compareId
=
compareId
;
this
.
compareId
=
compareId
;
this
.
driveIndId
=
driveIndId
;
this
.
driveIndId
=
driveIndId
;
...
@@ -97,11 +97,11 @@ public class DriveIndAverageAndRankMsg implements Serializable{
...
@@ -97,11 +97,11 @@ public class DriveIndAverageAndRankMsg implements Serializable{
this
.
indType
=
indType
;
this
.
indType
=
indType
;
}
}
public
String
getMarkType
()
{
public
Integer
getMarkType
()
{
return
markType
;
return
markType
;
}
}
public
void
setMarkType
(
String
markType
)
{
public
void
setMarkType
(
Integer
markType
)
{
this
.
markType
=
markType
;
this
.
markType
=
markType
;
}
}
...
...
src/main/java/com/keymobile/indicators/api/hytobacco/IndCatalogCtrl.java
View file @
0c5194c7
...
@@ -28,20 +28,20 @@ public class IndCatalogCtrl {
...
@@ -28,20 +28,20 @@ public class IndCatalogCtrl {
@ApiOperation
(
value
=
"新建基础指标目录"
,
notes
=
"新建基础指标目录"
)
@ApiOperation
(
value
=
"新建基础指标目录"
,
notes
=
"新建基础指标目录"
)
@PostMapping
(
value
=
"/createBaseIndCatalog"
)
@PostMapping
(
value
=
"/createBaseIndCatalog"
)
public
String
createBaseIndCatalog
(
@RequestBody
IndCatalog
indCatalog
)
throws
Exception
{
public
Integer
createBaseIndCatalog
(
@RequestBody
IndCatalog
indCatalog
)
throws
Exception
{
indCatalog
=
indCatalogService
.
saveOrUpdate
(
indCatalog
);
indCatalog
=
indCatalogService
.
saveOrUpdate
(
indCatalog
);
return
indCatalog
.
getId
();
return
indCatalog
.
getId
();
}
}
@ApiOperation
(
value
=
"批量级联删除基础指标目录"
,
notes
=
"批量级联删除基础指标目录"
)
@ApiOperation
(
value
=
"批量级联删除基础指标目录"
,
notes
=
"批量级联删除基础指标目录"
)
@PostMapping
(
value
=
"/deleteBaseIndCatalog"
)
@PostMapping
(
value
=
"/deleteBaseIndCatalog"
)
public
void
deleteBaseIndCatalog
(
@RequestParam
List
<
String
>
ids
)
throws
Exception
{
public
void
deleteBaseIndCatalog
(
@RequestParam
List
<
Integer
>
ids
)
throws
Exception
{
indCatalogService
.
recursionDelete
(
ids
);
indCatalogService
.
recursionDelete
(
ids
);
}
}
@ApiOperation
(
value
=
"获取基础指标目录"
,
notes
=
"获取基础指标目录"
)
@ApiOperation
(
value
=
"获取基础指标目录"
,
notes
=
"获取基础指标目录"
)
@PostMapping
(
value
=
"/getBaseIndCatalog"
)
@PostMapping
(
value
=
"/getBaseIndCatalog"
)
public
List
<
IndCatalog
>
getBaseIndCatalog
(
@RequestParam
(
required
=
false
)
String
parentId
,
public
List
<
IndCatalog
>
getBaseIndCatalog
(
@RequestParam
(
required
=
false
)
Integer
parentId
,
@RequestParam
List
<
String
>
codes
){
@RequestParam
List
<
String
>
codes
){
return
indCatalogService
.
getCatalog
(
parentId
,
codes
);
return
indCatalogService
.
getCatalog
(
parentId
,
codes
);
}
}
...
@@ -49,20 +49,20 @@ public class IndCatalogCtrl {
...
@@ -49,20 +49,20 @@ public class IndCatalogCtrl {
//考核指标目录
//考核指标目录
@ApiOperation
(
value
=
"新建考核指标目录"
,
notes
=
"新建考核指标目录"
)
@ApiOperation
(
value
=
"新建考核指标目录"
,
notes
=
"新建考核指标目录"
)
@PostMapping
(
value
=
"/createDriveIndCatalog"
)
@PostMapping
(
value
=
"/createDriveIndCatalog"
)
public
String
createDriveIndCatalog
(
@RequestBody
DriveIndCatalog
driveIndCatalog
)
throws
Exception
{
public
Integer
createDriveIndCatalog
(
@RequestBody
DriveIndCatalog
driveIndCatalog
)
throws
Exception
{
driveIndCatalog
=
driveIndCatalogService
.
saveOrUpdate
(
driveIndCatalog
);
driveIndCatalog
=
driveIndCatalogService
.
saveOrUpdate
(
driveIndCatalog
);
return
driveIndCatalog
.
getId
();
return
driveIndCatalog
.
getId
();
}
}
@ApiOperation
(
value
=
"批量级联删除考核指标目录"
,
notes
=
"批量级联删除考核指标目录"
)
@ApiOperation
(
value
=
"批量级联删除考核指标目录"
,
notes
=
"批量级联删除考核指标目录"
)
@PostMapping
(
value
=
"/deleteDriveIndCatalog"
)
@PostMapping
(
value
=
"/deleteDriveIndCatalog"
)
public
void
deleteDriveIndCatalog
(
@RequestParam
List
<
String
>
ids
)
throws
Exception
{
public
void
deleteDriveIndCatalog
(
@RequestParam
List
<
Integer
>
ids
)
throws
Exception
{
driveIndCatalogService
.
recursionDelete
(
ids
);
driveIndCatalogService
.
recursionDelete
(
ids
);
}
}
@ApiOperation
(
value
=
"获取考核指标目录"
,
notes
=
"获取考核指标目录"
)
@ApiOperation
(
value
=
"获取考核指标目录"
,
notes
=
"获取考核指标目录"
)
@PostMapping
(
value
=
"/getDriveIndCatalog"
)
@PostMapping
(
value
=
"/getDriveIndCatalog"
)
public
List
<
DriveIndCatalog
>
getDriveIndCatalog
(
@RequestParam
(
required
=
false
)
String
parentId
,
public
List
<
DriveIndCatalog
>
getDriveIndCatalog
(
@RequestParam
(
required
=
false
)
Integer
parentId
,
@RequestParam
List
<
String
>
codes
){
@RequestParam
List
<
String
>
codes
){
return
driveIndCatalogService
.
getCatalog
(
parentId
,
codes
);
return
driveIndCatalogService
.
getCatalog
(
parentId
,
codes
);
}
}
...
...
src/main/java/com/keymobile/indicators/api/hytobacco/IndScorecardCtrl.java
View file @
0c5194c7
...
@@ -4,7 +4,6 @@ import java.util.List;
...
@@ -4,7 +4,6 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -30,34 +29,34 @@ public class IndScorecardCtrl {
...
@@ -30,34 +29,34 @@ public class IndScorecardCtrl {
@ApiOperation
(
value
=
"新增/修改评分卡目录"
,
notes
=
"新增/修改评分卡目录"
)
@ApiOperation
(
value
=
"新增/修改评分卡目录"
,
notes
=
"新增/修改评分卡目录"
)
@PostMapping
(
value
=
"/saveOrUpdateCatalog"
)
@PostMapping
(
value
=
"/saveOrUpdateCatalog"
)
public
String
saveOrUpdateCatalog
(
@RequestBody
ScorecardCatalog
scorecardCatalog
)
throws
Exception
{
public
Integer
saveOrUpdateCatalog
(
@RequestBody
ScorecardCatalog
scorecardCatalog
)
throws
Exception
{
scorecardCatalog
=
scorecardCatalogService
.
saveOrUpdate
(
scorecardCatalog
);
scorecardCatalog
=
scorecardCatalogService
.
saveOrUpdate
(
scorecardCatalog
);
return
scorecardCatalog
.
getId
();
return
scorecardCatalog
.
getId
();
}
}
@ApiOperation
(
value
=
"批量级联删除评分卡目录"
,
notes
=
"批量级联删除评分卡目录"
)
@ApiOperation
(
value
=
"批量级联删除评分卡目录"
,
notes
=
"批量级联删除评分卡目录"
)
@PostMapping
(
value
=
"/deleteCatalog"
)
@PostMapping
(
value
=
"/deleteCatalog"
)
public
void
deleteCatalog
(
@RequestParam
List
<
String
>
ids
)
throws
Exception
{
public
void
deleteCatalog
(
@RequestParam
List
<
Integer
>
ids
)
throws
Exception
{
scorecardCatalogService
.
recursionDelete
(
ids
);
scorecardCatalogService
.
recursionDelete
(
ids
);
}
}
@ApiOperation
(
value
=
"获取评分卡目录"
,
notes
=
"获取评分卡目录"
)
@ApiOperation
(
value
=
"获取评分卡目录"
,
notes
=
"获取评分卡目录"
)
@PostMapping
(
value
=
"/getCatalog"
)
@PostMapping
(
value
=
"/getCatalog"
)
public
List
<
ScorecardCatalog
>
getCatalog
(
@RequestParam
(
required
=
false
)
String
parentId
,
public
List
<
ScorecardCatalog
>
getCatalog
(
@RequestParam
(
required
=
false
)
Integer
parentId
,
@RequestParam
List
<
String
>
codes
){
@RequestParam
List
<
String
>
codes
){
return
scorecardCatalogService
.
getCatalog
(
parentId
,
codes
);
return
scorecardCatalogService
.
getCatalog
(
parentId
,
codes
);
}
}
@ApiOperation
(
value
=
"新增/修改"
,
notes
=
"新增/修改"
)
@ApiOperation
(
value
=
"新增/修改"
,
notes
=
"新增/修改"
)
@PostMapping
(
value
=
"/saveOrUpdate"
)
@PostMapping
(
value
=
"/saveOrUpdate"
)
public
String
saveOrUpdate
(
@RequestBody
IndScorecard
indScorecard
,
@RequestParam
String
catalogId
,
public
Integer
saveOrUpdate
(
@RequestBody
IndScorecard
indScorecard
,
@RequestParam
Integer
catalogId
,
@RequestParam
String
catalogIdPath
,
@RequestParam
String
user
)
{
@RequestParam
String
catalogIdPath
,
@RequestParam
String
user
)
{
return
indScorecardService
.
saveOrUpdate
(
indScorecard
,
catalogId
,
catalogIdPath
,
user
);
return
indScorecardService
.
saveOrUpdate
(
indScorecard
,
catalogId
,
catalogIdPath
,
user
);
}
}
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除"
)
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除"
)
@PostMapping
(
value
=
"/delete"
)
@PostMapping
(
value
=
"/delete"
)
public
void
delete
(
@RequestBody
List
<
String
>
ids
)
{
public
void
delete
(
@RequestBody
List
<
Integer
>
ids
)
{
indScorecardService
.
delete
(
ids
);
indScorecardService
.
delete
(
ids
);
}
}
...
@@ -69,7 +68,7 @@ public class IndScorecardCtrl {
...
@@ -69,7 +68,7 @@ public class IndScorecardCtrl {
@ApiOperation
(
value
=
"根据评分卡目录获取评分卡"
,
notes
=
"根据评分卡目录获取评分卡"
)
@ApiOperation
(
value
=
"根据评分卡目录获取评分卡"
,
notes
=
"根据评分卡目录获取评分卡"
)
@PostMapping
(
value
=
"/getByCatalogId"
)
@PostMapping
(
value
=
"/getByCatalogId"
)
public
Page
<
IndScorecard
>
getByCatalogId
(
@RequestParam
String
catalogId
,
public
Map
<
String
,
Object
>
getByCatalogId
(
@RequestParam
Integer
catalogId
,
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"rows"
,
required
=
false
,
defaultValue
=
"10"
)
int
rows
){
@RequestParam
(
value
=
"rows"
,
required
=
false
,
defaultValue
=
"10"
)
int
rows
){
return
indScorecardService
.
getByCatalogId
(
catalogId
,
page
,
rows
);
return
indScorecardService
.
getByCatalogId
(
catalogId
,
page
,
rows
);
...
@@ -77,14 +76,14 @@ public class IndScorecardCtrl {
...
@@ -77,14 +76,14 @@ public class IndScorecardCtrl {
@ApiOperation
(
value
=
"根据id获取评分卡"
,
notes
=
"根据id获取评分卡"
)
@ApiOperation
(
value
=
"根据id获取评分卡"
,
notes
=
"根据id获取评分卡"
)
@PostMapping
(
value
=
"/findById"
)
@PostMapping
(
value
=
"/findById"
)
public
IndScorecard
findById
(
@RequestParam
String
id
)
{
public
IndScorecard
findById
(
@RequestParam
Integer
id
)
{
return
indScorecardService
.
findById
(
id
);
return
indScorecardService
.
findById
(
id
);
}
}
@ApiOperation
(
value
=
"根据评分卡计算指标分数"
,
notes
=
"根据评分卡计算指标分数"
)
@ApiOperation
(
value
=
"根据评分卡计算指标分数"
,
notes
=
"根据评分卡计算指标分数"
)
@PostMapping
(
value
=
"/calculateIndiScore"
)
@PostMapping
(
value
=
"/calculateIndiScore"
)
public
Map
<
String
,
String
>
calculateIndiScore
(
@RequestParam
String
indId
,
@RequestParam
int
date
,
public
Map
<
String
,
String
>
calculateIndiScore
(
@RequestParam
String
indId
,
@RequestParam
int
date
,
@RequestParam
String
compareObj
,
@RequestParam
String
indScorecardId
,
@RequestParam
String
compareObj
,
@RequestParam
Integer
indScorecardId
,
@RequestParam
String
compareId
,
@RequestBody
List
<
String
>
compareObjs
)
throws
Exception
{
@RequestParam
String
compareId
,
@RequestBody
List
<
String
>
compareObjs
)
throws
Exception
{
return
indScorecardService
.
calculateIndiScore
(
indId
,
date
,
compareObj
,
return
indScorecardService
.
calculateIndiScore
(
indId
,
date
,
compareObj
,
indScorecardId
,
compareId
,
compareObjs
);
indScorecardId
,
compareId
,
compareObjs
);
...
...
src/main/java/com/keymobile/indicators/api/hytobacco/IndicatorsDefCtrl.java
View file @
0c5194c7
...
@@ -32,7 +32,7 @@ public class IndicatorsDefCtrl {
...
@@ -32,7 +32,7 @@ public class IndicatorsDefCtrl {
@ApiOperation
(
value
=
"新建基础指标"
,
notes
=
"新建基础指标"
)
@ApiOperation
(
value
=
"新建基础指标"
,
notes
=
"新建基础指标"
)
@PostMapping
(
value
=
"/createBaseInd"
)
@PostMapping
(
value
=
"/createBaseInd"
)
public
void
createBaseInd
(
@RequestBody
BaseIndDef
baseIndDef
,
@RequestParam
String
catalogId
,
public
void
createBaseInd
(
@RequestBody
BaseIndDef
baseIndDef
,
@RequestParam
Integer
catalogId
,
@RequestParam
String
catalogIdPath
,
@RequestParam
String
user
)
throws
Exception
{
@RequestParam
String
catalogIdPath
,
@RequestParam
String
user
)
throws
Exception
{
baseIndDefService
.
saveOrUpdate
(
baseIndDef
,
catalogId
,
catalogIdPath
,
user
);
baseIndDefService
.
saveOrUpdate
(
baseIndDef
,
catalogId
,
catalogIdPath
,
user
);
}
}
...
@@ -45,7 +45,7 @@ public class IndicatorsDefCtrl {
...
@@ -45,7 +45,7 @@ public class IndicatorsDefCtrl {
@ApiOperation
(
value
=
"根据关键字查询基础指标"
,
notes
=
"根据关键字查询基础指标"
)
@ApiOperation
(
value
=
"根据关键字查询基础指标"
,
notes
=
"根据关键字查询基础指标"
)
@PostMapping
(
value
=
"/getByPageAndKeyword"
)
@PostMapping
(
value
=
"/getByPageAndKeyword"
)
public
Map
<
String
,
Object
>
getByPageAndKeyword
(
@RequestParam
String
catalogId
,
public
Map
<
String
,
Object
>
getByPageAndKeyword
(
@RequestParam
Integer
catalogId
,
@RequestParam
(
required
=
false
)
String
keyword
,
@RequestParam
(
required
=
false
)
String
keyword
,
@RequestParam
(
defaultValue
=
"0"
)
int
page
,
@RequestParam
(
defaultValue
=
"10"
)
int
rows
)
throws
Exception
{
@RequestParam
(
defaultValue
=
"0"
)
int
page
,
@RequestParam
(
defaultValue
=
"10"
)
int
rows
)
throws
Exception
{
return
baseIndDefService
.
getByPageAndKeyword
(
catalogId
,
keyword
,
page
,
rows
);
return
baseIndDefService
.
getByPageAndKeyword
(
catalogId
,
keyword
,
page
,
rows
);
...
@@ -53,7 +53,7 @@ public class IndicatorsDefCtrl {
...
@@ -53,7 +53,7 @@ public class IndicatorsDefCtrl {
@ApiOperation
(
value
=
"新建考核指标"
,
notes
=
"新建考核指标"
)
@ApiOperation
(
value
=
"新建考核指标"
,
notes
=
"新建考核指标"
)
@PostMapping
(
value
=
"/createDriveInd"
)
@PostMapping
(
value
=
"/createDriveInd"
)
public
void
createDriveInd
(
@RequestBody
DriveIndDef
driveIndDef
,
@RequestParam
String
catalogId
,
public
void
createDriveInd
(
@RequestBody
DriveIndDef
driveIndDef
,
@RequestParam
Integer
catalogId
,
@RequestParam
String
catalogIdPath
,
@RequestParam
String
user
)
throws
Exception
{
@RequestParam
String
catalogIdPath
,
@RequestParam
String
user
)
throws
Exception
{
driveIndDefService
.
saveOrUpdate
(
driveIndDef
,
catalogId
,
catalogIdPath
,
user
);
driveIndDefService
.
saveOrUpdate
(
driveIndDef
,
catalogId
,
catalogIdPath
,
user
);
}
}
...
@@ -66,7 +66,7 @@ public class IndicatorsDefCtrl {
...
@@ -66,7 +66,7 @@ public class IndicatorsDefCtrl {
@ApiOperation
(
value
=
"根据关键字查询考核指标"
,
notes
=
"根据关键字查询考核指标"
)
@ApiOperation
(
value
=
"根据关键字查询考核指标"
,
notes
=
"根据关键字查询考核指标"
)
@PostMapping
(
value
=
"/getDriveByPageAndKeyword"
)
@PostMapping
(
value
=
"/getDriveByPageAndKeyword"
)
public
Map
<
String
,
Object
>
getDriveByPageAndKeyword
(
@RequestParam
String
catalogId
,
public
Map
<
String
,
Object
>
getDriveByPageAndKeyword
(
@RequestParam
Integer
catalogId
,
@RequestParam
(
required
=
false
)
String
keyword
,
@RequestParam
(
required
=
false
)
String
keyword
,
@RequestParam
(
defaultValue
=
"0"
)
int
page
,
@RequestParam
(
defaultValue
=
"10"
)
int
rows
)
throws
Exception
{
@RequestParam
(
defaultValue
=
"0"
)
int
page
,
@RequestParam
(
defaultValue
=
"10"
)
int
rows
)
throws
Exception
{
return
driveIndDefService
.
getByPageAndKeyword
(
catalogId
,
keyword
,
page
,
rows
);
return
driveIndDefService
.
getByPageAndKeyword
(
catalogId
,
keyword
,
page
,
rows
);
...
...
src/main/java/com/keymobile/indicators/api/hytobacco/ObjScoreRuleCtrl.java
View file @
0c5194c7
...
@@ -4,7 +4,6 @@ import java.util.List;
...
@@ -4,7 +4,6 @@ import java.util.List;
import
java.util.Map
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -30,40 +29,40 @@ public class ObjScoreRuleCtrl {
...
@@ -30,40 +29,40 @@ public class ObjScoreRuleCtrl {
@ApiOperation
(
value
=
"新增/修改单位规则目录"
,
notes
=
"新增/修改单位规则目录"
)
@ApiOperation
(
value
=
"新增/修改单位规则目录"
,
notes
=
"新增/修改单位规则目录"
)
@PostMapping
(
value
=
"/saveOrUpdateCatalog"
)
@PostMapping
(
value
=
"/saveOrUpdateCatalog"
)
public
String
saveOrUpdateCatalog
(
@RequestBody
ScoreRuleCatalog
scoreRuleCatalog
)
throws
Exception
{
public
Integer
saveOrUpdateCatalog
(
@RequestBody
ScoreRuleCatalog
scoreRuleCatalog
)
throws
Exception
{
scoreRuleCatalog
=
scoreRuleCatalogService
.
saveOrUpdate
(
scoreRuleCatalog
);
scoreRuleCatalog
=
scoreRuleCatalogService
.
saveOrUpdate
(
scoreRuleCatalog
);
return
scoreRuleCatalog
.
getId
();
return
scoreRuleCatalog
.
getId
();
}
}
@ApiOperation
(
value
=
"批量级联删除单位规则目录"
,
notes
=
"批量级联删除单位规则目录"
)
@ApiOperation
(
value
=
"批量级联删除单位规则目录"
,
notes
=
"批量级联删除单位规则目录"
)
@PostMapping
(
value
=
"/deleteCatalog"
)
@PostMapping
(
value
=
"/deleteCatalog"
)
public
void
deleteCatalog
(
@RequestParam
List
<
String
>
ids
)
throws
Exception
{
public
void
deleteCatalog
(
@RequestParam
List
<
Integer
>
ids
)
throws
Exception
{
scoreRuleCatalogService
.
recursionDelete
(
ids
);
scoreRuleCatalogService
.
recursionDelete
(
ids
);
}
}
@ApiOperation
(
value
=
"获取单位规则目录"
,
notes
=
"获取单位规则目录"
)
@ApiOperation
(
value
=
"获取单位规则目录"
,
notes
=
"获取单位规则目录"
)
@PostMapping
(
value
=
"/getCatalog"
)
@PostMapping
(
value
=
"/getCatalog"
)
public
List
<
ScoreRuleCatalog
>
getCatalog
(
@RequestParam
(
required
=
false
)
String
parentId
,
public
List
<
ScoreRuleCatalog
>
getCatalog
(
@RequestParam
(
required
=
false
)
Integer
parentId
,
@RequestParam
List
<
String
>
codes
){
@RequestParam
List
<
String
>
codes
){
return
scoreRuleCatalogService
.
getCatalog
(
parentId
,
codes
);
return
scoreRuleCatalogService
.
getCatalog
(
parentId
,
codes
);
}
}
@ApiOperation
(
value
=
"新增/修改"
,
notes
=
"新增/修改"
)
@ApiOperation
(
value
=
"新增/修改"
,
notes
=
"新增/修改"
)
@PostMapping
(
value
=
"/saveOrUpdate"
)
@PostMapping
(
value
=
"/saveOrUpdate"
)
public
String
saveOrUpdate
(
@RequestBody
ScoreRule
scoreRule
,
@RequestParam
String
catalogId
,
public
Integer
saveOrUpdate
(
@RequestBody
ScoreRule
scoreRule
,
@RequestParam
Integer
catalogId
,
@RequestParam
String
catalogIdPath
,
@RequestParam
String
user
)
{
@RequestParam
String
catalogIdPath
,
@RequestParam
String
user
)
{
return
scoreRuleService
.
saveOrUpdate
(
scoreRule
,
catalogId
,
catalogIdPath
,
user
);
return
scoreRuleService
.
saveOrUpdate
(
scoreRule
,
catalogId
,
catalogIdPath
,
user
);
}
}
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除"
)
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除"
)
@PostMapping
(
value
=
"/delete"
)
@PostMapping
(
value
=
"/delete"
)
public
void
delete
(
@RequestParam
String
id
)
{
public
void
delete
(
@RequestParam
Integer
id
)
{
scoreRuleService
.
delete
(
id
);
scoreRuleService
.
delete
(
id
);
}
}
@ApiOperation
(
value
=
"根据单位评分规则目录获取单位评分规则"
,
notes
=
"根据单位评分规则目录获取单位评分规则"
)
@ApiOperation
(
value
=
"根据单位评分规则目录获取单位评分规则"
,
notes
=
"根据单位评分规则目录获取单位评分规则"
)
@PostMapping
(
value
=
"/getByCatalogId"
)
@PostMapping
(
value
=
"/getByCatalogId"
)
public
Page
<
ScoreRule
>
getByCatalogId
(
@RequestParam
String
catalogId
,
public
Map
<
String
,
Object
>
getByCatalogId
(
@RequestParam
Integer
catalogId
,
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"rows"
,
required
=
false
,
defaultValue
=
"10"
)
int
rows
){
@RequestParam
(
value
=
"rows"
,
required
=
false
,
defaultValue
=
"10"
)
int
rows
){
return
scoreRuleService
.
getByCatalogId
(
catalogId
,
page
,
rows
);
return
scoreRuleService
.
getByCatalogId
(
catalogId
,
page
,
rows
);
...
@@ -71,7 +70,7 @@ public class ObjScoreRuleCtrl {
...
@@ -71,7 +70,7 @@ public class ObjScoreRuleCtrl {
@ApiOperation
(
value
=
"根据id获取单位评分规则"
,
notes
=
"根据id获取单位评分规则"
)
@ApiOperation
(
value
=
"根据id获取单位评分规则"
,
notes
=
"根据id获取单位评分规则"
)
@PostMapping
(
value
=
"/findById"
)
@PostMapping
(
value
=
"/findById"
)
public
ScoreRule
findById
(
@RequestParam
String
id
)
{
public
ScoreRule
findById
(
@RequestParam
Integer
id
)
{
return
scoreRuleService
.
getById
(
id
);
return
scoreRuleService
.
getById
(
id
);
}
}
...
@@ -80,7 +79,7 @@ public class ObjScoreRuleCtrl {
...
@@ -80,7 +79,7 @@ public class ObjScoreRuleCtrl {
public
List
<
Map
<
String
,
String
>>
calculateObjectScore
(
@RequestParam
String
reportId
,
public
List
<
Map
<
String
,
String
>>
calculateObjectScore
(
@RequestParam
String
reportId
,
@RequestParam
String
compareId
,
@RequestParam
List
<
String
>
indIds
,
@RequestParam
String
compareId
,
@RequestParam
List
<
String
>
indIds
,
@RequestParam
List
<
String
>
compareObjs
,
@RequestParam
int
date
,
@RequestParam
List
<
String
>
compareObjs
,
@RequestParam
int
date
,
@RequestParam
String
scoreRuleId
){
@RequestParam
Integer
scoreRuleId
){
return
scoreRuleService
.
calObjScore
(
reportId
,
compareId
,
indIds
,
compareObjs
,
date
,
scoreRuleId
);
return
scoreRuleService
.
calObjScore
(
reportId
,
compareId
,
indIds
,
compareObjs
,
date
,
scoreRuleId
);
}
}
}
}
src/main/java/com/keymobile/indicators/api/hytobacco/ShortboardRuleCtrl.java
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
api
.
hytobacco
;
package
com
.
keymobile
.
indicators
.
api
.
hytobacco
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
...
@@ -29,40 +29,40 @@ public class ShortboardRuleCtrl {
...
@@ -29,40 +29,40 @@ public class ShortboardRuleCtrl {
@ApiOperation
(
value
=
"新增/修改短板筛选规则目录"
,
notes
=
"新增/修改短板筛选规则目录"
)
@ApiOperation
(
value
=
"新增/修改短板筛选规则目录"
,
notes
=
"新增/修改短板筛选规则目录"
)
@PostMapping
(
value
=
"/saveOrUpdateCatalog"
)
@PostMapping
(
value
=
"/saveOrUpdateCatalog"
)
public
String
saveOrUpdateCatalog
(
@RequestBody
ShortboardCatalog
shortboardCatalog
)
throws
Exception
{
public
Integer
saveOrUpdateCatalog
(
@RequestBody
ShortboardCatalog
shortboardCatalog
)
throws
Exception
{
shortboardCatalog
=
shortboardCatalogService
.
saveOrUpdate
(
shortboardCatalog
);
shortboardCatalog
=
shortboardCatalogService
.
saveOrUpdate
(
shortboardCatalog
);
return
shortboardCatalog
.
getId
();
return
shortboardCatalog
.
getId
();
}
}
@ApiOperation
(
value
=
"批量级联删除短板筛选规则目录"
,
notes
=
"批量级联删除短板筛选规则目录"
)
@ApiOperation
(
value
=
"批量级联删除短板筛选规则目录"
,
notes
=
"批量级联删除短板筛选规则目录"
)
@PostMapping
(
value
=
"/deleteCatalog"
)
@PostMapping
(
value
=
"/deleteCatalog"
)
public
void
deleteCatalog
(
@RequestParam
List
<
String
>
ids
)
throws
Exception
{
public
void
deleteCatalog
(
@RequestParam
List
<
Integer
>
ids
)
throws
Exception
{
shortboardCatalogService
.
recursionDelete
(
ids
);
shortboardCatalogService
.
recursionDelete
(
ids
);
}
}
@ApiOperation
(
value
=
"获取短板筛选规则目录"
,
notes
=
"获取短板筛选规则目录"
)
@ApiOperation
(
value
=
"获取短板筛选规则目录"
,
notes
=
"获取短板筛选规则目录"
)
@PostMapping
(
value
=
"/getCatalog"
)
@PostMapping
(
value
=
"/getCatalog"
)
public
List
<
ShortboardCatalog
>
getCatalog
(
@RequestParam
(
required
=
false
)
String
parentId
,
public
List
<
ShortboardCatalog
>
getCatalog
(
@RequestParam
(
required
=
false
)
Integer
parentId
,
@RequestParam
List
<
String
>
codes
){
@RequestParam
List
<
String
>
codes
){
return
shortboardCatalogService
.
getCatalog
(
parentId
,
codes
);
return
shortboardCatalogService
.
getCatalog
(
parentId
,
codes
);
}
}
@ApiOperation
(
value
=
"新增/修改"
,
notes
=
"新增/修改"
)
@ApiOperation
(
value
=
"新增/修改"
,
notes
=
"新增/修改"
)
@PostMapping
(
value
=
"/saveOrUpdate"
)
@PostMapping
(
value
=
"/saveOrUpdate"
)
public
String
saveOrUpdate
(
@RequestBody
ShortboardRule
shortboardRule
,
@RequestParam
String
catalogId
,
public
Integer
saveOrUpdate
(
@RequestBody
ShortboardRule
shortboardRule
,
@RequestParam
Integer
catalogId
,
@RequestParam
String
catalogIdPath
,
@RequestParam
String
user
)
{
@RequestParam
String
catalogIdPath
,
@RequestParam
String
user
)
{
return
shortboardRuleService
.
saveOrUpdate
(
shortboardRule
,
catalogId
,
catalogIdPath
,
user
);
return
shortboardRuleService
.
saveOrUpdate
(
shortboardRule
,
catalogId
,
catalogIdPath
,
user
);
}
}
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除"
)
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除"
)
@PostMapping
(
value
=
"/delete"
)
@PostMapping
(
value
=
"/delete"
)
public
void
delete
(
@RequestParam
String
id
)
{
public
void
delete
(
@RequestParam
Integer
id
)
{
shortboardRuleService
.
delete
(
id
);
shortboardRuleService
.
delete
(
id
);
}
}
@ApiOperation
(
value
=
"根据短板筛选规则目录获取短板筛选规则"
,
notes
=
"根据短板筛选规则目录获取短板筛选规则"
)
@ApiOperation
(
value
=
"根据短板筛选规则目录获取短板筛选规则"
,
notes
=
"根据短板筛选规则目录获取短板筛选规则"
)
@PostMapping
(
value
=
"/getByCatalogId"
)
@PostMapping
(
value
=
"/getByCatalogId"
)
public
Page
<
ShortboardRule
>
getByCatalogId
(
@RequestParam
String
catalogId
,
public
Map
<
String
,
Object
>
getByCatalogId
(
@RequestParam
Integer
catalogId
,
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"page"
,
required
=
false
,
defaultValue
=
"1"
)
int
page
,
@RequestParam
(
value
=
"rows"
,
required
=
false
,
defaultValue
=
"10"
)
int
rows
){
@RequestParam
(
value
=
"rows"
,
required
=
false
,
defaultValue
=
"10"
)
int
rows
){
return
shortboardRuleService
.
getByCatalogId
(
catalogId
,
page
,
rows
);
return
shortboardRuleService
.
getByCatalogId
(
catalogId
,
page
,
rows
);
...
@@ -70,7 +70,7 @@ public class ShortboardRuleCtrl {
...
@@ -70,7 +70,7 @@ public class ShortboardRuleCtrl {
@ApiOperation
(
value
=
"根据id获取短板筛选规则"
,
notes
=
"根据id获取短板筛选规则"
)
@ApiOperation
(
value
=
"根据id获取短板筛选规则"
,
notes
=
"根据id获取短板筛选规则"
)
@PostMapping
(
value
=
"/findById"
)
@PostMapping
(
value
=
"/findById"
)
public
ShortboardRule
findById
(
@RequestParam
String
id
)
{
public
ShortboardRule
findById
(
@RequestParam
Integer
id
)
{
return
shortboardRuleService
.
getById
(
id
);
return
shortboardRuleService
.
getById
(
id
);
}
}
}
}
src/main/java/com/keymobile/indicators/model/entity/indicators/BaseIndDef.java
View file @
0c5194c7
...
@@ -30,6 +30,6 @@ public class BaseIndDef {
...
@@ -30,6 +30,6 @@ public class BaseIndDef {
private
Integer
defStaTime
;
private
Integer
defStaTime
;
private
Integer
defEndTime
;
private
Integer
defEndTime
;
private
String
version
;
//版本号
private
String
version
;
//版本号
private
String
catalogId
;
//挂靠目录id
private
Integer
catalogId
;
//挂靠目录id
private
String
catalogIdPath
;
//挂靠目录idPath,方便用目录类别找到对应的挂靠指标
private
String
catalogIdPath
;
//挂靠目录idPath,方便用目录类别找到对应的挂靠指标
}
}
src/main/java/com/keymobile/indicators/model/entity/indicators/BaseIndDefVersionData.java
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
import
java.
io.Serializabl
e
;
import
java.
util.Dat
e
;
import
org.springframework.data.annotation.Id
;
import
javax.persistence.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
javax.persistence.Table
;
import
com.keymobile.indicators.utils.DateUtils
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -11,17 +13,13 @@ import lombok.Data;
...
@@ -11,17 +13,13 @@ import lombok.Data;
*author:zhangkb time:2020-5-20 desc:基础项数据版本数据
*author:zhangkb time:2020-5-20 desc:基础项数据版本数据
*/
*/
@Data
@Data
@Document
(
collection
=
"base_ind_def_version_data"
)
@Table
(
name
=
"base_ind_def_version_data"
)
public
class
BaseIndDefVersionData
implements
Serializable
{
public
class
BaseIndDefVersionData
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
@Id
private
String
id
;
private
Integer
id
;
private
String
indId
;
private
String
indId
;
private
String
indName
;
private
String
indName
;
private
String
version
;
private
String
version
;
private
String
dataJson
;
private
String
dataJson
;
private
String
lastUpdateTime
=
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
);
}
}
src/main/java/com/keymobile/indicators/model/entity/indicators/DriveIndCalResultDef.java
View file @
0c5194c7
...
@@ -2,6 +2,8 @@ package com.keymobile.indicators.model.entity.indicators;
...
@@ -2,6 +2,8 @@ package com.keymobile.indicators.model.entity.indicators;
import
java.util.Date
;
import
java.util.Date
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
javax.persistence.Table
;
...
@@ -16,6 +18,7 @@ import lombok.Data;
...
@@ -16,6 +18,7 @@ import lombok.Data;
@Table
(
name
=
"drive_ind_cal_result_def"
)
@Table
(
name
=
"drive_ind_cal_result_def"
)
public
class
DriveIndCalResultDef
{
public
class
DriveIndCalResultDef
{
@Id
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
private
Integer
id
;
private
String
compareId
;
private
String
compareId
;
...
...
src/main/java/com/keymobile/indicators/model/entity/indicators/DriveIndCatalog.java
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
import
org.springframework.data.annotation.Id
;
import
javax.persistence.GeneratedValue
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
com.keymobile.indicators.utils.DateUtils
;
import
com.keymobile.indicators.utils.DateUtils
;
...
@@ -14,19 +15,15 @@ import lombok.Data;
...
@@ -14,19 +15,15 @@ import lombok.Data;
*author:zhangkb time:2020-5-18 desc:考核指标目录
*author:zhangkb time:2020-5-18 desc:考核指标目录
*/
*/
@Data
@Data
@Document
(
collection
=
"drive_ind_catalog"
)
@Table
(
name
=
"drive_ind_catalog"
)
public
class
DriveIndCatalog
implements
Serializable
{
public
class
DriveIndCatalog
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
@Id
private
String
id
;
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
private
String
catalogName
;
private
String
catalogName
;
//private String type;
//private String type;
private
String
catalogType
;
//分为数据项级别和数据项类别 0:数据项级别 1:数据项类别 2:普通目录
private
String
catalogType
;
//分为数据项级别和数据项类别 0:数据项级别 1:数据项类别 2:普通目录
private
String
parentId
;
//顶层节点parentId为0
private
Integer
parentId
;
//顶层节点parentId为0
private
String
idPath
;
private
String
idPath
;
private
String
code
;
//目录编码
private
String
code
;
//目录编码
private
String
lastUpdater
;
private
String
lastUpdater
;
...
...
src/main/java/com/keymobile/indicators/model/entity/indicators/DriveIndDef.java
View file @
0c5194c7
...
@@ -25,12 +25,12 @@ public class DriveIndDef {
...
@@ -25,12 +25,12 @@ public class DriveIndDef {
private
String
indFormatDesc
;
//指标公式描述
private
String
indFormatDesc
;
//指标公式描述
private
String
isCalScore
;
//是否计分 是:1 否:0
private
String
isCalScore
;
//是否计分 是:1 否:0
private
String
indRule
;
//指标正负属性:正向指标0 反向指标1
private
String
indRule
;
//指标正负属性:正向指标0 反向指标1
private
String
indCalScoreRule
;
//计分规则
private
Integer
indCalScoreRule
;
//计分规则
private
String
indCalScoreRuleDesc
;
//计分规则描述
private
String
indCalScoreRuleDesc
;
//计分规则描述
private
String
isUnitCalScore
;
//是否参与单位得分计算 是:1 否:0
private
String
isUnitCalScore
;
//是否参与单位得分计算 是:1 否:0
private
String
indFrequency
;
//指标频度
private
String
indFrequency
;
//指标频度
private
String
version
;
//版本号
private
String
version
;
//版本号
private
String
catalogId
;
//挂靠目录id
private
Integer
catalogId
;
//挂靠目录id
private
String
catalogIdPath
;
//挂靠目录idPath,方便用目录类别找到对应的挂靠指标
private
String
catalogIdPath
;
//挂靠目录idPath,方便用目录类别找到对应的挂靠指标
private
String
creater
;
private
String
creater
;
private
Date
createTime
;
private
Date
createTime
;
...
...
src/main/java/com/keymobile/indicators/model/entity/indicators/DriveIndDefVersionData.java
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
import
java.
io.Serializabl
e
;
import
java.
util.Dat
e
;
import
org.springframework.data.annotation.Id
;
import
javax.persistence.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
javax.persistence.Table
;
import
com.keymobile.indicators.utils.DateUtils
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -11,17 +13,13 @@ import lombok.Data;
...
@@ -11,17 +13,13 @@ import lombok.Data;
*author:zhangkb time:2020-5-21 desc:考核指标数据版本数据
*author:zhangkb time:2020-5-21 desc:考核指标数据版本数据
*/
*/
@Data
@Data
@Document
(
collection
=
"drive_ind_def_version_data"
)
@Table
(
name
=
"drive_ind_def_version_data"
)
public
class
DriveIndDefVersionData
implements
Serializable
{
public
class
DriveIndDefVersionData
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
@Id
private
String
id
;
private
Integer
id
;
private
String
indId
;
private
String
indId
;
private
String
indName
;
private
String
indName
;
private
String
version
;
private
String
version
;
private
String
dataJson
;
private
String
dataJson
;
private
String
lastUpdateTime
=
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
);
}
}
src/main/java/com/keymobile/indicators/model/entity/indicators/IndCatalog.java
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
org.springframework.data.annotation.Id
;
import
javax.persistence.GeneratedValue
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
com.keymobile.indicators.utils.DateUtils
;
import
com.keymobile.indicators.utils.DateUtils
;
...
@@ -15,19 +15,15 @@ import lombok.Data;
...
@@ -15,19 +15,15 @@ import lombok.Data;
*author:zhangkb time:2020-5-18 desc:基础项目录
*author:zhangkb time:2020-5-18 desc:基础项目录
*/
*/
@Data
@Data
@Document
(
collection
=
"ind_catalog"
)
@Table
(
name
=
"base_ind_catalog"
)
public
class
IndCatalog
implements
Serializable
{
public
class
IndCatalog
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
@Id
private
String
id
;
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
private
String
catalogName
;
private
String
catalogName
;
//private String type;
//private String type;
private
String
catalogType
;
//分为数据项级别和数据项类别 0:数据项级别 1:数据项类别 2:普通目录
private
String
catalogType
;
//分为数据项级别和数据项类别 0:数据项级别 1:数据项类别 2:普通目录
private
String
parentId
;
//顶层节点parentId为0
private
Integer
parentId
;
//顶层节点parentId为0
private
String
idPath
;
private
String
idPath
;
private
String
code
;
//目录编码
private
String
code
;
//目录编码
private
String
lastUpdater
;
private
String
lastUpdater
;
...
...
src/main/java/com/keymobile/indicators/model/entity/indicators/IndicatorsData.java
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
javax.persistence.Table
;
...
@@ -12,6 +14,7 @@ import lombok.Data;
...
@@ -12,6 +14,7 @@ import lombok.Data;
@Table
(
name
=
"indi_data_def"
)
@Table
(
name
=
"indi_data_def"
)
public
class
IndicatorsData
{
public
class
IndicatorsData
{
@Id
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
private
Integer
id
;
private
String
indId
;
private
String
indId
;
...
...
src/main/java/com/keymobile/indicators/model/entity/objscorerule/ScoreRule.java
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
objscorerule
;
package
com
.
keymobile
.
indicators
.
model
.
entity
.
objscorerule
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
org.springframework.data.annotation.Id
;
import
javax.persistence.GeneratedValue
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
com.keymobile.indicators.utils.DateUtils
;
import
com.keymobile.indicators.utils.DateUtils
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -16,34 +16,26 @@ import lombok.Data;
...
@@ -16,34 +16,26 @@ import lombok.Data;
*author:zhangkb time:2020-6-2 desc:单位评分规则实体
*author:zhangkb time:2020-6-2 desc:单位评分规则实体
*/
*/
@Data
@Data
@Document
(
collection
=
"obj_score_rule"
)
@Table
(
name
=
"obj_score_rule"
)
public
class
ScoreRule
implements
Serializable
{
public
class
ScoreRule
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
@Id
private
String
id
;
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
private
String
ruleName
;
//规则名称
private
String
ruleName
;
//规则名称
private
String
scoreType
;
//得分类型:0 指标值直接参与计算 1 指标得分分数参与计算(综合评分和改善提升分开算) 2指标得分分数参与计算(指标分数=综合+改善)
private
String
scoreType
;
//得分类型:0 指标值直接参与计算 1 指标得分分数参与计算(综合评分和改善提升分开算) 2指标得分分数参与计算(指标分数=综合+改善)
private
String
calType
;
//计算类型:0 计算组内所有考核指标平均数 1 根据目录类别分类算平均分后根据权重计算考核指标 2单个指标权重计算
private
String
calType
;
//计算类型:0 计算组内所有考核指标平均数 1 根据目录类别分类算平均分后根据权重计算考核指标 2单个指标权重计算
private
String
indTypeWeightsJson
;
private
List
<
IndTypeWeight
>
indTypeWeights
=
new
ArrayList
<>();
//目录类别权重数据
private
List
<
IndTypeWeight
>
indTypeWeights
=
new
ArrayList
<>();
//目录类别权重数据
private
String
calFormula
;
//当计算类型是2单个指标权重计算的时候,需要给出指标权重计算公式
private
String
calFormula
;
//当计算类型是2单个指标权重计算的时候,需要给出指标权重计算公式
private
String
calFormulaDesc
;
//单个指标权重计算公式描述
private
String
calFormulaDesc
;
//单个指标权重计算公式描述
private
String
catalogId
;
//单位得分计算目录id
private
Integer
catalogId
;
//单位得分计算目录id
private
String
catalogIdPath
;
//单位得分计算目录idPath
private
String
catalogIdPath
;
//单位得分计算目录idPath
private
String
code
;
//标识编码
private
String
code
;
//标识编码
private
String
d
esc
;
//规则描述
private
String
scoreRuleD
esc
;
//规则描述
private
String
lastUpdateTime
=
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
);
private
String
lastUpdateTime
=
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
);
private
String
lastUpdater
;
private
String
lastUpdater
;
public
List
<
IndTypeWeight
>
getIndTypeWeights
(){
return
indTypeWeights
;
}
public
void
setIndTypeWeights
(
List
<
IndTypeWeight
>
indTypeWeights
){
this
.
indTypeWeights
.
addAll
(
indTypeWeights
);
}
}
}
src/main/java/com/keymobile/indicators/model/entity/objscorerule/ScoreRuleCatalog.java
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
objscorerule
;
package
com
.
keymobile
.
indicators
.
model
.
entity
.
objscorerule
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
import
org.springframework.data.annotation.Id
;
import
javax.persistence.GeneratedValue
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
com.keymobile.indicators.utils.DateUtils
;
import
com.keymobile.indicators.utils.DateUtils
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -14,18 +14,14 @@ import lombok.Data;
...
@@ -14,18 +14,14 @@ import lombok.Data;
*author:zhangkb time:2020-6-9 desc:单位评分规则目录实体
*author:zhangkb time:2020-6-9 desc:单位评分规则目录实体
*/
*/
@Data
@Data
@Document
(
collection
=
"obj_score_rule_catalog"
)
@Table
(
name
=
"obj_score_rule_catalog"
)
public
class
ScoreRuleCatalog
implements
Serializable
{
public
class
ScoreRuleCatalog
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
@Id
private
String
id
;
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
private
String
catalogName
;
private
String
catalogName
;
private
String
catalogType
;
private
String
catalogType
;
private
String
parentId
;
//顶层节点parentId为0
private
Integer
parentId
;
//顶层节点parentId为0
private
String
idPath
;
private
String
idPath
;
private
String
code
;
//目录编码
private
String
code
;
//目录编码
private
String
lastUpdater
;
private
String
lastUpdater
;
...
...
src/main/java/com/keymobile/indicators/model/entity/scorecard/IndScorecard.java
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
scorecard
;
package
com
.
keymobile
.
indicators
.
model
.
entity
.
scorecard
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
org.springframework.data.annotation.Id
;
import
javax.persistence.GeneratedValue
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
com.keymobile.indicators.utils.DateUtils
;
import
com.keymobile.indicators.utils.DateUtils
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -16,48 +16,40 @@ import lombok.Data;
...
@@ -16,48 +16,40 @@ import lombok.Data;
*author:zhangkb time:2020-5-6 desc:考核指标评分卡
*author:zhangkb time:2020-5-6 desc:考核指标评分卡
*/
*/
@Data
@Data
@Document
(
collection
=
"drive_ind_score_card"
)
@Table
(
name
=
"drive_ind_score_card"
)
public
class
IndScorecard
implements
Serializable
{
public
class
IndScorecard
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
@Id
private
String
id
;
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
private
String
cardName
;
private
String
cardName
;
private
String
d
esc
;
private
String
cardD
esc
;
private
String
scoreType
;
//综合评分类型 0:定义 1:公式
private
String
scoreType
;
//综合评分类型 0:定义 1:公式
//定义综合评价
//定义综合评价
private
double
indBaseScore
;
//基础分
private
Double
indBaseScore
;
//基础分
private
double
moreAverage
;
//大于组内平均分加分
private
Double
moreAverage
;
//大于组内平均分加分
private
double
lessAverage
;
//小于组内平均分减分
private
Double
lessAverage
;
//小于组内平均分减分
private
String
addScoreItemJson
;
//加分项json
private
String
minusScoreItemJson
;
//减分项json
private
List
<
RankScoreDef
>
addScoreItem
=
new
ArrayList
<>();
//加分项
private
List
<
RankScoreDef
>
addScoreItem
=
new
ArrayList
<>();
//加分项
private
List
<
RankScoreDef
>
minusScoreItem
=
new
ArrayList
<>();
//减分项
private
List
<
RankScoreDef
>
minusScoreItem
=
new
ArrayList
<>();
//减分项
//公式综合评价
//公式综合评价
private
d
ouble
bestIndScore
;
//最佳指标分
private
D
ouble
bestIndScore
;
//最佳指标分
private
d
ouble
worstIndScore
;
//最差指标分
private
D
ouble
worstIndScore
;
//最差指标分
private
String
otherCalFormula
;
//其他计算公式
private
String
otherCalFormula
;
//其他计算公式
//改善提升
//改善提升
private
String
isIncluScore
;
//是否纳入单位计分 0:不纳入 1:纳入
private
String
isIncluScore
;
//是否纳入单位计分 0:不纳入 1:纳入
private
double
limitScore
;
//上限分数
private
Double
limitScore
;
//上限分数
private
String
improveScoreItemJson
;
//改善提升分数json
private
List
<
ImproveScoreDef
>
improveScoreItem
=
new
ArrayList
<>();
//改善提升分数
private
List
<
ImproveScoreDef
>
improveScoreItem
=
new
ArrayList
<>();
//改善提升分数
private
String
catalogId
;
//评分卡目录id
private
Integer
catalogId
;
//评分卡目录id
private
String
catalogIdPath
;
//评分卡目录idPath
private
String
catalogIdPath
;
//评分卡目录idPath
private
String
lastUpdateTime
=
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
);
private
String
lastUpdateTime
=
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
);
private
String
lastUpdater
;
private
String
lastUpdater
;
public
void
setAddScoreItem
(
List
<
RankScoreDef
>
addScoreItem
)
{
this
.
addScoreItem
.
addAll
(
addScoreItem
);
}
public
void
setMinusScoreItem
(
List
<
RankScoreDef
>
minusScoreItem
)
{
this
.
minusScoreItem
.
addAll
(
minusScoreItem
);
}
public
void
setImproveScoreItem
(
List
<
ImproveScoreDef
>
improveScoreItem
)
{
this
.
improveScoreItem
.
addAll
(
improveScoreItem
);
}
}
}
src/main/java/com/keymobile/indicators/model/entity/scorecard/ScorecardCatalog.java
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
scorecard
;
package
com
.
keymobile
.
indicators
.
model
.
entity
.
scorecard
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
import
org.springframework.data.annotation.Id
;
import
javax.persistence.GeneratedValue
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
com.keymobile.indicators.utils.DateUtils
;
import
com.keymobile.indicators.utils.DateUtils
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -14,18 +14,14 @@ import lombok.Data;
...
@@ -14,18 +14,14 @@ import lombok.Data;
*author:zhangkb time:2020-6-9 desc:指标评分卡目录实体
*author:zhangkb time:2020-6-9 desc:指标评分卡目录实体
*/
*/
@Data
@Data
@Document
(
collection
=
"score_card_catalog"
)
@Table
(
name
=
"score_card_catalog"
)
public
class
ScorecardCatalog
implements
Serializable
{
public
class
ScorecardCatalog
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
@Id
private
String
id
;
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
private
String
catalogName
;
private
String
catalogName
;
private
String
catalogType
;
private
String
catalogType
;
private
String
parentId
;
//顶层节点parentId为0
private
Integer
parentId
;
//顶层节点parentId为0
private
String
idPath
;
private
String
idPath
;
private
String
code
;
//目录编码
private
String
code
;
//目录编码
private
String
lastUpdater
;
private
String
lastUpdater
;
...
...
src/main/java/com/keymobile/indicators/model/entity/shortboard/ShortboardCatalog.java
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
shortboard
;
package
com
.
keymobile
.
indicators
.
model
.
entity
.
shortboard
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.Date
;
import
org.springframework.data.annotation.Id
;
import
javax.persistence.GeneratedValue
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
com.keymobile.indicators.utils.DateUtils
;
import
com.keymobile.indicators.utils.DateUtils
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -14,18 +14,15 @@ import lombok.Data;
...
@@ -14,18 +14,15 @@ import lombok.Data;
*author:zhangkb time:2020-6-10 desc:短板筛选规则目录实体
*author:zhangkb time:2020-6-10 desc:短板筛选规则目录实体
*/
*/
@Data
@Data
@Document
(
collection
=
"ind_short_board_catalog"
)
@Table
(
name
=
"ind_short_board_catalog"
)
public
class
ShortboardCatalog
implements
Serializable
{
public
class
ShortboardCatalog
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
@Id
private
String
id
;
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
private
String
catalogName
;
private
String
catalogName
;
private
String
catalogType
;
private
String
catalogType
;
private
String
parentId
;
//顶层节点parentId为0
private
Integer
parentId
;
//顶层节点parentId为0
private
String
idPath
;
private
String
idPath
;
private
String
code
;
//目录编码
private
String
code
;
//目录编码
private
String
lastUpdater
;
private
String
lastUpdater
;
...
...
src/main/java/com/keymobile/indicators/model/entity/shortboard/ShortboardDriveIndRel.java
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
shortboard
;
package
com
.
keymobile
.
indicators
.
model
.
entity
.
shortboard
;
import
java
.io.Serializabl
e
;
import
java
x.persistence.GeneratedValu
e
;
import
javax.persistence.GenerationType
;
import
org.springframework.data.annotation
.Id
;
import
javax.persistence
.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
javax.persistence.Table
;
import
lombok.Data
;
import
lombok.Data
;
...
@@ -11,19 +11,16 @@ import lombok.Data;
...
@@ -11,19 +11,16 @@ import lombok.Data;
* author:zhangkb time:2020-6-11 desc:新增短板筛选规则和考核指标关系中间表
* author:zhangkb time:2020-6-11 desc:新增短板筛选规则和考核指标关系中间表
*/
*/
@Data
@Data
@Document
(
collection
=
"short_board_drive_ind_rel"
)
@Table
(
name
=
"short_board_drive_ind_rel"
)
public
class
ShortboardDriveIndRel
implements
Serializable
{
public
class
ShortboardDriveIndRel
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
@Id
private
String
id
;
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
String
shortboardRuleId
;
//短板规则id
private
Integer
id
;
private
String
driveIndDefId
;
//考核指标id
private
Integer
shortboardRuleId
;
//短板规则id
private
Integer
driveIndDefId
;
//考核指标id
public
ShortboardDriveIndRel
(
String
driveIndDefId
,
String
shortboardRuleId
)
{
public
ShortboardDriveIndRel
(
Integer
driveIndDefId
,
Integer
shortboardRuleId
)
{
this
.
driveIndDefId
=
driveIndDefId
;
this
.
driveIndDefId
=
driveIndDefId
;
this
.
shortboardRuleId
=
shortboardRuleId
;
this
.
shortboardRuleId
=
shortboardRuleId
;
}
}
...
...
src/main/java/com/keymobile/indicators/model/entity/shortboard/ShortboardRule.java
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
shortboard
;
package
com
.
keymobile
.
indicators
.
model
.
entity
.
shortboard
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
import
org.springframework.data.annotation.Id
;
import
javax.persistence.GeneratedValue
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
com.keymobile.indicators.utils.DateUtils
;
import
com.keymobile.indicators.utils.DateUtils
;
...
@@ -16,30 +17,22 @@ import lombok.Data;
...
@@ -16,30 +17,22 @@ import lombok.Data;
*author:zhangkb time:2020-6-10 desc:短板筛选规则实体
*author:zhangkb time:2020-6-10 desc:短板筛选规则实体
*/
*/
@Data
@Data
@Document
(
collection
=
"short_board_rule"
)
@Table
(
name
=
"short_board_rule"
)
public
class
ShortboardRule
implements
Serializable
{
public
class
ShortboardRule
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
@Id
private
String
id
;
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
private
String
ruleName
;
//规则名称
private
String
ruleName
;
//规则名称
private
String
ruleDesc
;
//规则描述
private
String
ruleDesc
;
//规则描述
private
String
shortboardItemJson
;
private
List
<
ShortboardItem
>
shortboardItem
=
new
ArrayList
<>();
//短板规则选项
private
List
<
ShortboardItem
>
shortboardItem
=
new
ArrayList
<>();
//短板规则选项
private
String
code
;
//编码
private
String
code
;
//编码
private
String
catalogId
;
private
Integer
catalogId
;
private
String
catalogIdPath
;
private
String
catalogIdPath
;
private
String
lastUpdateTime
=
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
);
private
String
lastUpdateTime
=
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
);
private
String
lastUpdater
;
private
String
lastUpdater
;
public
List
<
ShortboardItem
>
getShortboardItem
(){
return
shortboardItem
;
}
public
void
setShortboardItem
(
List
<
ShortboardItem
>
shortboardItem
){
this
.
shortboardItem
.
addAll
(
shortboardItem
);
}
}
}
src/main/java/com/keymobile/indicators/model/mapper/indicators/BaseIndDefMapper.java
View file @
0c5194c7
...
@@ -15,5 +15,5 @@ public interface BaseIndDefMapper extends BaseMapper<BaseIndDef>{
...
@@ -15,5 +15,5 @@ public interface BaseIndDefMapper extends BaseMapper<BaseIndDef>{
public
int
getByKeywordCount
(
Map
<
String
,
Object
>
param
);
public
int
getByKeywordCount
(
Map
<
String
,
Object
>
param
);
public
void
deleteByCatalogIdIn
(
List
<
String
>
catalogIds
);
public
void
deleteByCatalogIdIn
(
List
<
Integer
>
catalogIds
);
}
}
src/main/java/com/keymobile/indicators/model/mapper/indicators/DriveIndDefMapper.java
View file @
0c5194c7
...
@@ -15,5 +15,5 @@ public interface DriveIndDefMapper extends BaseMapper<DriveIndDef>{
...
@@ -15,5 +15,5 @@ public interface DriveIndDefMapper extends BaseMapper<DriveIndDef>{
public
int
getByKeywordCount
(
Map
<
String
,
Object
>
param
);
public
int
getByKeywordCount
(
Map
<
String
,
Object
>
param
);
public
void
deleteByCatalogIdIn
(
List
<
String
>
catalogIds
);
public
void
deleteByCatalogIdIn
(
List
<
Integer
>
catalogIds
);
}
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/BaseIndDefVersionDataMapper.java
0 → 100644
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indmapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.indicators.BaseIndDefVersionData
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
BaseIndDefVersionDataMapper
extends
BaseMapper
<
BaseIndDefVersionData
>{
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/DriveIndCatalogMapper.java
0 → 100644
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indmapper
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndCatalog
;
import
feign.Param
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
DriveIndCatalogMapper
extends
BaseMapper
<
DriveIndCatalog
>{
public
void
deleteByIdIn
(
List
<
Integer
>
ids
);
public
List
<
DriveIndCatalog
>
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
Map
<
String
,
Object
>
params
);
public
List
<
DriveIndCatalog
>
findByParentId
(
@Param
(
"pid"
)
Integer
pid
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/DriveIndDefVersionDataMapper.java
0 → 100644
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indmapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDefVersionData
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
DriveIndDefVersionDataMapper
extends
BaseMapper
<
DriveIndDefVersionData
>{
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/IndCatalogMapper.java
0 → 100644
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indmapper
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.indicators.IndCatalog
;
import
feign.Param
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
IndCatalogMapper
extends
BaseMapper
<
IndCatalog
>{
public
void
deleteByIdIn
(
List
<
Integer
>
ids
);
public
List
<
IndCatalog
>
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
Map
<
String
,
Object
>
params
);
public
List
<
IndCatalog
>
findByParentId
(
@Param
(
"pid"
)
Integer
pid
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/IndScorecardMapper.java
0 → 100644
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indmapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.scorecard.IndScorecard
;
import
feign.Param
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
IndScorecardMapper
extends
BaseMapper
<
IndScorecard
>{
public
void
deleteByCatalogIdIn
(
List
<
Integer
>
catalogIds
);
public
List
<
IndScorecard
>
findByCatalogId
(
@Param
(
"catalogId"
)
Integer
catalogId
,
@Param
(
"start"
)
int
start
,
@Param
(
"end"
)
int
end
);
public
int
countByCatalogId
(
@Param
(
"catalogId"
)
Integer
catalogId
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/ScoreRuleCatalogMapper.java
0 → 100644
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indmapper
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.objscorerule.ScoreRuleCatalog
;
import
feign.Param
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
ScoreRuleCatalogMapper
extends
BaseMapper
<
ScoreRuleCatalog
>{
public
void
deleteByIdIn
(
List
<
Integer
>
ids
);
public
List
<
ScoreRuleCatalog
>
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
Map
<
String
,
Object
>
params
);
public
List
<
ScoreRuleCatalog
>
findByParentId
(
@Param
(
"pid"
)
Integer
pid
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/ScoreRuleMapper.java
0 → 100644
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indmapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.objscorerule.ScoreRule
;
import
feign.Param
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
ScoreRuleMapper
extends
BaseMapper
<
ScoreRule
>{
public
List
<
ScoreRule
>
findByCode
(
@Param
(
"code"
)
String
code
);
public
void
deleteByCatalogIdIn
(
List
<
Integer
>
ids
);
public
List
<
ScoreRule
>
findByCatalogId
(
@Param
(
"catalogId"
)
Integer
catalogId
,
@Param
(
"start"
)
int
start
,
@Param
(
"end"
)
int
end
);
public
int
countByCatalogId
(
@Param
(
"catalogId"
)
Integer
catalogId
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/ScorecardCatalogMapper.java
0 → 100644
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indmapper
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.scorecard.ScorecardCatalog
;
import
feign.Param
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
ScorecardCatalogMapper
extends
BaseMapper
<
ScorecardCatalog
>{
public
void
deleteByIdIn
(
List
<
Integer
>
ids
);
public
List
<
ScorecardCatalog
>
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
Map
<
String
,
Object
>
params
);
public
List
<
ScorecardCatalog
>
findByParentId
(
@Param
(
"pid"
)
Integer
pid
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/ShortboardCatalogMapper.java
0 → 100644
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indmapper
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardCatalog
;
import
feign.Param
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
ShortboardCatalogMapper
extends
BaseMapper
<
ShortboardCatalog
>{
public
void
deleteByIdIn
(
List
<
Integer
>
ids
);
public
List
<
ShortboardCatalog
>
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
Map
<
String
,
Object
>
params
);
public
List
<
ShortboardCatalog
>
findByParentId
(
@Param
(
"pid"
)
Integer
pid
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/ShortboardDriveIndRelMapper.java
0 → 100644
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indmapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardDriveIndRel
;
import
feign.Param
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
ShortboardDriveIndRelMapper
extends
BaseMapper
<
ShortboardDriveIndRel
>{
List
<
ShortboardDriveIndRel
>
findByDriveIndDefId
(
@Param
(
"driveIndDefId"
)
String
driveIndDefId
);
}
src/main/java/com/keymobile/indicators/model/mapper/indmapper/ShortboardRuleMapper.java
0 → 100644
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indmapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardRule
;
import
feign.Param
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
ShortboardRuleMapper
extends
BaseMapper
<
ShortboardRule
>{
public
void
deleteByCatalogIdIn
(
List
<
Integer
>
ids
);
public
List
<
ShortboardRule
>
findByCatalogId
(
@Param
(
"catalogId"
)
Integer
catalogId
,
@Param
(
"start"
)
int
start
,
@Param
(
"end"
)
int
end
);
public
int
countByCatalogId
(
@Param
(
"catalogId"
)
Integer
catalogId
);
}
src/main/java/com/keymobile/indicators/persistence/hyindicators/BaseIndDefVersionRepository.java
deleted
100644 → 0
View file @
868d7f64
package
com
.
keymobile
.
indicators
.
persistence
.
hyindicators
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
com.keymobile.indicators.model.entity.indicators.BaseIndDefVersionData
;
public
interface
BaseIndDefVersionRepository
extends
MongoRepository
<
BaseIndDefVersionData
,
String
>{
}
src/main/java/com/keymobile/indicators/persistence/hyindicators/DriveIndCatalogRepository.java
deleted
100644 → 0
View file @
868d7f64
package
com
.
keymobile
.
indicators
.
persistence
.
hyindicators
;
import
java.util.List
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndCatalog
;
public
interface
DriveIndCatalogRepository
extends
MongoRepository
<
DriveIndCatalog
,
String
>{
public
void
deleteByIdIn
(
List
<
String
>
ids
);
public
List
<
DriveIndCatalog
>
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
String
pid
,
List
<
String
>
codes
);
public
List
<
DriveIndCatalog
>
findByParentId
(
String
pid
);
}
src/main/java/com/keymobile/indicators/persistence/hyindicators/DriveIndDefVersionRepository.java
deleted
100644 → 0
View file @
868d7f64
package
com
.
keymobile
.
indicators
.
persistence
.
hyindicators
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDefVersionData
;
public
interface
DriveIndDefVersionRepository
extends
MongoRepository
<
DriveIndDefVersionData
,
String
>{
}
src/main/java/com/keymobile/indicators/persistence/hyindicators/IndCatalogRepository.java
deleted
100644 → 0
View file @
868d7f64
package
com
.
keymobile
.
indicators
.
persistence
.
hyindicators
;
import
java.util.List
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
com.keymobile.indicators.model.entity.indicators.IndCatalog
;
public
interface
IndCatalogRepository
extends
MongoRepository
<
IndCatalog
,
String
>{
public
void
deleteByIdIn
(
List
<
String
>
ids
);
public
List
<
IndCatalog
>
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
String
pid
,
List
<
String
>
codes
);
public
List
<
IndCatalog
>
findByParentId
(
String
pid
);
}
src/main/java/com/keymobile/indicators/persistence/hyindicators/IndScorecardRepository.java
deleted
100644 → 0
View file @
868d7f64
package
com
.
keymobile
.
indicators
.
persistence
.
hyindicators
;
import
java.util.List
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
com.keymobile.indicators.model.entity.scorecard.IndScorecard
;
public
interface
IndScorecardRepository
extends
MongoRepository
<
IndScorecard
,
String
>{
public
void
deleteByCatalogIdIn
(
List
<
String
>
catalogIds
);
public
Page
<
IndScorecard
>
findByCatalogId
(
String
catalogId
,
Pageable
page
);
}
src/main/java/com/keymobile/indicators/persistence/hyindicators/ScoreRuleCatalogRepository.java
deleted
100644 → 0
View file @
868d7f64
package
com
.
keymobile
.
indicators
.
persistence
.
hyindicators
;
import
java.util.List
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
com.keymobile.indicators.model.entity.objscorerule.ScoreRuleCatalog
;
public
interface
ScoreRuleCatalogRepository
extends
MongoRepository
<
ScoreRuleCatalog
,
String
>{
public
void
deleteByIdIn
(
List
<
String
>
ids
);
public
List
<
ScoreRuleCatalog
>
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
String
pid
,
List
<
String
>
codes
);
public
List
<
ScoreRuleCatalog
>
findByParentId
(
String
pid
);
}
src/main/java/com/keymobile/indicators/persistence/hyindicators/ScoreRuleRepository.java
deleted
100644 → 0
View file @
868d7f64
package
com
.
keymobile
.
indicators
.
persistence
.
hyindicators
;
import
java.util.List
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
com.keymobile.indicators.model.entity.objscorerule.ScoreRule
;
public
interface
ScoreRuleRepository
extends
MongoRepository
<
ScoreRule
,
String
>{
public
List
<
ScoreRule
>
findByCode
(
String
code
);
public
void
deleteByCatalogIdIn
(
List
<
String
>
ids
);
public
Page
<
ScoreRule
>
findByCatalogId
(
String
catalogId
,
Pageable
page
);
}
src/main/java/com/keymobile/indicators/persistence/hyindicators/ScorecardCatalogRepository.java
deleted
100644 → 0
View file @
868d7f64
package
com
.
keymobile
.
indicators
.
persistence
.
hyindicators
;
import
java.util.List
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
com.keymobile.indicators.model.entity.scorecard.ScorecardCatalog
;
public
interface
ScorecardCatalogRepository
extends
MongoRepository
<
ScorecardCatalog
,
String
>{
public
void
deleteByIdIn
(
List
<
String
>
ids
);
public
List
<
ScorecardCatalog
>
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
String
pid
,
List
<
String
>
codes
);
public
List
<
ScorecardCatalog
>
findByParentId
(
String
pid
);
}
src/main/java/com/keymobile/indicators/persistence/hyindicators/ShortboardCatalogRepository.java
deleted
100644 → 0
View file @
868d7f64
package
com
.
keymobile
.
indicators
.
persistence
.
hyindicators
;
import
java.util.List
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardCatalog
;
public
interface
ShortboardCatalogRepository
extends
MongoRepository
<
ShortboardCatalog
,
String
>{
public
void
deleteByIdIn
(
List
<
String
>
ids
);
public
List
<
ShortboardCatalog
>
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
String
pid
,
List
<
String
>
codes
);
public
List
<
ShortboardCatalog
>
findByParentId
(
String
pid
);
}
src/main/java/com/keymobile/indicators/persistence/hyindicators/ShortboardDriveIndRelRepository.java
deleted
100644 → 0
View file @
868d7f64
package
com
.
keymobile
.
indicators
.
persistence
.
hyindicators
;
import
java.util.List
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardDriveIndRel
;
public
interface
ShortboardDriveIndRelRepository
extends
MongoRepository
<
ShortboardDriveIndRel
,
String
>{
List
<
ShortboardDriveIndRel
>
findByDriveIndDefId
(
String
driveIndDefId
);
}
src/main/java/com/keymobile/indicators/persistence/hyindicators/ShortboardRuleRepository.java
deleted
100644 → 0
View file @
868d7f64
package
com
.
keymobile
.
indicators
.
persistence
.
hyindicators
;
import
java.util.List
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardRule
;
public
interface
ShortboardRuleRepository
extends
MongoRepository
<
ShortboardRule
,
String
>{
public
void
deleteByCatalogIdIn
(
List
<
String
>
ids
);
public
Page
<
ShortboardRule
>
findByCatalogId
(
String
catalogId
,
Pageable
page
);
}
src/main/java/com/keymobile/indicators/service/hytobacco/BaseIndDefService.java
View file @
0c5194c7
...
@@ -19,7 +19,7 @@ public class BaseIndDefService {
...
@@ -19,7 +19,7 @@ public class BaseIndDefService {
@Autowired
@Autowired
private
BaseIndDefVersionService
baseIndDefVersionService
;
private
BaseIndDefVersionService
baseIndDefVersionService
;
public
String
saveOrUpdate
(
BaseIndDef
baseIndDef
,
String
catalogId
,
String
catalogIdPath
,
String
user
)
public
String
saveOrUpdate
(
BaseIndDef
baseIndDef
,
Integer
catalogId
,
String
catalogIdPath
,
String
user
)
throws
Exception
{
throws
Exception
{
if
(
StringUtils
.
isBlank
(
baseIndDef
.
getIndId
()))
{
if
(
StringUtils
.
isBlank
(
baseIndDef
.
getIndId
()))
{
return
"indId can not be null"
;
return
"indId can not be null"
;
...
@@ -60,15 +60,11 @@ public class BaseIndDefService {
...
@@ -60,15 +60,11 @@ public class BaseIndDefService {
baseIndDefMapper
.
deleteByPrimaryKey
(
indId
);
baseIndDefMapper
.
deleteByPrimaryKey
(
indId
);
}
}
public
Map
<
String
,
Object
>
getByPageAndKeyword
(
String
catalogId
,
String
keyword
,
public
Map
<
String
,
Object
>
getByPageAndKeyword
(
Integer
catalogId
,
String
keyword
,
int
page
,
int
rows
)
throws
Exception
{
int
page
,
int
rows
)
throws
Exception
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
if
(
StringUtils
.
isBlank
(
catalogId
))
{
paramMap
.
put
(
"catalogId"
,
catalogId
);
paramMap
.
put
(
"catalogId"
,
null
);
}
else
{
paramMap
.
put
(
"catalogId"
,
catalogId
);
}
if
(
StringUtils
.
isBlank
(
keyword
))
{
if
(
StringUtils
.
isBlank
(
keyword
))
{
paramMap
.
put
(
"keyword"
,
null
);
paramMap
.
put
(
"keyword"
,
null
);
}
else
{
}
else
{
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/BaseIndDefVersionService.java
View file @
0c5194c7
...
@@ -9,14 +9,14 @@ import com.google.gson.Gson;
...
@@ -9,14 +9,14 @@ import com.google.gson.Gson;
import
com.google.gson.GsonBuilder
;
import
com.google.gson.GsonBuilder
;
import
com.keymobile.indicators.model.entity.indicators.BaseIndDef
;
import
com.keymobile.indicators.model.entity.indicators.BaseIndDef
;
import
com.keymobile.indicators.model.entity.indicators.BaseIndDefVersionData
;
import
com.keymobile.indicators.model.entity.indicators.BaseIndDefVersionData
;
import
com.keymobile.indicators.
persistence.hyindicators.BaseIndDefVersionRepository
;
import
com.keymobile.indicators.
model.mapper.indmapper.BaseIndDefVersionDataMapper
;
@Service
@Service
public
class
BaseIndDefVersionService
{
public
class
BaseIndDefVersionService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
BaseIndDefVersionService
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
BaseIndDefVersionService
.
class
);
@Autowired
@Autowired
private
BaseIndDefVersion
Repository
baseIndDefVersionRepo
;
private
BaseIndDefVersion
DataMapper
baseIndDefVersionDataMapper
;
public
boolean
save
(
BaseIndDef
baseIndDef
)
throws
Exception
{
public
boolean
save
(
BaseIndDef
baseIndDef
)
throws
Exception
{
BaseIndDefVersionData
baseIndDefVersionData
=
new
BaseIndDefVersionData
();
BaseIndDefVersionData
baseIndDefVersionData
=
new
BaseIndDefVersionData
();
...
@@ -27,7 +27,7 @@ public class BaseIndDefVersionService {
...
@@ -27,7 +27,7 @@ public class BaseIndDefVersionService {
gsonBuilder
.
setPrettyPrinting
();
gsonBuilder
.
setPrettyPrinting
();
Gson
gson
=
gsonBuilder
.
create
();
Gson
gson
=
gsonBuilder
.
create
();
baseIndDefVersionData
.
setDataJson
(
gson
.
toJson
(
baseIndDef
));
baseIndDefVersionData
.
setDataJson
(
gson
.
toJson
(
baseIndDef
));
baseIndDefVersion
Repo
.
save
(
baseIndDefVersionData
);
baseIndDefVersion
DataMapper
.
insert
(
baseIndDefVersionData
);
return
true
;
return
true
;
}
}
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndCalResultService.java
View file @
0c5194c7
...
@@ -26,13 +26,16 @@ public class DriveIndCalResultService {
...
@@ -26,13 +26,16 @@ public class DriveIndCalResultService {
private
DriveIndCalResultDefMapper
driveIndCalResultDefMapper
;
private
DriveIndCalResultDefMapper
driveIndCalResultDefMapper
;
public
int
saveOrUpdate
(
DriveIndCalResultDef
driveIndCalResult
)
{
public
int
saveOrUpdate
(
DriveIndCalResultDef
driveIndCalResult
)
{
return
driveIndCalResultDefMapper
.
insert
(
driveIndCalResult
);
if
(
driveIndCalResult
.
getId
()==
null
)
{
driveIndCalResultDefMapper
.
insert
(
driveIndCalResult
);
}
else
{
driveIndCalResultDefMapper
.
updateByPrimaryKey
(
driveIndCalResult
);
}
return
driveIndCalResult
.
getId
();
}
}
public
DriveIndCalResultDef
findById
(
Integer
id
)
{
public
DriveIndCalResultDef
findById
(
Integer
id
)
{
DriveIndCalResultDef
driveCalResultDef
=
new
DriveIndCalResultDef
();
return
driveIndCalResultDefMapper
.
selectByPrimaryKey
(
id
);
driveCalResultDef
.
setId
(
id
);
return
driveIndCalResultDefMapper
.
selectOne
(
driveCalResultDef
);
}
}
public
DriveIndCalResultDef
findCompareObjInfo
(
String
driveIndId
,
int
date
,
String
compareObj
)
{
public
DriveIndCalResultDef
findCompareObjInfo
(
String
driveIndId
,
int
date
,
String
compareObj
)
{
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndCatalogService.java
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.Map
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -12,50 +11,50 @@ import org.springframework.stereotype.Service;
...
@@ -12,50 +11,50 @@ import org.springframework.stereotype.Service;
import
com.keymobile.indicators.model.entity.indicators.DriveIndCatalog
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndCatalog
;
import
com.keymobile.indicators.model.mapper.indicators.DriveIndDefMapper
;
import
com.keymobile.indicators.model.mapper.indicators.DriveIndDefMapper
;
import
com.keymobile.indicators.
persistence.hyindicators.DriveIndCatalogRepository
;
import
com.keymobile.indicators.
model.mapper.indmapper.DriveIndCatalogMapper
;
@Service
@Service
public
class
DriveIndCatalogService
{
public
class
DriveIndCatalogService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
DriveIndCatalogService
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
DriveIndCatalogService
.
class
);
@Autowired
@Autowired
private
DriveIndCatalog
Repository
driveIndCatalogRepo
;
private
DriveIndCatalog
Mapper
driveIndCatalogMapper
;
@Autowired
@Autowired
private
DriveIndDefMapper
driveIndDefMapper
;
private
DriveIndDefMapper
driveIndDefMapper
;
public
DriveIndCatalog
saveOrUpdate
(
DriveIndCatalog
driveIndCatalog
)
throws
Exception
{
public
DriveIndCatalog
saveOrUpdate
(
DriveIndCatalog
driveIndCatalog
)
throws
Exception
{
if
(
StringUtils
.
isBlank
(
driveIndCatalog
.
getId
())
)
{
//新增
if
(
driveIndCatalog
.
getId
()==
null
)
{
//新增
//保存
//保存
driveIndCatalog
=
driveIndCatalogRepo
.
save
(
driveIndCatalog
);
driveIndCatalog
Mapper
.
insert
(
driveIndCatalog
);
}
}
//获取parentId拼接idPath
//获取parentId拼接idPath
String
parentId
=
driveIndCatalog
.
getParentId
();
Integer
parentId
=
driveIndCatalog
.
getParentId
();
if
(
StringUtils
.
isBlank
(
parentId
)
||
"0"
.
equals
(
parentId
)
)
{
//顶层节点
if
(
parentId
==
0
)
{
//顶层节点
driveIndCatalog
.
setIdPath
(
driveIndCatalog
.
getId
()
);
driveIndCatalog
.
setIdPath
(
String
.
valueOf
(
driveIndCatalog
.
getId
())+
";"
);
}
else
{
}
else
{
Optional
<
DriveIndCatalog
>
parentDriveIndCatalog
=
driveIndCatalogRepo
.
findById
(
driveIndCatalog
.
getParentId
());
DriveIndCatalog
parentDriveIndCatalog
=
driveIndCatalogMapper
.
selectByPrimaryKey
(
driveIndCatalog
.
getParentId
());
if
(
!
parentDriveIndCatalog
.
isPresent
()
)
{
if
(
parentDriveIndCatalog
==
null
)
{
throw
new
Exception
(
"父节点不存在:parent catalog is not exist"
);
throw
new
Exception
(
"父节点不存在:parent catalog is not exist"
);
}
else
{
}
else
{
driveIndCatalog
.
setIdPath
(
parentDriveIndCatalog
.
get
().
getIdPath
()+
";"
+
driveIndCatalog
.
setIdPath
(
parentDriveIndCatalog
.
get
IdPath
()
+
driveIndCatalog
.
getId
());
driveIndCatalog
.
getId
()
+
";"
);
}
}
}
}
//保存
//保存
driveIndCatalog
=
driveIndCatalogRepo
.
save
(
driveIndCatalog
);
driveIndCatalog
Mapper
.
updateByPrimaryKey
(
driveIndCatalog
);
return
driveIndCatalog
;
return
driveIndCatalog
;
}
}
public
void
delete
(
List
<
String
>
ids
)
{
public
void
delete
(
List
<
Integer
>
ids
)
{
driveIndCatalog
Repo
.
deleteByIdIn
(
ids
);
driveIndCatalog
Mapper
.
deleteByIdIn
(
ids
);
}
}
//递归查找父目录下的子目录
//递归查找父目录下的子目录
public
List
<
String
>
getDeleteCatalogId
(
String
id
){
public
List
<
Integer
>
getDeleteCatalogId
(
Integer
id
){
List
<
String
>
result
=
new
ArrayList
<>();
List
<
Integer
>
result
=
new
ArrayList
<>();
result
.
add
(
id
);
result
.
add
(
id
);
//根据id获取子节点
//根据id获取子节点
List
<
DriveIndCatalog
>
children
=
driveIndCatalog
Repo
.
findByParentId
(
id
);
List
<
DriveIndCatalog
>
children
=
driveIndCatalog
Mapper
.
findByParentId
(
id
);
if
(!
children
.
isEmpty
())
{
if
(!
children
.
isEmpty
())
{
for
(
DriveIndCatalog
child
:
children
)
{
for
(
DriveIndCatalog
child
:
children
)
{
result
.
addAll
(
getDeleteCatalogId
(
child
.
getId
()));
result
.
addAll
(
getDeleteCatalogId
(
child
.
getId
()));
...
@@ -65,9 +64,9 @@ public class DriveIndCatalogService {
...
@@ -65,9 +64,9 @@ public class DriveIndCatalogService {
}
}
//递归删除
//递归删除
public
void
recursionDelete
(
List
<
String
>
ids
)
{
public
void
recursionDelete
(
List
<
Integer
>
ids
)
{
for
(
String
id
:
ids
)
{
for
(
Integer
id
:
ids
)
{
List
<
String
>
result
=
this
.
getDeleteCatalogId
(
id
);
List
<
Integer
>
result
=
this
.
getDeleteCatalogId
(
id
);
this
.
delete
(
result
);
this
.
delete
(
result
);
//删除目录关联的指标
//删除目录关联的指标
driveIndDefMapper
.
deleteByCatalogIdIn
(
result
);
driveIndDefMapper
.
deleteByCatalogIdIn
(
result
);
...
@@ -75,10 +74,10 @@ public class DriveIndCatalogService {
...
@@ -75,10 +74,10 @@ public class DriveIndCatalogService {
}
}
//获取目录树
//获取目录树
public
List
<
DriveIndCatalog
>
getCatalog
(
String
parentId
,
List
<
String
>
codes
){
public
List
<
DriveIndCatalog
>
getCatalog
(
Integer
parentId
,
List
<
String
>
codes
){
if
(
StringUtils
.
isBlank
(
parentId
)
||
"0"
.
equals
(
parentId
))
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
return
driveIndCatalogRepo
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
"0"
,
codes
);
paramMap
.
put
(
"pid"
,
parentId
);
}
paramMap
.
put
(
"codes"
,
codes
);
return
driveIndCatalog
Repo
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
parentId
,
codes
);
return
driveIndCatalog
Mapper
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
paramMap
);
}
}
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndDefService.java
View file @
0c5194c7
...
@@ -28,7 +28,7 @@ public class DriveIndDefService {
...
@@ -28,7 +28,7 @@ public class DriveIndDefService {
@Autowired
@Autowired
private
BaseIndDataService
baseIndDataService
;
private
BaseIndDataService
baseIndDataService
;
public
String
saveOrUpdate
(
DriveIndDef
driveIndDef
,
String
catalogId
,
String
catalogIdPath
,
String
user
)
public
String
saveOrUpdate
(
DriveIndDef
driveIndDef
,
Integer
catalogId
,
String
catalogIdPath
,
String
user
)
throws
Exception
{
throws
Exception
{
if
(
StringUtils
.
isBlank
(
driveIndDef
.
getIndId
()))
{
if
(
StringUtils
.
isBlank
(
driveIndDef
.
getIndId
()))
{
return
"indId can not be null"
;
return
"indId can not be null"
;
...
@@ -69,15 +69,11 @@ public class DriveIndDefService {
...
@@ -69,15 +69,11 @@ public class DriveIndDefService {
driveIndDefMapper
.
deleteByPrimaryKey
(
indId
);
driveIndDefMapper
.
deleteByPrimaryKey
(
indId
);
}
}
public
Map
<
String
,
Object
>
getByPageAndKeyword
(
String
catalogId
,
String
keyword
,
public
Map
<
String
,
Object
>
getByPageAndKeyword
(
Integer
catalogId
,
String
keyword
,
int
page
,
int
rows
)
throws
Exception
{
int
page
,
int
rows
)
throws
Exception
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
if
(
StringUtils
.
isBlank
(
catalogId
))
{
paramMap
.
put
(
"catalogId"
,
catalogId
);
paramMap
.
put
(
"catalogId"
,
null
);
}
else
{
paramMap
.
put
(
"catalogId"
,
catalogId
);
}
if
(
StringUtils
.
isBlank
(
keyword
))
{
if
(
StringUtils
.
isBlank
(
keyword
))
{
paramMap
.
put
(
"keyword"
,
null
);
paramMap
.
put
(
"keyword"
,
null
);
}
else
{
}
else
{
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndDefVersionService.java
View file @
0c5194c7
...
@@ -9,14 +9,14 @@ import com.google.gson.Gson;
...
@@ -9,14 +9,14 @@ import com.google.gson.Gson;
import
com.google.gson.GsonBuilder
;
import
com.google.gson.GsonBuilder
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDef
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDef
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDefVersionData
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDefVersionData
;
import
com.keymobile.indicators.
persistence.hyindicators.DriveIndDefVersionRepository
;
import
com.keymobile.indicators.
model.mapper.indmapper.DriveIndDefVersionDataMapper
;
@Service
@Service
public
class
DriveIndDefVersionService
{
public
class
DriveIndDefVersionService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
DriveIndDefVersionService
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
DriveIndDefVersionService
.
class
);
@Autowired
@Autowired
private
DriveIndDefVersion
Repository
driveIndDefVersionRepo
;
private
DriveIndDefVersion
DataMapper
driveIndDefVersionDataMapper
;
public
boolean
save
(
DriveIndDef
driveIndDef
)
throws
Exception
{
public
boolean
save
(
DriveIndDef
driveIndDef
)
throws
Exception
{
DriveIndDefVersionData
driveIndDefVersionData
=
new
DriveIndDefVersionData
();
DriveIndDefVersionData
driveIndDefVersionData
=
new
DriveIndDefVersionData
();
...
@@ -27,7 +27,7 @@ public class DriveIndDefVersionService {
...
@@ -27,7 +27,7 @@ public class DriveIndDefVersionService {
gsonBuilder
.
setPrettyPrinting
();
gsonBuilder
.
setPrettyPrinting
();
Gson
gson
=
gsonBuilder
.
create
();
Gson
gson
=
gsonBuilder
.
create
();
driveIndDefVersionData
.
setDataJson
(
gson
.
toJson
(
driveIndDef
));
driveIndDefVersionData
.
setDataJson
(
gson
.
toJson
(
driveIndDef
));
driveIndDefVersion
Repo
.
save
(
driveIndDefVersionData
);
driveIndDefVersion
DataMapper
.
insert
(
driveIndDefVersionData
);
return
true
;
return
true
;
}
}
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/IndCatalogService.java
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.Map
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -12,49 +11,49 @@ import org.springframework.stereotype.Service;
...
@@ -12,49 +11,49 @@ import org.springframework.stereotype.Service;
import
com.keymobile.indicators.model.entity.indicators.IndCatalog
;
import
com.keymobile.indicators.model.entity.indicators.IndCatalog
;
import
com.keymobile.indicators.model.mapper.indicators.BaseIndDefMapper
;
import
com.keymobile.indicators.model.mapper.indicators.BaseIndDefMapper
;
import
com.keymobile.indicators.
persistence.hyindicators.IndCatalogRepository
;
import
com.keymobile.indicators.
model.mapper.indmapper.IndCatalogMapper
;
@Service
@Service
public
class
IndCatalogService
{
public
class
IndCatalogService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
IndCatalogService
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
IndCatalogService
.
class
);
@Autowired
@Autowired
private
IndCatalog
Repository
indCatalogRepo
;
private
IndCatalog
Mapper
indCatalogMapper
;
@Autowired
@Autowired
private
BaseIndDefMapper
baseIndDefMapper
;
private
BaseIndDefMapper
baseIndDefMapper
;
public
IndCatalog
saveOrUpdate
(
IndCatalog
indCatalog
)
throws
Exception
{
public
IndCatalog
saveOrUpdate
(
IndCatalog
indCatalog
)
throws
Exception
{
if
(
StringUtils
.
isBlank
(
indCatalog
.
getId
())
)
{
//新增
if
(
indCatalog
.
getId
()==
null
)
{
//新增
//保存
//保存
indCatalog
=
indCatalogRepo
.
save
(
indCatalog
);
indCatalog
Mapper
.
insert
(
indCatalog
);
}
}
//获取parentId拼接idPath
//获取parentId拼接idPath
String
parentId
=
indCatalog
.
getParentId
();
int
parentId
=
indCatalog
.
getParentId
();
if
(
StringUtils
.
isBlank
(
parentId
)
||
"0"
.
equals
(
parentId
)
)
{
//顶层节点
if
(
parentId
==
0
)
{
//顶层节点
indCatalog
.
setIdPath
(
indCatalog
.
getId
()
);
indCatalog
.
setIdPath
(
String
.
valueOf
(
indCatalog
.
getId
())+
";"
);
}
else
{
}
else
{
Optional
<
IndCatalog
>
parentIndCatalog
=
indCatalogRepo
.
findById
(
indCatalog
.
getParentId
());
IndCatalog
parentIndCatalog
=
indCatalogMapper
.
selectByPrimaryKey
(
indCatalog
.
getParentId
());
if
(
!
parentIndCatalog
.
isPresent
()
)
{
if
(
parentIndCatalog
==
null
)
{
throw
new
Exception
(
"父节点不存在:parent catalog is not exist"
);
throw
new
Exception
(
"父节点不存在:parent catalog is not exist"
);
}
else
{
}
else
{
indCatalog
.
setIdPath
(
parentIndCatalog
.
get
().
getIdPath
()+
";"
+
indCatalog
.
getId
()
);
indCatalog
.
setIdPath
(
parentIndCatalog
.
get
IdPath
()+
indCatalog
.
getId
()+
";"
);
}
}
}
}
//保存
//保存
indCatalog
=
indCatalogRepo
.
save
(
indCatalog
);
indCatalog
Mapper
.
updateByPrimaryKey
(
indCatalog
);
return
indCatalog
;
return
indCatalog
;
}
}
public
void
delete
(
List
<
String
>
ids
)
{
public
void
delete
(
List
<
Integer
>
ids
)
{
indCatalog
Repo
.
deleteByIdIn
(
ids
);
indCatalog
Mapper
.
deleteByIdIn
(
ids
);
}
}
//递归查找父目录下的子目录
//递归查找父目录下的子目录
public
List
<
String
>
getDeleteCatalogId
(
String
id
){
public
List
<
Integer
>
getDeleteCatalogId
(
int
id
){
List
<
String
>
result
=
new
ArrayList
<>();
List
<
Integer
>
result
=
new
ArrayList
<>();
result
.
add
(
id
);
result
.
add
(
id
);
//根据id获取子节点
//根据id获取子节点
List
<
IndCatalog
>
children
=
indCatalog
Repo
.
findByParentId
(
id
);
List
<
IndCatalog
>
children
=
indCatalog
Mapper
.
findByParentId
(
id
);
if
(!
children
.
isEmpty
())
{
if
(!
children
.
isEmpty
())
{
for
(
IndCatalog
child
:
children
)
{
for
(
IndCatalog
child
:
children
)
{
result
.
addAll
(
getDeleteCatalogId
(
child
.
getId
()));
result
.
addAll
(
getDeleteCatalogId
(
child
.
getId
()));
...
@@ -64,9 +63,9 @@ public class IndCatalogService {
...
@@ -64,9 +63,9 @@ public class IndCatalogService {
}
}
//递归删除
//递归删除
public
void
recursionDelete
(
List
<
String
>
ids
)
{
public
void
recursionDelete
(
List
<
Integer
>
ids
)
{
for
(
String
id
:
ids
)
{
for
(
Integer
id
:
ids
)
{
List
<
String
>
result
=
this
.
getDeleteCatalogId
(
id
);
List
<
Integer
>
result
=
this
.
getDeleteCatalogId
(
id
);
this
.
delete
(
result
);
this
.
delete
(
result
);
//删除目录关联的指标
//删除目录关联的指标
baseIndDefMapper
.
deleteByCatalogIdIn
(
result
);
baseIndDefMapper
.
deleteByCatalogIdIn
(
result
);
...
@@ -74,10 +73,10 @@ public class IndCatalogService {
...
@@ -74,10 +73,10 @@ public class IndCatalogService {
}
}
//获取目录树
//获取目录树
public
List
<
IndCatalog
>
getCatalog
(
String
parentId
,
List
<
String
>
codes
){
public
List
<
IndCatalog
>
getCatalog
(
Integer
parentId
,
List
<
String
>
codes
){
if
(
StringUtils
.
isBlank
(
parentId
)
||
"0"
.
equals
(
parentId
))
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
return
indCatalogRepo
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
"0"
,
codes
);
paramMap
.
put
(
"pid"
,
parentId
);
}
paramMap
.
put
(
"codes"
,
codes
);
return
indCatalog
Repo
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
parentId
,
codes
);
return
indCatalog
Mapper
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
paramMap
);
}
}
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/IndScorecardService.java
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
import
java.math.BigDecimal
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.Iterator
;
import
java.util.Iterator
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Optional
;
import
org.apache.commons.lang.StringUtils
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.google.common.collect.Maps
;
import
com.google.common.collect.Maps
;
import
com.google.gson.Gson
;
import
com.google.gson.reflect.TypeToken
;
import
com.googlecode.aviator.AviatorEvaluator
;
import
com.googlecode.aviator.AviatorEvaluator
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDef
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDef
;
...
@@ -24,7 +23,7 @@ import com.keymobile.indicators.model.entity.scorecard.ImproveScoreDef;
...
@@ -24,7 +23,7 @@ import com.keymobile.indicators.model.entity.scorecard.ImproveScoreDef;
import
com.keymobile.indicators.model.entity.scorecard.IndScorecard
;
import
com.keymobile.indicators.model.entity.scorecard.IndScorecard
;
import
com.keymobile.indicators.model.entity.scorecard.RankScoreDef
;
import
com.keymobile.indicators.model.entity.scorecard.RankScoreDef
;
import
com.keymobile.indicators.model.mapper.indmapper.DriveIndCalResultDefMapper
;
import
com.keymobile.indicators.model.mapper.indmapper.DriveIndCalResultDefMapper
;
import
com.keymobile.indicators.
persistence.hyindicators.IndScorecardRepository
;
import
com.keymobile.indicators.
model.mapper.indmapper.IndScorecardMapper
;
import
com.keymobile.indicators.utils.CalculateUtils
;
import
com.keymobile.indicators.utils.CalculateUtils
;
@Service
@Service
...
@@ -32,54 +31,85 @@ public class IndScorecardService {
...
@@ -32,54 +31,85 @@ public class IndScorecardService {
private
Logger
logger
=
LoggerFactory
.
getLogger
(
IndScorecardService
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
IndScorecardService
.
class
);
@Autowired
@Autowired
private
IndScorecard
Repository
indScorecardRepo
;
private
IndScorecard
Mapper
indScorecardMapper
;
@Autowired
@Autowired
private
DriveIndDefService
driveIndDefService
;
private
DriveIndDefService
driveIndDefService
;
@Autowired
@Autowired
private
DriveIndCalResultDefMapper
driveIndCalResultDefMapper
;
private
DriveIndCalResultDefMapper
driveIndCalResultDefMapper
;
//id不为空为修改,为空为新增
//id不为空为修改,为空为新增
public
String
saveOrUpdate
(
IndScorecard
indScorecard
,
String
catalogId
,
public
Integer
saveOrUpdate
(
IndScorecard
indScorecard
,
Integer
catalogId
,
String
catalogIdPath
,
String
user
)
{
String
catalogIdPath
,
String
user
)
{
Gson
gson
=
new
Gson
();
if
(!
indScorecard
.
getAddScoreItem
().
isEmpty
())
{
String
addScoreItemJson
=
gson
.
toJson
(
indScorecard
.
getAddScoreItem
());
indScorecard
.
setAddScoreItemJson
(
addScoreItemJson
);
}
if
(!
indScorecard
.
getMinusScoreItem
().
isEmpty
())
{
String
minusScoreItemJson
=
gson
.
toJson
(
indScorecard
.
getMinusScoreItem
());
indScorecard
.
setMinusScoreItemJson
(
minusScoreItemJson
);
}
if
(!
indScorecard
.
getImproveScoreItem
().
isEmpty
())
{
String
improveScoreItemJson
=
gson
.
toJson
(
indScorecard
.
getImproveScoreItem
());
indScorecard
.
setImproveScoreItemJson
(
improveScoreItemJson
);
}
if
(
indScorecard
.
getMoreAverage
()==
null
)
{
indScorecard
.
setMoreAverage
(
0.0
);
}
if
(
indScorecard
.
getLessAverage
()==
null
)
{
indScorecard
.
setLessAverage
(
0.0
);
}
indScorecard
.
setCatalogId
(
catalogId
);
indScorecard
.
setCatalogId
(
catalogId
);
indScorecard
.
setCatalogIdPath
(
catalogIdPath
);
indScorecard
.
setCatalogIdPath
(
catalogIdPath
);
indScorecard
.
setLastUpdater
(
user
);
indScorecard
.
setLastUpdater
(
user
);
indScorecard
=
indScorecardRepo
.
save
(
indScorecard
);
if
(
indScorecard
.
getId
()==
null
)
{
indScorecardMapper
.
insert
(
indScorecard
);
}
else
{
indScorecardMapper
.
updateByPrimaryKey
(
indScorecard
);
}
return
indScorecard
.
getId
();
return
indScorecard
.
getId
();
}
}
public
void
delete
(
List
<
String
>
ids
)
{
public
void
delete
(
List
<
Integer
>
ids
)
{
for
(
String
id
:
ids
)
{
for
(
Integer
id
:
ids
)
{
indScorecard
Repo
.
deleteById
(
id
);
indScorecard
Mapper
.
deleteByPrimaryKey
(
id
);
}
}
}
}
public
List
<
IndScorecard
>
getAll
(){
public
List
<
IndScorecard
>
getAll
(){
return
indScorecard
Repo
.
find
All
();
return
indScorecard
Mapper
.
select
All
();
}
}
public
IndScorecard
findById
(
String
id
)
{
public
IndScorecard
findById
(
Integer
id
)
{
Optional
<
IndScorecard
>
result
=
indScorecardRepo
.
findById
(
id
);
IndScorecard
result
=
indScorecardMapper
.
selectByPrimaryKey
(
id
);
if
(
result
.
isPresent
()
)
{
if
(
result
!=
null
)
{
return
result
.
get
()
;
return
result
;
}
}
return
null
;
return
null
;
}
}
public
Page
<
IndScorecard
>
getByCatalogId
(
String
catalogId
,
int
page
,
int
rows
){
public
Map
<
String
,
Object
>
getByCatalogId
(
Integer
catalogId
,
int
page
,
int
rows
){
Pageable
pageable
=
PageRequest
.
of
(
page
-
1
,
rows
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
return
indScorecardRepo
.
findByCatalogId
(
catalogId
,
pageable
);
int
count
=
0
;
//计算start
int
start
=
(
page
-
1
)*
rows
;
count
=
indScorecardMapper
.
countByCatalogId
(
catalogId
);
List
<
IndScorecard
>
datas
=
indScorecardMapper
.
findByCatalogId
(
catalogId
,
start
,
rows
);
result
.
put
(
"count"
,
count
);
result
.
put
(
"data"
,
datas
);
return
result
;
}
}
public
Map
<
String
,
String
>
calculateIndiScore
(
String
indId
,
int
date
,
String
compareObj
,
public
Map
<
String
,
String
>
calculateIndiScore
(
String
indId
,
int
date
,
String
compareObj
,
String
indScorecardId
,
String
compareId
,
List
<
String
>
compareObjs
)
throws
Exception
{
Integer
indScorecardId
,
String
compareId
,
List
<
String
>
compareObjs
)
throws
Exception
{
Map
<
String
,
String
>
result
=
new
HashMap
<>();
Map
<
String
,
String
>
result
=
new
HashMap
<>();
Gson
gson
=
new
Gson
();
String
indScoreValue
=
"0.0"
;
String
indScoreValue
=
"0.0"
;
String
indImproveScoreValue
=
"0.0"
;
String
indImproveScoreValue
=
"0.0"
;
result
.
put
(
"score"
,
indScoreValue
);
result
.
put
(
"score"
,
indScoreValue
);
result
.
put
(
"improveScore"
,
indImproveScoreValue
);
result
.
put
(
"improveScore"
,
indImproveScoreValue
);
if
(
StringUtils
.
isNotBlank
(
indScorecardId
)
)
{
if
(
indScorecardId
!=
null
)
{
//根据评分卡id获取评分卡信息
//根据评分卡id获取评分卡信息
IndScorecard
scoreCard
=
this
.
findById
(
indScorecardId
);
IndScorecard
scoreCard
=
this
.
findById
(
indScorecardId
);
double
baseScoreValue
=
0
;
double
baseScoreValue
=
0
;
...
@@ -138,8 +168,9 @@ public class IndScorecardService {
...
@@ -138,8 +168,9 @@ public class IndScorecardService {
int
rank
=
currentCompareObjResult
.
getRank
();
//获取排位
int
rank
=
currentCompareObjResult
.
getRank
();
//获取排位
//加分项
//加分项
if
(!
scoreCard
.
getAddScoreItem
().
isEmpty
())
{
if
(
StringUtils
.
isNotBlank
(
scoreCard
.
getAddScoreItemJson
()))
{
List
<
RankScoreDef
>
addScoreItem
=
scoreCard
.
getAddScoreItem
();
List
<
RankScoreDef
>
addScoreItem
=
gson
.
fromJson
(
scoreCard
.
getAddScoreItemJson
(),
new
TypeToken
<
List
<
RankScoreDef
>>(){}.
getType
());
for
(
RankScoreDef
scoreDef
:
addScoreItem
)
{
for
(
RankScoreDef
scoreDef
:
addScoreItem
)
{
if
(
scoreDef
.
getRank
()==
rank
)
{
if
(
scoreDef
.
getRank
()==
rank
)
{
baseScoreValue
+=
scoreDef
.
getScore
();
baseScoreValue
+=
scoreDef
.
getScore
();
...
@@ -148,8 +179,9 @@ public class IndScorecardService {
...
@@ -148,8 +179,9 @@ public class IndScorecardService {
}
}
}
}
//减分项
//减分项
if
(!
scoreCard
.
getMinusScoreItem
().
isEmpty
())
{
if
(
StringUtils
.
isNotBlank
(
scoreCard
.
getMinusScoreItemJson
()))
{
List
<
RankScoreDef
>
minusScoreItem
=
scoreCard
.
getMinusScoreItem
();
List
<
RankScoreDef
>
minusScoreItem
=
gson
.
fromJson
(
scoreCard
.
getMinusScoreItemJson
(),
new
TypeToken
<
List
<
RankScoreDef
>>(){}.
getType
());
rank
=
currentDriveResultSize
-
rank
+
1
;
rank
=
currentDriveResultSize
-
rank
+
1
;
for
(
RankScoreDef
scoreDef
:
minusScoreItem
)
{
for
(
RankScoreDef
scoreDef
:
minusScoreItem
)
{
if
(
scoreDef
.
getRank
()==
rank
)
{
if
(
scoreDef
.
getRank
()==
rank
)
{
...
@@ -180,8 +212,14 @@ public class IndScorecardService {
...
@@ -180,8 +212,14 @@ public class IndScorecardService {
DriveIndCalResultDef
sameCompareObjResult
=
driveIndCalResultDefMapper
DriveIndCalResultDef
sameCompareObjResult
=
driveIndCalResultDefMapper
.
findByIndIdAndDateAndCompareObj
(
indId
,
(
date
-
100
),
compareObj
);
.
findByIndIdAndDateAndCompareObj
(
indId
,
(
date
-
100
),
compareObj
);
if
(
sameCompareObjResult
!=
null
)
{
if
(
sameCompareObjResult
!=
null
)
{
List
<
ImproveScoreDef
>
importScoreDefList
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotBlank
(
scoreCard
.
getImproveScoreItemJson
()))
{
importScoreDefList
=
gson
.
fromJson
(
scoreCard
.
getImproveScoreItemJson
(),
new
TypeToken
<
List
<
ImproveScoreDef
>>(){}.
getType
());
}
double
improveScore
=
this
.
calImproveValue
(
acsType
,
unit
,
double
improveScore
=
this
.
calImproveValue
(
acsType
,
unit
,
scoreCard
.
getImproveScoreItem
()
,
currentCompareObjResult
,
importScoreDefList
,
currentCompareObjResult
,
sameCompareObjResult
,
compareObjs
);
sameCompareObjResult
,
compareObjs
);
if
(
scoreCard
.
getLimitScore
()!=
0
)
{
if
(
scoreCard
.
getLimitScore
()!=
0
)
{
if
(
improveScore
>
scoreCard
.
getLimitScore
())
{
if
(
improveScore
>
scoreCard
.
getLimitScore
())
{
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/IndicatorsValueService.java
View file @
0c5194c7
...
@@ -20,7 +20,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
...
@@ -20,7 +20,6 @@ import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.keymobile.indicators.model.entity.DimValue
;
import
com.keymobile.indicators.model.entity.DimValue
;
...
@@ -42,9 +41,6 @@ public class IndicatorsValueService {
...
@@ -42,9 +41,6 @@ public class IndicatorsValueService {
private
IndicatorsDataMapper
indicatorsDataMapper
;
private
IndicatorsDataMapper
indicatorsDataMapper
;
@Autowired
@Autowired
private
DriveIndCalResultDefMapper
driveIndCalResultDefMapper
;
private
DriveIndCalResultDefMapper
driveIndCalResultDefMapper
;
@Value
(
"${mongodb.database}"
)
private
String
database
;
public
void
fillExcelXianScore
(
List
<
String
>
indIds
,
int
date
,
public
void
fillExcelXianScore
(
List
<
String
>
indIds
,
int
date
,
String
compareObjString
,
int
groupNum
,
int
type
)
throws
Exception
{
String
compareObjString
,
int
groupNum
,
int
type
)
throws
Exception
{
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/ScoreRuleCatalogService.java
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.
Optional
;
import
java.util.
Map
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.keymobile.indicators.model.entity.objscorerule.ScoreRuleCatalog
;
import
com.keymobile.indicators.model.entity.objscorerule.ScoreRuleCatalog
;
import
com.keymobile.indicators.
persistence.hyindicators.ScoreRuleCatalogRepository
;
import
com.keymobile.indicators.
model.mapper.indmapper.ScoreRuleCatalogMapper
;
import
com.keymobile.indicators.
persistence.hyindicators.ScoreRuleRepository
;
import
com.keymobile.indicators.
model.mapper.indmapper.ScoreRuleMapper
;
@Service
@Service
public
class
ScoreRuleCatalogService
{
public
class
ScoreRuleCatalogService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ScoreRuleCatalogService
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ScoreRuleCatalogService
.
class
);
@Autowired
@Autowired
private
ScoreRuleCatalog
Repository
scoreRuleCatalogRepo
;
private
ScoreRuleCatalog
Mapper
scoreRuleCatalogMapper
;
@Autowired
@Autowired
private
ScoreRule
Repository
scoreRuleRepo
;
private
ScoreRule
Mapper
scoreRuleMapper
;
public
ScoreRuleCatalog
saveOrUpdate
(
ScoreRuleCatalog
scoreRuleCatalog
)
throws
Exception
{
public
ScoreRuleCatalog
saveOrUpdate
(
ScoreRuleCatalog
scoreRuleCatalog
)
throws
Exception
{
if
(
StringUtils
.
isBlank
(
scoreRuleCatalog
.
getId
())
)
{
//新增
if
(
scoreRuleCatalog
.
getId
()==
null
)
{
//新增
//保存
//保存
scoreRuleCatalog
=
scoreRuleCatalogRepo
.
save
(
scoreRuleCatalog
);
scoreRuleCatalog
Mapper
.
insert
(
scoreRuleCatalog
);
}
}
//获取parentId拼接idPath
//获取parentId拼接idPath
String
parentId
=
scoreRuleCatalog
.
getParentId
();
Integer
parentId
=
scoreRuleCatalog
.
getParentId
();
if
(
StringUtils
.
isBlank
(
parentId
)
||
"0"
.
equals
(
parentId
)
)
{
//顶层节点
if
(
parentId
==
0
)
{
//顶层节点
scoreRuleCatalog
.
setIdPath
(
scoreRuleCatalog
.
getId
(
));
scoreRuleCatalog
.
setIdPath
(
String
.
valueOf
(
scoreRuleCatalog
.
getId
()
));
}
else
{
}
else
{
Optional
<
ScoreRuleCatalog
>
parentScoreRuleCatalog
=
scoreRuleCatalogRepo
.
ScoreRuleCatalog
parentScoreRuleCatalog
=
scoreRuleCatalogMapper
.
findById
(
scoreRuleCatalog
.
getParentId
());
selectByPrimaryKey
(
scoreRuleCatalog
.
getParentId
());
if
(
!
parentScoreRuleCatalog
.
isPresent
()
)
{
if
(
parentScoreRuleCatalog
==
null
)
{
throw
new
Exception
(
"父节点不存在:parent catalog is not exist"
);
throw
new
Exception
(
"父节点不存在:parent catalog is not exist"
);
}
else
{
}
else
{
scoreRuleCatalog
.
setIdPath
(
parentScoreRuleCatalog
.
get
().
get
IdPath
()+
";"
+
scoreRuleCatalog
.
getId
());
scoreRuleCatalog
.
setIdPath
(
parentScoreRuleCatalog
.
getIdPath
()+
";"
+
scoreRuleCatalog
.
getId
());
}
}
}
}
//保存
//保存
scoreRuleCatalog
=
scoreRuleCatalogRepo
.
save
(
scoreRuleCatalog
);
scoreRuleCatalog
Mapper
.
updateByPrimaryKey
(
scoreRuleCatalog
);
return
scoreRuleCatalog
;
return
scoreRuleCatalog
;
}
}
public
void
delete
(
List
<
String
>
ids
)
{
public
void
delete
(
List
<
Integer
>
ids
)
{
scoreRuleCatalog
Repo
.
deleteByIdIn
(
ids
);
scoreRuleCatalog
Mapper
.
deleteByIdIn
(
ids
);
}
}
//递归查找父目录下的子目录
//递归查找父目录下的子目录
public
List
<
String
>
getDeleteCatalogId
(
String
id
){
public
List
<
Integer
>
getDeleteCatalogId
(
Integer
id
){
List
<
String
>
result
=
new
ArrayList
<>();
List
<
Integer
>
result
=
new
ArrayList
<>();
result
.
add
(
id
);
result
.
add
(
id
);
//根据id获取子节点
//根据id获取子节点
List
<
ScoreRuleCatalog
>
children
=
scoreRuleCatalog
Repo
.
findByParentId
(
id
);
List
<
ScoreRuleCatalog
>
children
=
scoreRuleCatalog
Mapper
.
findByParentId
(
id
);
if
(!
children
.
isEmpty
())
{
if
(!
children
.
isEmpty
())
{
for
(
ScoreRuleCatalog
child
:
children
)
{
for
(
ScoreRuleCatalog
child
:
children
)
{
result
.
addAll
(
getDeleteCatalogId
(
child
.
getId
()));
result
.
addAll
(
getDeleteCatalogId
(
child
.
getId
()));
...
@@ -65,20 +65,20 @@ public class ScoreRuleCatalogService {
...
@@ -65,20 +65,20 @@ public class ScoreRuleCatalogService {
}
}
//递归删除
//递归删除
public
void
recursionDelete
(
List
<
String
>
ids
)
{
public
void
recursionDelete
(
List
<
Integer
>
ids
)
{
for
(
String
id
:
ids
)
{
for
(
Integer
id
:
ids
)
{
List
<
String
>
result
=
this
.
getDeleteCatalogId
(
id
);
List
<
Integer
>
result
=
this
.
getDeleteCatalogId
(
id
);
this
.
delete
(
result
);
this
.
delete
(
result
);
//删除目录关联的单位评分规则
//删除目录关联的单位评分规则
scoreRule
Repo
.
deleteByCatalogIdIn
(
result
);
scoreRule
Mapper
.
deleteByCatalogIdIn
(
result
);
}
}
}
}
//获取目录树
//获取目录树
public
List
<
ScoreRuleCatalog
>
getCatalog
(
String
parentId
,
List
<
String
>
codes
){
public
List
<
ScoreRuleCatalog
>
getCatalog
(
Integer
parentId
,
List
<
String
>
codes
){
if
(
StringUtils
.
isBlank
(
parentId
)
||
"0"
.
equals
(
parentId
))
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
return
scoreRuleCatalogRepo
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
"0"
,
codes
);
paramMap
.
put
(
"pid"
,
parentId
);
}
paramMap
.
put
(
"codes"
,
codes
);
return
scoreRuleCatalog
Repo
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
parentId
,
codes
);
return
scoreRuleCatalog
Mapper
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
paramMap
);
}
}
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/ScoreRuleService.java
View file @
0c5194c7
...
@@ -4,7 +4,6 @@ import java.util.ArrayList;
...
@@ -4,7 +4,6 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Optional
;
import
java.util.regex.Matcher
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
java.util.regex.Pattern
;
...
@@ -12,11 +11,10 @@ import org.apache.commons.lang.StringUtils;
...
@@ -12,11 +11,10 @@ import org.apache.commons.lang.StringUtils;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.google.gson.Gson
;
import
com.google.gson.reflect.TypeToken
;
import
com.googlecode.aviator.AviatorEvaluator
;
import
com.googlecode.aviator.AviatorEvaluator
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDef
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDef
;
...
@@ -24,7 +22,7 @@ import com.keymobile.indicators.model.entity.objscorerule.IndTypeWeight;
...
@@ -24,7 +22,7 @@ import com.keymobile.indicators.model.entity.objscorerule.IndTypeWeight;
import
com.keymobile.indicators.model.entity.objscorerule.ScoreRule
;
import
com.keymobile.indicators.model.entity.objscorerule.ScoreRule
;
import
com.keymobile.indicators.model.mapper.indicators.DriveIndDefMapper
;
import
com.keymobile.indicators.model.mapper.indicators.DriveIndDefMapper
;
import
com.keymobile.indicators.model.mapper.indmapper.DriveIndCalResultDefMapper
;
import
com.keymobile.indicators.model.mapper.indmapper.DriveIndCalResultDefMapper
;
import
com.keymobile.indicators.
persistence.hyindicators.ScoreRuleRepository
;
import
com.keymobile.indicators.
model.mapper.indmapper.ScoreRuleMapper
;
import
com.keymobile.indicators.utils.CalculateUtils
;
import
com.keymobile.indicators.utils.CalculateUtils
;
@Service
@Service
...
@@ -32,7 +30,7 @@ public class ScoreRuleService {
...
@@ -32,7 +30,7 @@ public class ScoreRuleService {
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ScoreRuleService
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ScoreRuleService
.
class
);
@Autowired
@Autowired
private
ScoreRule
Repository
scoreRuleRepo
;
private
ScoreRule
Mapper
scoreRuleMapper
;
@Autowired
@Autowired
private
DriveIndDefMapper
driveIndDefMapper
;
private
DriveIndDefMapper
driveIndDefMapper
;
@Autowired
@Autowired
...
@@ -40,31 +38,47 @@ public class ScoreRuleService {
...
@@ -40,31 +38,47 @@ public class ScoreRuleService {
private
static
final
Pattern
P
=
Pattern
.
compile
(
"(\\[[^\\]]*\\])"
);
private
static
final
Pattern
P
=
Pattern
.
compile
(
"(\\[[^\\]]*\\])"
);
public
String
saveOrUpdate
(
ScoreRule
scoreRule
,
String
catalogId
,
String
catalogIdPath
,
String
user
)
{
public
Integer
saveOrUpdate
(
ScoreRule
scoreRule
,
Integer
catalogId
,
String
catalogIdPath
,
String
user
)
{
Gson
gson
=
new
Gson
();
if
(!
scoreRule
.
getIndTypeWeights
().
isEmpty
())
{
String
indTypeWeightsJson
=
gson
.
toJson
(
scoreRule
.
getIndTypeWeights
());
scoreRule
.
setIndTypeWeightsJson
(
indTypeWeightsJson
);
}
scoreRule
.
setCatalogId
(
catalogId
);
scoreRule
.
setCatalogId
(
catalogId
);
scoreRule
.
setCatalogIdPath
(
catalogIdPath
);
scoreRule
.
setCatalogIdPath
(
catalogIdPath
);
scoreRule
.
setLastUpdater
(
user
);
scoreRule
.
setLastUpdater
(
user
);
scoreRule
=
scoreRuleRepo
.
save
(
scoreRule
);
if
(
scoreRule
.
getId
()==
null
)
{
scoreRuleMapper
.
insert
(
scoreRule
);
}
else
{
scoreRuleMapper
.
updateByPrimaryKey
(
scoreRule
);
}
return
scoreRule
.
getId
();
return
scoreRule
.
getId
();
}
}
public
void
delete
(
String
id
)
{
public
void
delete
(
Integer
id
)
{
scoreRule
Repo
.
deleteById
(
id
);
scoreRule
Mapper
.
deleteByPrimaryKey
(
id
);
}
}
public
List
<
ScoreRule
>
getAll
(
String
code
){
public
List
<
ScoreRule
>
getAll
(
String
code
){
return
scoreRule
Repo
.
findByCode
(
code
);
return
scoreRule
Mapper
.
findByCode
(
code
);
}
}
public
Page
<
ScoreRule
>
getByCatalogId
(
String
catalogId
,
int
page
,
int
rows
){
public
Map
<
String
,
Object
>
getByCatalogId
(
Integer
catalogId
,
int
page
,
int
rows
){
Pageable
pageable
=
PageRequest
.
of
(
page
-
1
,
rows
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
return
scoreRuleRepo
.
findByCatalogId
(
catalogId
,
pageable
);
int
count
=
0
;
//计算start
int
start
=
(
page
-
1
)*
rows
;
count
=
scoreRuleMapper
.
countByCatalogId
(
catalogId
);
List
<
ScoreRule
>
datas
=
scoreRuleMapper
.
findByCatalogId
(
catalogId
,
start
,
rows
);
result
.
put
(
"count"
,
count
);
result
.
put
(
"data"
,
datas
);
return
result
;
}
}
public
ScoreRule
getById
(
String
id
)
{
public
ScoreRule
getById
(
Integer
id
)
{
Optional
<
ScoreRule
>
scoreRule
=
scoreRuleRepo
.
findById
(
id
);
ScoreRule
scoreRule
=
scoreRuleMapper
.
selectByPrimaryKey
(
id
);
if
(
scoreRule
.
isPresent
()
)
{
if
(
scoreRule
!=
null
)
{
return
scoreRule
.
get
()
;
return
scoreRule
;
}
}
return
null
;
return
null
;
}
}
...
@@ -212,6 +226,7 @@ public class ScoreRuleService {
...
@@ -212,6 +226,7 @@ public class ScoreRuleService {
private
Map
<
String
,
String
>
calIndCatalogTypeAverage
(
ScoreRule
scoreRule
,
private
Map
<
String
,
String
>
calIndCatalogTypeAverage
(
ScoreRule
scoreRule
,
String
compareObj
,
int
date
){
String
compareObj
,
int
date
){
Map
<
String
,
String
>
result
=
new
HashMap
<>();
Map
<
String
,
String
>
result
=
new
HashMap
<>();
Gson
gson
=
new
Gson
();
result
.
put
(
"compareObj"
,
compareObj
);
result
.
put
(
"compareObj"
,
compareObj
);
result
.
put
(
"scoreValue"
,
"0.0"
);
result
.
put
(
"scoreValue"
,
"0.0"
);
result
.
put
(
"improveValue"
,
"0.0"
);
result
.
put
(
"improveValue"
,
"0.0"
);
...
@@ -222,8 +237,10 @@ public class ScoreRuleService {
...
@@ -222,8 +237,10 @@ public class ScoreRuleService {
findByCompareObjAndDate
(
compareObj
,
date
);
findByCompareObjAndDate
(
compareObj
,
date
);
double
scoreValue
=
0.0
;
double
scoreValue
=
0.0
;
double
improveValue
=
0.0
;
double
improveValue
=
0.0
;
if
(!
scoreRule
.
getIndTypeWeights
().
isEmpty
())
{
if
(
StringUtils
.
isNotBlank
(
scoreRule
.
getIndTypeWeightsJson
()))
{
for
(
IndTypeWeight
indTypeWeight
:
scoreRule
.
getIndTypeWeights
())
{
List
<
IndTypeWeight
>
indTypeWeights
=
gson
.
fromJson
(
scoreRule
.
getIndTypeWeightsJson
(),
new
TypeToken
<
List
<
IndTypeWeight
>>(){}.
getType
());
for
(
IndTypeWeight
indTypeWeight
:
indTypeWeights
)
{
Map
<
String
,
Double
>
calScores
=
this
.
calIndTypeScore
(
scoreRule
,
indTypeWeight
,
calResults
);
Map
<
String
,
Double
>
calScores
=
this
.
calIndTypeScore
(
scoreRule
,
indTypeWeight
,
calResults
);
scoreValue
+=
(
calScores
.
get
(
"score"
)*
Double
.
parseDouble
(
indTypeWeight
.
getWeight
()));
scoreValue
+=
(
calScores
.
get
(
"score"
)*
Double
.
parseDouble
(
indTypeWeight
.
getWeight
()));
improveValue
+=
(
calScores
.
get
(
"improve"
)*
Double
.
parseDouble
(
indTypeWeight
.
getWeight
()));
improveValue
+=
(
calScores
.
get
(
"improve"
)*
Double
.
parseDouble
(
indTypeWeight
.
getWeight
()));
...
@@ -291,7 +308,7 @@ public class ScoreRuleService {
...
@@ -291,7 +308,7 @@ public class ScoreRuleService {
//根据单位评分规则计算单位分数
//根据单位评分规则计算单位分数
public
List
<
Map
<
String
,
String
>>
calObjScore
(
String
reportId
,
String
compareId
,
List
<
String
>
indIds
,
public
List
<
Map
<
String
,
String
>>
calObjScore
(
String
reportId
,
String
compareId
,
List
<
String
>
indIds
,
List
<
String
>
compareObjs
,
int
date
,
String
scoreRuleId
)
{
List
<
String
>
compareObjs
,
int
date
,
Integer
scoreRuleId
)
{
List
<
Map
<
String
,
String
>>
results
=
new
ArrayList
<>();
List
<
Map
<
String
,
String
>>
results
=
new
ArrayList
<>();
//根据单位得分评分卡id获取评分卡详情
//根据单位得分评分卡id获取评分卡详情
ScoreRule
scoreRule
=
this
.
getById
(
scoreRuleId
);
ScoreRule
scoreRule
=
this
.
getById
(
scoreRuleId
);
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/ScorecardCatalogService.java
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.
Optional
;
import
java.util.
Map
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.keymobile.indicators.model.entity.scorecard.ScorecardCatalog
;
import
com.keymobile.indicators.model.entity.scorecard.ScorecardCatalog
;
import
com.keymobile.indicators.
persistence.hyindicators.IndScorecardRepository
;
import
com.keymobile.indicators.
model.mapper.indmapper.IndScorecardMapper
;
import
com.keymobile.indicators.
persistence.hyindicators.ScorecardCatalogRepository
;
import
com.keymobile.indicators.
model.mapper.indmapper.ScorecardCatalogMapper
;
@Service
@Service
public
class
ScorecardCatalogService
{
public
class
ScorecardCatalogService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ScorecardCatalogService
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ScorecardCatalogService
.
class
);
@Autowired
@Autowired
private
ScorecardCatalog
Repository
scorecardCatalogRepo
;
private
ScorecardCatalog
Mapper
scorecardCatalogMapper
;
@Autowired
@Autowired
private
IndScorecard
Repository
indScorecardRepo
;
private
IndScorecard
Mapper
indScorecardMapper
;
public
ScorecardCatalog
saveOrUpdate
(
ScorecardCatalog
scorecardCatalog
)
throws
Exception
{
public
ScorecardCatalog
saveOrUpdate
(
ScorecardCatalog
scorecardCatalog
)
throws
Exception
{
if
(
StringUtils
.
isBlank
(
scorecardCatalog
.
getId
())
)
{
//新增
if
(
scorecardCatalog
.
getId
()==
null
)
{
//新增
//保存
//保存
scorecardCatalog
=
scorecardCatalogRepo
.
save
(
scorecardCatalog
);
scorecardCatalog
Mapper
.
insert
(
scorecardCatalog
);
}
}
//获取parentId拼接idPath
//获取parentId拼接idPath
String
parentId
=
scorecardCatalog
.
getParentId
();
Integer
parentId
=
scorecardCatalog
.
getParentId
();
if
(
StringUtils
.
isBlank
(
parentId
)
||
"0"
.
equals
(
parentId
)
)
{
//顶层节点
if
(
parentId
==
0
)
{
//顶层节点
scorecardCatalog
.
setIdPath
(
scorecardCatalog
.
getId
(
));
scorecardCatalog
.
setIdPath
(
String
.
valueOf
(
scorecardCatalog
.
getId
()
));
}
else
{
}
else
{
Optional
<
ScorecardCatalog
>
parentScorecardCatalog
=
scorecardCatalogRepo
.
ScorecardCatalog
parentScorecardCatalog
=
scorecardCatalogMapper
.
findById
(
scorecardCatalog
.
getParentId
());
selectByPrimaryKey
(
scorecardCatalog
.
getParentId
());
if
(
!
parentScorecardCatalog
.
isPresent
()
)
{
if
(
parentScorecardCatalog
==
null
)
{
throw
new
Exception
(
"父节点不存在:parent catalog is not exist"
);
throw
new
Exception
(
"父节点不存在:parent catalog is not exist"
);
}
else
{
}
else
{
scorecardCatalog
.
setIdPath
(
parentScorecardCatalog
.
get
().
get
IdPath
()+
";"
+
scorecardCatalog
.
getId
());
scorecardCatalog
.
setIdPath
(
parentScorecardCatalog
.
getIdPath
()+
";"
+
scorecardCatalog
.
getId
());
}
}
}
}
//保存
//保存
scorecardCatalog
=
scorecardCatalogRepo
.
save
(
scorecardCatalog
);
scorecardCatalog
Mapper
.
updateByPrimaryKey
(
scorecardCatalog
);
return
scorecardCatalog
;
return
scorecardCatalog
;
}
}
public
void
delete
(
List
<
String
>
ids
)
{
public
void
delete
(
List
<
Integer
>
ids
)
{
scorecardCatalog
Repo
.
deleteByIdIn
(
ids
);
scorecardCatalog
Mapper
.
deleteByIdIn
(
ids
);
}
}
//递归查找父目录下的子目录
//递归查找父目录下的子目录
public
List
<
String
>
getDeleteCatalogId
(
String
id
){
public
List
<
Integer
>
getDeleteCatalogId
(
Integer
id
){
List
<
String
>
result
=
new
ArrayList
<>();
List
<
Integer
>
result
=
new
ArrayList
<>();
result
.
add
(
id
);
result
.
add
(
id
);
//根据id获取子节点
//根据id获取子节点
List
<
ScorecardCatalog
>
children
=
scorecardCatalog
Repo
.
findByParentId
(
id
);
List
<
ScorecardCatalog
>
children
=
scorecardCatalog
Mapper
.
findByParentId
(
id
);
if
(!
children
.
isEmpty
())
{
if
(!
children
.
isEmpty
())
{
for
(
ScorecardCatalog
child
:
children
)
{
for
(
ScorecardCatalog
child
:
children
)
{
result
.
addAll
(
getDeleteCatalogId
(
child
.
getId
()));
result
.
addAll
(
getDeleteCatalogId
(
child
.
getId
()));
...
@@ -65,20 +65,20 @@ public class ScorecardCatalogService {
...
@@ -65,20 +65,20 @@ public class ScorecardCatalogService {
}
}
//递归删除
//递归删除
public
void
recursionDelete
(
List
<
String
>
ids
)
{
public
void
recursionDelete
(
List
<
Integer
>
ids
)
{
for
(
String
id
:
ids
)
{
for
(
Integer
id
:
ids
)
{
List
<
String
>
result
=
this
.
getDeleteCatalogId
(
id
);
List
<
Integer
>
result
=
this
.
getDeleteCatalogId
(
id
);
this
.
delete
(
result
);
this
.
delete
(
result
);
//删除目录关联的评分卡
//删除目录关联的评分卡
indScorecard
Repo
.
deleteByCatalogIdIn
(
result
);
indScorecard
Mapper
.
deleteByCatalogIdIn
(
result
);
}
}
}
}
//获取目录树
//获取目录树
public
List
<
ScorecardCatalog
>
getCatalog
(
String
parentId
,
List
<
String
>
codes
){
public
List
<
ScorecardCatalog
>
getCatalog
(
Integer
parentId
,
List
<
String
>
codes
){
if
(
StringUtils
.
isBlank
(
parentId
)
||
"0"
.
equals
(
parentId
))
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
return
scorecardCatalogRepo
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
"0"
,
codes
);
paramMap
.
put
(
"pid"
,
parentId
);
}
paramMap
.
put
(
"codes"
,
codes
);
return
scorecardCatalog
Repo
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
parentId
,
codes
);
return
scorecardCatalog
Mapper
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
paramMap
);
}
}
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/ShortboardCatalogService.java
View file @
0c5194c7
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Optional
;
import
java.util.Map
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardCatalog
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardCatalog
;
import
com.keymobile.indicators.
persistence.hyindicators.ShortboardCatalogRepository
;
import
com.keymobile.indicators.
model.mapper.indmapper.ShortboardCatalogMapper
;
import
com.keymobile.indicators.
persistence.hyindicators.ShortboardRuleRepository
;
import
com.keymobile.indicators.
model.mapper.indmapper.ShortboardRuleMapper
;
@Service
@Service
public
class
ShortboardCatalogService
{
public
class
ShortboardCatalogService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ShortboardCatalogService
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ShortboardCatalogService
.
class
);
@Autowired
@Autowired
private
ShortboardCatalog
Repository
shortboardCatalogRepo
;
private
ShortboardCatalog
Mapper
shortboardCatalogMapper
;
@Autowired
@Autowired
private
ShortboardRule
Repository
shortboardRuleRepo
;
private
ShortboardRule
Mapper
shortboardRuleMapper
;
public
ShortboardCatalog
saveOrUpdate
(
ShortboardCatalog
shortboardCatalog
)
throws
Exception
{
public
ShortboardCatalog
saveOrUpdate
(
ShortboardCatalog
shortboardCatalog
)
throws
Exception
{
if
(
StringUtils
.
isBlank
(
shortboardCatalog
.
getId
())
)
{
//新增
if
(
shortboardCatalog
.
getId
()==
null
)
{
//新增
//保存
//保存
shortboardCatalog
=
shortboardCatalogRepo
.
save
(
shortboardCatalog
);
shortboardCatalog
Mapper
.
insert
(
shortboardCatalog
);
}
}
//获取parentId拼接idPath
//获取parentId拼接idPath
String
parentId
=
shortboardCatalog
.
getParentId
();
Integer
parentId
=
shortboardCatalog
.
getParentId
();
if
(
StringUtils
.
isBlank
(
parentId
)
||
"0"
.
equals
(
parentId
)
)
{
//顶层节点
if
(
parentId
==
0
)
{
//顶层节点
shortboardCatalog
.
setIdPath
(
shortboardCatalog
.
getId
(
));
shortboardCatalog
.
setIdPath
(
String
.
valueOf
(
shortboardCatalog
.
getId
()
));
}
else
{
}
else
{
Optional
<
ShortboardCatalog
>
parentShortboardCatalog
=
shortboardCatalogRepo
.
ShortboardCatalog
parentShortboardCatalog
=
shortboardCatalogMapper
.
findById
(
shortboardCatalog
.
getParentId
());
selectByPrimaryKey
(
shortboardCatalog
.
getParentId
());
if
(
!
parentShortboardCatalog
.
isPresent
()
)
{
if
(
parentShortboardCatalog
==
null
)
{
throw
new
Exception
(
"父节点不存在:parent catalog is not exist"
);
throw
new
Exception
(
"父节点不存在:parent catalog is not exist"
);
}
else
{
}
else
{
shortboardCatalog
.
setIdPath
(
parentShortboardCatalog
.
get
().
get
IdPath
()+
";"
+
shortboardCatalog
.
getId
());
shortboardCatalog
.
setIdPath
(
parentShortboardCatalog
.
getIdPath
()+
";"
+
shortboardCatalog
.
getId
());
}
}
}
}
//保存
//保存
shortboardCatalog
=
shortboardCatalogRepo
.
save
(
shortboardCatalog
);
shortboardCatalog
Mapper
.
updateByPrimaryKey
(
shortboardCatalog
);
return
shortboardCatalog
;
return
shortboardCatalog
;
}
}
public
void
delete
(
List
<
String
>
ids
)
{
public
void
delete
(
List
<
Integer
>
ids
)
{
shortboardCatalog
Repo
.
deleteByIdIn
(
ids
);
shortboardCatalog
Mapper
.
deleteByIdIn
(
ids
);
}
}
//递归查找父目录下的子目录
//递归查找父目录下的子目录
public
List
<
String
>
getDeleteCatalogId
(
String
id
){
public
List
<
Integer
>
getDeleteCatalogId
(
Integer
id
){
List
<
String
>
result
=
new
ArrayList
<>();
List
<
Integer
>
result
=
new
ArrayList
<>();
result
.
add
(
id
);
result
.
add
(
id
);
//根据id获取子节点
//根据id获取子节点
List
<
ShortboardCatalog
>
children
=
shortboardCatalog
Repo
.
findByParentId
(
id
);
List
<
ShortboardCatalog
>
children
=
shortboardCatalog
Mapper
.
findByParentId
(
id
);
if
(!
children
.
isEmpty
())
{
if
(!
children
.
isEmpty
())
{
for
(
ShortboardCatalog
child
:
children
)
{
for
(
ShortboardCatalog
child
:
children
)
{
result
.
addAll
(
getDeleteCatalogId
(
child
.
getId
()));
result
.
addAll
(
getDeleteCatalogId
(
child
.
getId
()));
...
@@ -65,20 +64,20 @@ public class ShortboardCatalogService {
...
@@ -65,20 +64,20 @@ public class ShortboardCatalogService {
}
}
//递归删除
//递归删除
public
void
recursionDelete
(
List
<
String
>
ids
)
{
public
void
recursionDelete
(
List
<
Integer
>
ids
)
{
for
(
String
id
:
ids
)
{
for
(
Integer
id
:
ids
)
{
List
<
String
>
result
=
this
.
getDeleteCatalogId
(
id
);
List
<
Integer
>
result
=
this
.
getDeleteCatalogId
(
id
);
this
.
delete
(
result
);
this
.
delete
(
result
);
//删除目录关联的短板筛选规则
//删除目录关联的短板筛选规则
shortboardRule
Repo
.
deleteByCatalogIdIn
(
result
);
shortboardRule
Mapper
.
deleteByCatalogIdIn
(
result
);
}
}
}
}
//获取目录树
//获取目录树
public
List
<
ShortboardCatalog
>
getCatalog
(
String
parentId
,
List
<
String
>
codes
){
public
List
<
ShortboardCatalog
>
getCatalog
(
Integer
parentId
,
List
<
String
>
codes
){
if
(
StringUtils
.
isBlank
(
parentId
)
||
"0"
.
equals
(
parentId
))
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
return
shortboardCatalogRepo
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
"0"
,
codes
);
paramMap
.
put
(
"pid"
,
parentId
);
}
paramMap
.
put
(
"codes"
,
codes
);
return
shortboardCatalog
Repo
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
parentId
,
codes
);
return
shortboardCatalog
Mapper
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
paramMap
);
}
}
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/ShortboardRuleService.java
View file @
0c5194c7
...
@@ -4,23 +4,22 @@ import java.util.ArrayList;
...
@@ -4,23 +4,22 @@ import java.util.ArrayList;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Optional
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.data.domain.Pageable
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
com.google.gson.Gson
;
import
com.google.gson.reflect.TypeToken
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndCalResultDef
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardDriveIndRel
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardDriveIndRel
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardItem
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardItem
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardRule
;
import
com.keymobile.indicators.model.entity.shortboard.ShortboardRule
;
import
com.keymobile.indicators.model.mapper.indmapper.DriveIndCalResultDefMapper
;
import
com.keymobile.indicators.model.mapper.indmapper.DriveIndCalResultDefMapper
;
import
com.keymobile.indicators.
persistence.hyindicators.ShortboardDriveIndRelRepository
;
import
com.keymobile.indicators.
model.mapper.indmapper.ShortboardDriveIndRelMapper
;
import
com.keymobile.indicators.
persistence.hyindicators.ShortboardRuleRepository
;
import
com.keymobile.indicators.
model.mapper.indmapper.ShortboardRuleMapper
;
import
com.keymobile.indicators.utils.CalculateUtils
;
import
com.keymobile.indicators.utils.CalculateUtils
;
@Service
@Service
...
@@ -28,34 +27,50 @@ public class ShortboardRuleService {
...
@@ -28,34 +27,50 @@ public class ShortboardRuleService {
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ShortboardRuleService
.
class
);
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ShortboardRuleService
.
class
);
@Autowired
@Autowired
private
ShortboardRule
Repository
shortboardRuleRepo
;
private
ShortboardRule
Mapper
shortboardRuleMapper
;
@Autowired
@Autowired
private
ShortboardDriveIndRel
Repository
shortboardDriveIndRelRepo
;
private
ShortboardDriveIndRel
Mapper
shortboardDriveIndRelMapper
;
@Autowired
@Autowired
private
DriveIndCalResultDefMapper
driveIndCalResultDefMapper
;
private
DriveIndCalResultDefMapper
driveIndCalResultDefMapper
;
public
String
saveOrUpdate
(
ShortboardRule
shortboardRule
,
String
catalogId
,
public
Integer
saveOrUpdate
(
ShortboardRule
shortboardRule
,
Integer
catalogId
,
String
catalogIdPath
,
String
user
)
{
String
catalogIdPath
,
String
user
)
{
Gson
gson
=
new
Gson
();
if
(!
shortboardRule
.
getShortboardItem
().
isEmpty
())
{
String
shortboardItemJson
=
gson
.
toJson
(
shortboardRule
.
getShortboardItem
());
shortboardRule
.
setShortboardItemJson
(
shortboardItemJson
);
}
shortboardRule
.
setCatalogId
(
catalogId
);
shortboardRule
.
setCatalogId
(
catalogId
);
shortboardRule
.
setCatalogIdPath
(
catalogIdPath
);
shortboardRule
.
setCatalogIdPath
(
catalogIdPath
);
shortboardRule
.
setLastUpdater
(
user
);
shortboardRule
.
setLastUpdater
(
user
);
shortboardRule
=
shortboardRuleRepo
.
save
(
shortboardRule
);
if
(
shortboardRule
.
getId
()==
null
)
{
shortboardRuleMapper
.
insert
(
shortboardRule
);
}
else
{
shortboardRuleMapper
.
updateByPrimaryKey
(
shortboardRule
);
}
return
shortboardRule
.
getId
();
return
shortboardRule
.
getId
();
}
}
public
void
delete
(
String
id
)
{
public
void
delete
(
Integer
id
)
{
shortboardRule
Repo
.
deleteById
(
id
);
shortboardRule
Mapper
.
deleteByPrimaryKey
(
id
);
}
}
public
Page
<
ShortboardRule
>
getByCatalogId
(
String
catalogId
,
int
page
,
int
rows
){
public
Map
<
String
,
Object
>
getByCatalogId
(
Integer
catalogId
,
int
page
,
int
rows
){
Pageable
pageable
=
PageRequest
.
of
(
page
-
1
,
rows
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
return
shortboardRuleRepo
.
findByCatalogId
(
catalogId
,
pageable
);
int
count
=
0
;
//计算start
int
start
=
(
page
-
1
)*
rows
;
count
=
shortboardRuleMapper
.
countByCatalogId
(
catalogId
);
List
<
ShortboardRule
>
datas
=
shortboardRuleMapper
.
findByCatalogId
(
catalogId
,
start
,
rows
);
result
.
put
(
"count"
,
count
);
result
.
put
(
"data"
,
datas
);
return
result
;
}
}
public
ShortboardRule
getById
(
String
id
)
{
public
ShortboardRule
getById
(
Integer
id
)
{
Optional
<
ShortboardRule
>
shortboardRule
=
shortboardRuleRepo
.
findById
(
id
);
ShortboardRule
shortboardRule
=
shortboardRuleMapper
.
selectByPrimaryKey
(
id
);
if
(
shortboardRule
.
isPresent
()
)
{
if
(
shortboardRule
!=
null
)
{
return
shortboardRule
.
get
()
;
return
shortboardRule
;
}
}
return
null
;
return
null
;
}
}
...
@@ -64,16 +79,20 @@ public class ShortboardRuleService {
...
@@ -64,16 +79,20 @@ public class ShortboardRuleService {
public
List
<
Map
<
String
,
String
>>
getObjShortboard
(
String
compareId
,
int
date
,
public
List
<
Map
<
String
,
String
>>
getObjShortboard
(
String
compareId
,
int
date
,
List
<
String
>
compareObjs
,
List
<
String
>
driveIds
){
List
<
String
>
compareObjs
,
List
<
String
>
driveIds
){
List
<
Map
<
String
,
String
>>
result
=
new
ArrayList
<>();
List
<
Map
<
String
,
String
>>
result
=
new
ArrayList
<>();
Gson
gson
=
new
Gson
();
for
(
String
driveId
:
driveIds
)
{
for
(
String
driveId
:
driveIds
)
{
//根据考核指标id获取关联的短板筛选规则id
//根据考核指标id获取关联的短板筛选规则id
List
<
ShortboardDriveIndRel
>
relations
=
shortboardDriveIndRel
Repo
.
List
<
ShortboardDriveIndRel
>
relations
=
shortboardDriveIndRel
Mapper
.
findByDriveIndDefId
(
driveId
);
findByDriveIndDefId
(
driveId
);
for
(
ShortboardDriveIndRel
rel
:
relations
)
{
for
(
ShortboardDriveIndRel
rel
:
relations
)
{
ShortboardRule
shortboardRule
=
this
.
getById
(
rel
.
getShortboardRuleId
());
ShortboardRule
shortboardRule
=
this
.
getById
(
rel
.
getShortboardRuleId
());
if
(
shortboardRule
!=
null
)
{
if
(
shortboardRule
!=
null
)
{
List
<
ShortboardItem
>
shortboardItems
=
shortboardRule
.
getShortboardItem
();
if
(
StringUtils
.
isNotBlank
(
shortboardRule
.
getShortboardItemJson
()))
{
for
(
ShortboardItem
item
:
shortboardItems
)
{
List
<
ShortboardItem
>
shortboardItems
=
gson
.
fromJson
(
shortboardRule
.
getShortboardItemJson
(),
new
TypeToken
<
List
<
ShortboardItem
>>(){}.
getType
());
for
(
ShortboardItem
item
:
shortboardItems
)
{
}
}
}
}
}
}
}
...
...
src/main/resources/mybatis/mapping/BaseIndDefVersionDataMapper.xml
0 → 100644
View file @
0c5194c7
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.keymobile.indicators.model.mapper.indmapper.BaseIndDefVersionDataMapper"
>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/DriveIndCatalogMapper.xml
0 → 100644
View file @
0c5194c7
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.keymobile.indicators.model.mapper.indmapper.DriveIndCatalogMapper"
>
<delete
id=
"deleteByIdIn"
parameterType=
"java.util.List"
>
delete
from drive_ind_catalog
where id in
<foreach
item=
"id"
collection=
"ids"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
<select
id=
"findByParentIdAndCodeInOrderByLastUpdateTimeDesc"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCatalog"
>
select *
from drive_ind_catalog
where parent_id = #{pid} and
code in
<foreach
item=
"id"
collection=
"codes"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
order by last_update_time desc
</select>
<select
id=
"findByParentId"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndCatalog"
>
select *
from drive_ind_catalog
where parent_id = #{pid}
</select>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/DriveIndDefVersionDataMapper.xml
0 → 100644
View file @
0c5194c7
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.keymobile.indicators.model.mapper.indmapper.DriveIndDefVersionDataMapper"
>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/IndCatalogMapper.xml
0 → 100644
View file @
0c5194c7
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.keymobile.indicators.model.mapper.indmapper.IndCatalogMapper"
>
<delete
id=
"deleteByIdIn"
parameterType=
"java.util.List"
>
delete
from base_ind_catalog
where id in
<foreach
item=
"id"
collection=
"ids"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
<select
id=
"findByParentIdAndCodeInOrderByLastUpdateTimeDesc"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.indicators.IndCatalog"
>
select *
from base_ind_catalog
where parent_id = #{pid} and
code in
<foreach
item=
"id"
collection=
"codes"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
order by last_update_time desc
</select>
<select
id=
"findByParentId"
resultType=
"com.keymobile.indicators.model.entity.indicators.IndCatalog"
>
select *
from base_ind_catalog
where parent_id = #{pid}
</select>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/IndScorecardMapper.xml
0 → 100644
View file @
0c5194c7
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.keymobile.indicators.model.mapper.indmapper.IndScorecardMapper"
>
<select
id=
"findByCatalogId"
resultType=
"com.keymobile.indicators.model.entity.scorecard.IndScorecard"
>
select *
from drive_ind_score_card
where catalog_id = #{catalogId}
limit #{start},#{end}
</select>
<select
id=
"countByCatalogId"
resultType=
"java.lang.Integer"
>
select count(1)
from drive_ind_score_card
where catalog_id = #{catalogId}
</select>
<delete
id=
"deleteByCatalogIdIn"
parameterType=
"java.util.List"
>
delete
from drive_ind_score_card
where catalog_id in
<foreach
item=
"id"
collection=
"catalogIds"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/ScoreRuleCatalogMapper.xml
0 → 100644
View file @
0c5194c7
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.keymobile.indicators.model.mapper.indmapper.ScoreRuleCatalogMapper"
>
<delete
id=
"deleteByIdIn"
parameterType=
"java.util.List"
>
delete
from obj_score_rule_catalog
where id in
<foreach
item=
"id"
collection=
"ids"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
<select
id=
"findByParentIdAndCodeInOrderByLastUpdateTimeDesc"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.objscorerule.ScoreRuleCatalog"
>
select *
from obj_score_rule_catalog
where parent_id = #{pid} and
code in
<foreach
item=
"id"
collection=
"codes"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
order by last_update_time desc
</select>
<select
id=
"findByParentId"
resultType=
"com.keymobile.indicators.model.entity.objscorerule.ScoreRuleCatalog"
>
select *
from obj_score_rule_catalog
where parent_id = #{pid}
</select>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/ScoreRuleMapper.xml
0 → 100644
View file @
0c5194c7
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.keymobile.indicators.model.mapper.indmapper.ScoreRuleMapper"
>
<select
id=
"findByCode"
resultType=
"com.keymobile.indicators.model.entity.objscorerule.ScoreRule"
>
select *
from obj_score_rule
where code = #{code}
</select>
<select
id=
"findByCatalogId"
resultType=
"com.keymobile.indicators.model.entity.objscorerule.ScoreRule"
>
select *
from obj_score_rule
where catalog_id = #{catalogId}
limit #{start},#{end}
</select>
<select
id=
"countByCatalogId"
resultType=
"java.lang.Integer"
>
select count(1)
from obj_score_rule
where catalog_id = #{catalogId}
</select>
<delete
id=
"deleteByCatalogIdIn"
parameterType=
"java.util.List"
>
delete
from obj_score_rule
where catalog_id in
<foreach
item=
"id"
collection=
"catalogIds"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/ScorecardCatalogMapper.xml
0 → 100644
View file @
0c5194c7
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.keymobile.indicators.model.mapper.indmapper.ScorecardCatalogMapper"
>
<delete
id=
"deleteByIdIn"
parameterType=
"java.util.List"
>
delete
from score_card_catalog
where id in
<foreach
item=
"id"
collection=
"ids"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
<select
id=
"findByParentIdAndCodeInOrderByLastUpdateTimeDesc"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.scorecard.ScorecardCatalog"
>
select *
from score_card_catalog
where parent_id = #{pid} and
code in
<foreach
item=
"id"
collection=
"codes"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
order by last_update_time desc
</select>
<select
id=
"findByParentId"
resultType=
"com.keymobile.indicators.model.entity.scorecard.ScorecardCatalog"
>
select *
from score_card_catalog
where parent_id = #{pid}
</select>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/ShortboardCatalogMapper.xml
0 → 100644
View file @
0c5194c7
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.keymobile.indicators.model.mapper.indmapper.ShortboardCatalogMapper"
>
<delete
id=
"deleteByIdIn"
parameterType=
"java.util.List"
>
delete
from ind_short_board_catalog
where id in
<foreach
item=
"id"
collection=
"ids"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
<select
id=
"findByParentIdAndCodeInOrderByLastUpdateTimeDesc"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.shortboard.ShortboardCatalog"
>
select *
from ind_short_board_catalog
where parent_id = #{pid} and
code in
<foreach
item=
"id"
collection=
"codes"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
order by last_update_time desc
</select>
<select
id=
"findByParentId"
resultType=
"com.keymobile.indicators.model.entity.shortboard.ShortboardCatalog"
>
select *
from ind_short_board_catalog
where parent_id = #{pid}
</select>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/ShortboardDriveIndRelMapper.xml
0 → 100644
View file @
0c5194c7
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.keymobile.indicators.model.mapper.indmapper.ShortboardDriveIndRelMapper"
>
<select
id=
"findByDriveIndDefId"
resultType=
"com.keymobile.indicators.model.entity.shortboard.ShortboardDriveIndRel"
>
select *
from short_board_drive_ind_rel
where drive_ind_def_id = #{driveIndDefId}
</select>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/ShortboardRuleMapper.xml
0 → 100644
View file @
0c5194c7
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.keymobile.indicators.model.mapper.indmapper.ShortboardRuleMapper"
>
<select
id=
"findByCatalogId"
resultType=
"com.keymobile.indicators.model.entity.shortboard.ShortboardRule"
>
select *
from short_board_rule
where catalog_id = #{catalogId}
limit #{start},#{end}
</select>
<select
id=
"countByCatalogId"
resultType=
"java.lang.Integer"
>
select count(1)
from short_board_rule
where catalog_id = #{catalogId}
</select>
<delete
id=
"deleteByCatalogIdIn"
parameterType=
"java.util.List"
>
delete
from short_board_rule
where catalog_id in
<foreach
item=
"id"
collection=
"catalogIds"
open=
"("
close=
")"
separator=
","
>
#{id}
</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