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
d7fe37f7
Commit
d7fe37f7
authored
Jun 08, 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
8495a010
83ca9adc
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
78 changed files
with
1269 additions
and
2067 deletions
+1269
-2067
pom.xml
pom.xml
+5
-0
DriveIndCalculateActor.java
...ymobile/indicators/akka/actor/DriveIndCalculateActor.java
+9
-15
DriveIndCalculateRegionActor.java
...ors/akka/actor/specific/DriveIndCalculateRegionActor.java
+3
-3
IndAcsDefCtrl.java
...va/com/keymobile/indicators/api/cmbkpi/IndAcsDefCtrl.java
+0
-71
IndAcsScoreInfoCtrl.java
.../keymobile/indicators/api/cmbkpi/IndAcsScoreInfoCtrl.java
+0
-77
IndAnaDefCtrl.java
...va/com/keymobile/indicators/api/cmbkpi/IndAnaDefCtrl.java
+0
-59
IndCatalogCtrl.java
...om/keymobile/indicators/api/hytobacco/IndCatalogCtrl.java
+69
-0
IndScorecardCtrl.java
.../keymobile/indicators/api/hytobacco/IndScorecardCtrl.java
+1
-2
IndicatorsDefCtrl.java
...keymobile/indicators/api/hytobacco/IndicatorsDefCtrl.java
+44
-49
IndicatorsValueCtrl.java
...ymobile/indicators/api/hytobacco/IndicatorsValueCtrl.java
+15
-0
DeriveIndicatorsCtrl.java
...obile/indicators/api/indicators/DeriveIndicatorsCtrl.java
+0
-70
IndicatorsCtrl.java
...m/keymobile/indicators/api/indicators/IndicatorsCtrl.java
+0
-119
GeneralParm.java
...va/com/keymobile/indicators/model/entity/GeneralParm.java
+0
-22
IndAcsData.java
...ava/com/keymobile/indicators/model/entity/IndAcsData.java
+0
-20
IndAcsDef.java
...java/com/keymobile/indicators/model/entity/IndAcsDef.java
+0
-40
IndAcsScoreInfo.java
...om/keymobile/indicators/model/entity/IndAcsScoreInfo.java
+0
-27
IndAnaData.java
...ava/com/keymobile/indicators/model/entity/IndAnaData.java
+0
-22
IndAnaDef.java
...java/com/keymobile/indicators/model/entity/IndAnaDef.java
+0
-33
IndRelInf.java
...java/com/keymobile/indicators/model/entity/IndRelInf.java
+0
-21
IndRelTree.java
...ava/com/keymobile/indicators/model/entity/IndRelTree.java
+0
-16
BaseIndDef.java
...mobile/indicators/model/entity/indicators/BaseIndDef.java
+35
-0
BaseIndDefVersionData.java
...cators/model/entity/indicators/BaseIndDefVersionData.java
+27
-0
DriveIndCatalog.java
...e/indicators/model/entity/indicators/DriveIndCatalog.java
+34
-0
DriveIndDef.java
...obile/indicators/model/entity/indicators/DriveIndDef.java
+43
-0
DriveIndDefVersionData.java
...ators/model/entity/indicators/DriveIndDefVersionData.java
+27
-0
IndCatalog.java
...mobile/indicators/model/entity/indicators/IndCatalog.java
+35
-0
IndTypeWeight.java
...e/indicators/model/entity/objscorerule/IndTypeWeight.java
+20
-0
ScoreRule.java
...obile/indicators/model/entity/objscorerule/ScoreRule.java
+38
-0
IndScorecard.java
...obile/indicators/model/entity/scorecard/IndScorecard.java
+1
-0
DeriveIndicators.java
...ymobile/indicators/model/indicators/DeriveIndicators.java
+0
-119
IndicatorsDef.java
.../keymobile/indicators/model/indicators/IndicatorsDef.java
+0
-127
IndicatorsDim.java
.../keymobile/indicators/model/indicators/IndicatorsDim.java
+0
-119
GeneralParmMapper.java
.../keymobile/indicators/model/mapper/GeneralParmMapper.java
+0
-12
IndAcsDataMapper.java
...m/keymobile/indicators/model/mapper/IndAcsDataMapper.java
+0
-8
IndAcsScoreInfoMapper.java
...mobile/indicators/model/mapper/IndAcsScoreInfoMapper.java
+0
-12
IndAnaDataMapper.java
...m/keymobile/indicators/model/mapper/IndAnaDataMapper.java
+0
-8
IndRelInfMapper.java
...om/keymobile/indicators/model/mapper/IndRelInfMapper.java
+0
-8
BaseIndDefMapper.java
.../indicators/model/mapper/indicators/BaseIndDefMapper.java
+5
-5
DriveIndDefMapper.java
...indicators/model/mapper/indicators/DriveIndDefMapper.java
+6
-7
BaseIndDefVersionRepository.java
...persistence/hyindicators/BaseIndDefVersionRepository.java
+9
-0
DriveIndCalResultRepository.java
...persistence/hyindicators/DriveIndCalResultRepository.java
+4
-0
DriveIndCatalogRepository.java
...s/persistence/hyindicators/DriveIndCatalogRepository.java
+15
-0
DriveIndDefVersionRepository.java
...ersistence/hyindicators/DriveIndDefVersionRepository.java
+9
-0
IndCatalogRepository.java
...cators/persistence/hyindicators/IndCatalogRepository.java
+16
-0
ScoreRuleRepository.java
...icators/persistence/hyindicators/ScoreRuleRepository.java
+11
-0
DeriveIndicatorsRepository.java
...rs/persistence/indicators/DeriveIndicatorsRepository.java
+0
-15
IndicatorsDefRepository.java
...ators/persistence/indicators/IndicatorsDefRepository.java
+0
-13
IndicatorsDimRepository.java
...ators/persistence/indicators/IndicatorsDimRepository.java
+0
-18
GeneralParmService.java
...ymobile/indicators/service/cmbkpi/GeneralParmService.java
+0
-19
IndAcsDataService.java
...eymobile/indicators/service/cmbkpi/IndAcsDataService.java
+0
-12
IndAcsDefService.java
...keymobile/indicators/service/cmbkpi/IndAcsDefService.java
+0
-78
IndAcsScoreInfoService.java
...ile/indicators/service/cmbkpi/IndAcsScoreInfoService.java
+0
-228
IndAnaDataService.java
...eymobile/indicators/service/cmbkpi/IndAnaDataService.java
+0
-12
IndAnaDefService.java
...keymobile/indicators/service/cmbkpi/IndAnaDefService.java
+0
-64
IndRelInfService.java
...keymobile/indicators/service/cmbkpi/IndRelInfService.java
+0
-12
BaseIndDataService.java
...bile/indicators/service/hytobacco/BaseIndDataService.java
+0
-1
BaseIndDefService.java
...obile/indicators/service/hytobacco/BaseIndDefService.java
+90
-0
BaseIndDefVersionService.java
...ndicators/service/hytobacco/BaseIndDefVersionService.java
+33
-0
DriveIndCatalogService.java
.../indicators/service/hytobacco/DriveIndCatalogService.java
+84
-0
DriveIndDefService.java
...bile/indicators/service/hytobacco/DriveIndDefService.java
+134
-0
DriveIndDefVersionService.java
...dicators/service/hytobacco/DriveIndDefVersionService.java
+33
-0
IndCatalogService.java
...obile/indicators/service/hytobacco/IndCatalogService.java
+83
-0
IndScorecardService.java
...ile/indicators/service/hytobacco/IndScorecardService.java
+22
-19
IndicatorsValueService.java
.../indicators/service/hytobacco/IndicatorsValueService.java
+0
-0
ScoreRuleService.java
...mobile/indicators/service/hytobacco/ScoreRuleService.java
+205
-0
DeriveIndicatorsService.java
...ndicators/service/indicators/DeriveIndicatorsService.java
+0
-231
IndicatorsExcelService.java
...indicators/service/indicators/IndicatorsExcelService.java
+0
-152
IndicatorsService.java
...bile/indicators/service/indicators/IndicatorsService.java
+0
-0
CalculateUtils.java
...n/java/com/keymobile/indicators/utils/CalculateUtils.java
+28
-14
BaseIndDefMapper.xml
src/main/resources/mybatis/mapping/BaseIndDefMapper.xml
+38
-0
DriveIndDefMapper.xml
src/main/resources/mybatis/mapping/DriveIndDefMapper.xml
+38
-0
GeneralParmMapper.xml
src/main/resources/mybatis/mapping/GeneralParmMapper.xml
+0
-8
IndAcsDataMapper.xml
src/main/resources/mybatis/mapping/IndAcsDataMapper.xml
+0
-6
IndAcsDefMapper.xml
src/main/resources/mybatis/mapping/IndAcsDefMapper.xml
+0
-30
IndAcsScoreInfoMapper.xml
src/main/resources/mybatis/mapping/IndAcsScoreInfoMapper.xml
+0
-6
IndAnaDataMapper.xml
src/main/resources/mybatis/mapping/IndAnaDataMapper.xml
+0
-6
IndAnaDefMapper.xml
src/main/resources/mybatis/mapping/IndAnaDefMapper.xml
+0
-26
IndRelInfMapper.xml
src/main/resources/mybatis/mapping/IndRelInfMapper.xml
+0
-6
No files found.
pom.xml
View file @
d7fe37f7
...
...
@@ -163,6 +163,11 @@
<scope>
test
</scope>
</dependency>
<!-- akka -->
<!-- gson -->
<dependency>
<groupId>
com.google.code.gson
</groupId>
<artifactId>
gson
</artifactId>
</dependency>
</dependencies>
<dependencyManagement>
<dependencies>
...
...
src/main/java/com/keymobile/indicators/akka/actor/DriveIndCalculateActor.java
View file @
d7fe37f7
...
...
@@ -19,11 +19,9 @@ import com.keymobile.indicators.akka.message.IndGetValueMsg;
import
com.keymobile.indicators.akka.message.IndValueMsg
;
import
com.keymobile.indicators.akka.message.specific.DriveIndAverageAndRankMsg
;
import
com.keymobile.indicators.model.entity.DriveIndCalResult
;
import
com.keymobile.indicators.model.entity.IndAcsDef
;
import
com.keymobile.indicators.model.entity.IndAcsScoreInfo
;
import
com.keymobile.indicators.service.cmbkpi.IndAcsDefService
;
import
com.keymobile.indicators.service.cmbkpi.IndAcsScoreInfoService
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDef
;
import
com.keymobile.indicators.service.hytobacco.DriveIndCalResultService
;
import
com.keymobile.indicators.service.hytobacco.DriveIndDefService
;
import
com.keymobile.indicators.utils.SpringUtil
;
import
akka.actor.AbstractActor
;
...
...
@@ -34,9 +32,7 @@ public class DriveIndCalculateActor extends AbstractActor{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
DriveIndCalculateActor
.
class
);
private
IndAcsDefService
indAcsDefService
=
SpringUtil
.
getBean
(
IndAcsDefService
.
class
);
private
IndAcsScoreInfoService
indAcsScoreInfoService
=
SpringUtil
.
getBean
(
IndAcsScoreInfoService
.
class
);
private
DriveIndDefService
driveIndDefService
=
SpringUtil
.
getBean
(
DriveIndDefService
.
class
);
private
DriveIndCalResultService
driveIndCalResultService
=
SpringUtil
.
getBean
(
DriveIndCalResultService
.
class
);
...
...
@@ -90,16 +86,14 @@ public class DriveIndCalculateActor extends AbstractActor{
List
<
String
>
indIdList
=
new
ArrayList
<>();
IndAcsDef
indAcsDef
=
indAcs
DefService
.
getById
(
driveIndId
);
unit
=
indAcsDef
.
getUnt
();
indType
=
indAcsDef
.
getIndType
();
markType
=
indAcsDef
.
getMarkType
();
DriveIndDef
driveIndDef
=
driveInd
DefService
.
getById
(
driveIndId
);
unit
=
driveIndDef
.
getIndUnit
();
//指标单位
indType
=
driveIndDef
.
getIndType
();
//指标类型:正向 反向
markType
=
driveIndDef
.
getIndCalScoreRule
();
//指标评分规则
List
<
IndAcsScoreInfo
>
acsSoreInfoList
=
indAcsScoreInfoService
.
getListByIndId
(
driveIndId
);
//获取考核指标的公式
driveIndFormula
=
acsSoreInfoList
.
get
(
0
).
getScoreFormula
();
averageDriveIndFormula
=
acsSoreInfoList
.
get
(
0
).
getScoreFormula
();
driveIndFormula
=
driveIndDef
.
getIndFormat
();
averageDriveIndFormula
=
driveIndDef
.
getIndFormat
();
Pattern
p
=
Pattern
.
compile
(
"(\\[[^\\]]*\\])"
);
Matcher
m
=
p
.
matcher
(
driveIndFormula
);
...
...
src/main/java/com/keymobile/indicators/akka/actor/specific/DriveIndCalculateRegionActor.java
View file @
d7fe37f7
...
...
@@ -12,8 +12,8 @@ import com.keymobile.indicators.akka.message.specific.DriveIndAverageAndRankMsg;
import
com.keymobile.indicators.akka.message.specific.DriveIndCalculateRegionMsg
;
import
com.keymobile.indicators.model.entity.DimValue
;
import
com.keymobile.indicators.model.entity.DriveIndCalResult
;
import
com.keymobile.indicators.service.cmbkpi.IndAcsScoreInfoService
;
import
com.keymobile.indicators.service.hytobacco.DriveIndCalResultService
;
import
com.keymobile.indicators.service.hytobacco.DriveIndDefService
;
import
com.keymobile.indicators.service.hytobacco.IndScorecardService
;
import
com.keymobile.indicators.utils.CalculateUtils
;
import
com.keymobile.indicators.utils.SpringUtil
;
...
...
@@ -28,7 +28,7 @@ public class DriveIndCalculateRegionActor extends AbstractActor{
private
IndScorecardService
indScorecardService
=
SpringUtil
.
getBean
(
IndScorecardService
.
class
);
private
IndAcsScoreInfoService
indAcsScoreInfoService
=
SpringUtil
.
getBean
(
IndAcsScoreInfo
Service
.
class
);
private
DriveIndDefService
driveIndDefService
=
SpringUtil
.
getBean
(
DriveIndDef
Service
.
class
);
private
int
numberOfConfirm
=
0
;
//定义返回确认消息的子actor
...
...
@@ -88,7 +88,7 @@ public class DriveIndCalculateRegionActor extends AbstractActor{
}
//算组内平均数
//String average = CalculateUtils.averageValue(values);
String
average
=
indAcsScoreInfo
Service
.
calGroupAverage
(
String
average
=
driveIndDef
Service
.
calGroupAverage
(
driveIndAverageAndRankMsg
.
getIndFormula
(),
compareObjs
,
driveIndAverageAndRankMsg
.
getDate
());
...
...
src/main/java/com/keymobile/indicators/api/cmbkpi/IndAcsDefCtrl.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
api
.
cmbkpi
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.keymobile.indicators.model.entity.IndAcsDef
;
import
com.keymobile.indicators.service.cmbkpi.IndAcsDefService
;
import
com.keymobile.indicators.utils.DateUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
@Api
(
tags
={
"考核指标接口"
})
@RestController
@RequestMapping
(
value
=
"/indAcs"
)
public
class
IndAcsDefCtrl
{
@Autowired
private
IndAcsDefService
indAcsDefService
;
@ApiOperation
(
value
=
"获取所有考核指标定义"
,
notes
=
"获取所有考核指标定义"
)
@PostMapping
(
value
=
"/getAll"
)
public
List
<
IndAcsDef
>
getAll
()
throws
Exception
{
return
indAcsDefService
.
getAll
();
}
@ApiOperation
(
value
=
"根据指标id(编码)获取分析指标"
,
notes
=
"根据指标id(编码)获取分析指标"
)
@PostMapping
(
value
=
"/getById"
)
public
IndAcsDef
getById
(
@RequestParam
(
"id"
)
String
id
){
return
indAcsDefService
.
getById
(
id
);
}
@ApiOperation
(
value
=
"保存或修改分析指标"
,
notes
=
"保存或修改分析指标"
)
@PostMapping
(
value
=
"/saveOrUpdate"
)
public
String
saveOrUpdate
(
@RequestBody
IndAcsDef
indAcsDef
,
@RequestParam
(
required
=
false
)
String
defTime
,
@RequestParam
(
required
=
false
)
String
updTime
)
throws
Exception
{
if
(
StringUtils
.
isNotBlank
(
defTime
))
{
Date
defDate
=
DateUtils
.
getDate
(
defTime
,
"yyyy-MM-dd HH:mm:ss"
);
indAcsDef
.
setDefTime
(
defDate
);
}
if
(
StringUtils
.
isNotBlank
(
updTime
))
{
Date
updDate
=
DateUtils
.
getDate
(
updTime
,
"yyyy-MM-dd HH:mm:ss"
);
indAcsDef
.
setUpdTime
(
updDate
);
}
return
indAcsDefService
.
saveOrUpdate
(
indAcsDef
);
}
@ApiOperation
(
value
=
"删除考核指标"
,
notes
=
"删除考核指标"
)
@PostMapping
(
value
=
"/delete"
)
public
void
delete
(
@RequestParam
String
indId
)
throws
Exception
{
indAcsDefService
.
delete
(
indId
);
}
@ApiOperation
(
value
=
"根据关键字分页获取考核指标列表(page:0 开始)"
,
notes
=
"根据关键字分页获取考核指标列表(page:0 开始)"
)
@PostMapping
(
value
=
"/getPageListByKeyword"
)
public
Map
<
String
,
Object
>
getPageListByKeyword
(
@RequestParam
(
required
=
false
)
String
keyword
,
@RequestParam
int
page
,
@RequestParam
int
rows
)
throws
Exception
{
return
indAcsDefService
.
getByPageAndKeyword
(
keyword
,
page
,
rows
);
}
}
src/main/java/com/keymobile/indicators/api/cmbkpi/IndAcsScoreInfoCtrl.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
api
.
cmbkpi
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.keymobile.indicators.model.entity.IndAcsScoreInfo
;
import
com.keymobile.indicators.model.entity.IndRelTree
;
import
com.keymobile.indicators.service.cmbkpi.IndAcsScoreInfoService
;
import
com.keymobile.indicators.utils.DateUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
@Api
(
tags
={
"考核指标计分信息接口"
})
@RestController
@RequestMapping
(
value
=
"/indAcsScore"
)
public
class
IndAcsScoreInfoCtrl
{
@Autowired
private
IndAcsScoreInfoService
indAscScoreService
;
@ApiOperation
(
value
=
"保存考核指标计分信息"
,
notes
=
"保存考核指标计分信息"
)
@PostMapping
(
value
=
"/save"
)
public
String
save
(
@RequestBody
IndAcsScoreInfo
indAcsScoreInfo
,
@RequestParam
String
updTime
)
throws
Exception
{
if
(
StringUtils
.
isNotBlank
(
updTime
))
{
Date
updDate
=
DateUtils
.
getDate
(
updTime
,
"yyyy-MM-dd HH:mm:ss"
);
indAcsScoreInfo
.
setUpdateTime
(
updDate
);
}
return
indAscScoreService
.
save
(
indAcsScoreInfo
);
}
@ApiOperation
(
value
=
"删除考核指标计分信息"
,
notes
=
"删除考核指标计分信息"
)
@PostMapping
(
value
=
"/delete"
)
public
void
delete
(
@RequestParam
String
orgId
,
@RequestParam
String
indId
,
@RequestParam
String
indAttrId
)
throws
Exception
{
indAscScoreService
.
delete
(
orgId
,
indId
,
indAttrId
);
}
@ApiOperation
(
value
=
"根据考核指标编号获取计分信息"
,
notes
=
"根据考核指标编号获取计分信息"
)
@PostMapping
(
value
=
"/getListByIndId"
)
public
List
<
IndAcsScoreInfo
>
getListByIndId
(
@RequestParam
String
indId
)
throws
Exception
{
return
indAscScoreService
.
getListByIndId
(
indId
);
}
@ApiOperation
(
value
=
"根据组织机构,指标id和指标类型获取考核指标计分信息"
,
notes
=
"根据组织机构,指标id和指标类型获取考核指标计分信息"
)
@PostMapping
(
value
=
"/selectOne"
)
public
IndAcsScoreInfo
selectOne
(
@RequestParam
String
orgId
,
@RequestParam
String
indId
,
@RequestParam
String
indAttrId
)
throws
Exception
{
return
indAscScoreService
.
selectOneByOrgIdAndIndidAndIndtype
(
orgId
,
indId
,
indAttrId
);
}
@ApiOperation
(
value
=
"根据关键字和类型获取考核指标或者分析指标(type:0 分析指标;1 考核指标)"
,
notes
=
"根据关键字和类型获取考核指标或者分析指标(type:0 分析指标;1 考核指标)"
)
@PostMapping
(
value
=
"/getIndByKeywordAndType"
)
public
List
<
Map
<
String
,
Object
>>
getIndByKeywordAndType
(
@RequestParam
(
required
=
false
)
String
keyword
,
@RequestParam
(
required
=
false
)
String
type
)
throws
Exception
{
return
indAscScoreService
.
getIndByKeywordAndType
(
keyword
,
type
);
}
@ApiOperation
(
value
=
"分析考核指标公式脑图"
,
notes
=
"分析考核指标公式脑图"
)
@PostMapping
(
value
=
"/analysisIndTree"
)
public
IndRelTree
analysisIndTree
(
@RequestParam
String
orgId
,
@RequestParam
String
indId
,
@RequestParam
String
indAttrId
)
throws
Exception
{
return
indAscScoreService
.
analysisIndTree
(
orgId
,
indId
,
indAttrId
);
}
}
src/main/java/com/keymobile/indicators/api/cmbkpi/IndAnaDefCtrl.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
api
.
cmbkpi
;
import
java.util.Date
;
import
java.util.Map
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.keymobile.indicators.model.entity.IndAnaDef
;
import
com.keymobile.indicators.service.cmbkpi.IndAnaDefService
;
import
com.keymobile.indicators.utils.DateUtils
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
@Api
(
tags
={
"分析指标接口"
})
@RestController
@RequestMapping
(
value
=
"/indAna"
)
public
class
IndAnaDefCtrl
{
@Autowired
private
IndAnaDefService
indAnaDefService
;
@ApiOperation
(
value
=
"保存或修改分析指标(defTime和updTime格式:yyyy-MM-dd HH:mm:ss)"
,
notes
=
"保存或修改分析指标(defTime和updTime格式:yyyy-MM-dd HH:mm:ss)"
)
@PostMapping
(
value
=
"/saveOrUpdate"
)
public
String
saveOrUpdate
(
@RequestBody
IndAnaDef
indAnaDef
,
@RequestParam
(
required
=
false
)
String
defTime
,
@RequestParam
(
required
=
false
)
String
updTime
)
throws
Exception
{
if
(
StringUtils
.
isNotBlank
(
defTime
))
{
Date
defDate
=
DateUtils
.
getDate
(
defTime
,
"yyyy-MM-dd HH:mm:ss"
);
indAnaDef
.
setDefTime
(
defDate
);
}
if
(
StringUtils
.
isNotBlank
(
updTime
))
{
Date
updDate
=
DateUtils
.
getDate
(
updTime
,
"yyyy-MM-dd HH:mm:ss"
);
indAnaDef
.
setUpdTime
(
updDate
);
}
return
indAnaDefService
.
saveOrUpdate
(
indAnaDef
);
}
@ApiOperation
(
value
=
"删除分析指标"
,
notes
=
"删除分析指标"
)
@PostMapping
(
value
=
"/delete"
)
public
void
delete
(
@RequestParam
String
indId
)
throws
Exception
{
indAnaDefService
.
delete
(
indId
);
}
@ApiOperation
(
value
=
"根据关键字分页获取分析指标列表(page:0 开始)"
,
notes
=
"根据关键字分页获取分析指标列表(page:0 开始)"
)
@PostMapping
(
value
=
"/getPageListByKeyword"
)
public
Map
<
String
,
Object
>
getPageListByKeyword
(
@RequestParam
(
required
=
false
)
String
keyword
,
@RequestParam
int
page
,
@RequestParam
int
rows
)
throws
Exception
{
return
indAnaDefService
.
getByPageAndKeyword
(
keyword
,
page
,
rows
);
}
}
src/main/java/com/keymobile/indicators/api/hytobacco/IndCatalogCtrl.java
0 → 100644
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
api
.
hytobacco
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndCatalog
;
import
com.keymobile.indicators.model.entity.indicators.IndCatalog
;
import
com.keymobile.indicators.service.hytobacco.DriveIndCatalogService
;
import
com.keymobile.indicators.service.hytobacco.IndCatalogService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
@Api
(
tags
={
"指标目录定义接口"
})
@RestController
@RequestMapping
(
value
=
"/indCatalog"
)
public
class
IndCatalogCtrl
{
@Autowired
private
IndCatalogService
indCatalogService
;
@Autowired
private
DriveIndCatalogService
driveIndCatalogService
;
@ApiOperation
(
value
=
"新建基础指标目录"
,
notes
=
"新建基础指标目录"
)
@PostMapping
(
value
=
"/createBaseIndCatalog"
)
public
String
createBaseIndCatalog
(
@RequestBody
IndCatalog
indCatalog
)
throws
Exception
{
indCatalog
=
indCatalogService
.
saveOrUpdate
(
indCatalog
);
return
indCatalog
.
getId
();
}
@ApiOperation
(
value
=
"批量级联删除基础指标目录"
,
notes
=
"批量级联删除基础指标目录"
)
@PostMapping
(
value
=
"/deleteBaseIndCatalog"
)
public
void
deleteBaseIndCatalog
(
@RequestParam
List
<
String
>
ids
)
throws
Exception
{
indCatalogService
.
recursionDelete
(
ids
);
}
@ApiOperation
(
value
=
"获取基础指标目录"
,
notes
=
"获取基础指标目录"
)
@PostMapping
(
value
=
"/getBaseIndCatalog"
)
public
List
<
IndCatalog
>
getBaseIndCatalog
(
@RequestParam
(
required
=
false
)
String
parentId
,
@RequestParam
List
<
String
>
codes
){
return
indCatalogService
.
getCatalog
(
parentId
,
codes
);
}
//考核指标目录
@ApiOperation
(
value
=
"新建考核指标目录"
,
notes
=
"新建考核指标目录"
)
@PostMapping
(
value
=
"/createDriveIndCatalog"
)
public
String
createDriveIndCatalog
(
@RequestBody
DriveIndCatalog
driveIndCatalog
)
throws
Exception
{
driveIndCatalog
=
driveIndCatalogService
.
saveOrUpdate
(
driveIndCatalog
);
return
driveIndCatalog
.
getId
();
}
@ApiOperation
(
value
=
"批量级联删除考核指标目录"
,
notes
=
"批量级联删除考核指标目录"
)
@PostMapping
(
value
=
"/deleteDriveIndCatalog"
)
public
void
deleteDriveIndCatalog
(
@RequestParam
List
<
String
>
ids
)
throws
Exception
{
driveIndCatalogService
.
recursionDelete
(
ids
);
}
@ApiOperation
(
value
=
"获取考核指标目录"
,
notes
=
"获取考核指标目录"
)
@PostMapping
(
value
=
"/getDriveIndCatalog"
)
public
List
<
DriveIndCatalog
>
getDriveIndCatalog
(
@RequestParam
(
required
=
false
)
String
parentId
,
@RequestParam
List
<
String
>
codes
){
return
driveIndCatalogService
.
getCatalog
(
parentId
,
codes
);
}
}
src/main/java/com/keymobile/indicators/api/hytobacco/IndScorecardCtrl.java
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
api
.
hytobacco
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -52,7 +51,7 @@ public class IndScorecardCtrl {
@PostMapping
(
value
=
"/calculateIndiScore"
)
public
Map
<
String
,
String
>
calculateIndiScore
(
@RequestParam
String
indId
,
@RequestParam
int
date
,
@RequestParam
String
compareObj
,
@RequestParam
String
indScorecardId
,
@RequestParam
String
compareId
,
@RequestBody
List
<
String
>
compareObjs
)
{
@RequestParam
String
compareId
,
@RequestBody
List
<
String
>
compareObjs
)
throws
Exception
{
return
indScorecardService
.
calculateIndiScore
(
indId
,
date
,
compareObj
,
indScorecardId
,
compareId
,
compareObjs
);
}
...
...
src/main/java/com/keymobile/indicators/api/hytobacco/IndicatorsDefCtrl.java
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
api
.
hytobacco
;
import
java.util.
Date
;
import
java.util.
Map
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
com.keymobile.indicators.model.entity.IndAcsDef
;
import
com.keymobile.indicators.model.entity.IndAcsScoreInfo
;
import
com.keymobile.indicators.model.entity.IndAnaDef
;
import
com.keymobile.indicators.service.cmbkpi.IndAcsDefService
;
import
com.keymobile.indicators.service.cmbkpi.IndAcsScoreInfoService
;
import
com.keymobile.indicators.service.cmbkpi.IndAnaDefService
;
import
com.keymobile.indicators.model.entity.indicators.BaseIndDef
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDef
;
import
com.keymobile.indicators.service.hytobacco.BaseIndDefService
;
import
com.keymobile.indicators.service.hytobacco.DriveIndCalResultService
;
import
com.keymobile.indicators.service.hytobacco.DriveIndDefService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -26,55 +24,52 @@ import io.swagger.annotations.ApiOperation;
public
class
IndicatorsDefCtrl
{
@Autowired
private
IndAnaDefService
indAna
DefService
;
private
BaseIndDefService
baseInd
DefService
;
@Autowired
private
IndAcsDefService
indAcsDefService
;
@Autowired
private
IndAcsScoreInfoService
indAscScoreService
;
private
DriveIndDefService
driveIndDefService
;
@Autowired
private
DriveIndCalResultService
driveIndCalResultService
;
@ApiOperation
(
value
=
"新建基础指标"
,
notes
=
"新建基础指标"
)
@PostMapping
(
value
=
"/createAnaInd"
)
public
void
createAnaInd
(
@RequestParam
String
indId
,
@RequestParam
String
indName
,
@RequestParam
(
required
=
false
)
String
unt
)
throws
Exception
{
IndAnaDef
indAnaDef
=
new
IndAnaDef
();
indAnaDef
.
setIndId
(
indId
);
indAnaDef
.
setIndName
(
indName
);
indAnaDef
.
setUnt
(
unt
);
indAnaDef
.
setDefTime
(
new
Date
());
indAnaDef
.
setUpdTime
(
new
Date
());
indAnaDef
.
setDefStaTime
(
202004
);
indAnaDef
.
setDefEndTime
(
999904
);
indAnaDefService
.
saveOrUpdate
(
indAnaDef
);
@PostMapping
(
value
=
"/createBaseInd"
)
public
void
createBaseInd
(
@RequestBody
BaseIndDef
baseIndDef
,
@RequestParam
String
catalogId
,
@RequestParam
String
catalogIdPath
,
@RequestParam
String
user
)
throws
Exception
{
baseIndDefService
.
saveOrUpdate
(
baseIndDef
,
catalogId
,
catalogIdPath
,
user
);
}
@ApiOperation
(
value
=
"删除基础指标"
,
notes
=
"删除基础指标"
)
@PostMapping
(
value
=
"/deleteBaseInd"
)
public
void
deleteBaseInd
(
@RequestParam
String
indId
)
throws
Exception
{
baseIndDefService
.
delete
(
indId
);
}
@ApiOperation
(
value
=
"根据关键字查询基础指标"
,
notes
=
"根据关键字查询基础指标"
)
@PostMapping
(
value
=
"/getByPageAndKeyword"
)
public
Map
<
String
,
Object
>
getByPageAndKeyword
(
@RequestParam
String
catalogId
,
@RequestParam
(
required
=
false
)
String
keyword
,
@RequestParam
(
defaultValue
=
"0"
)
int
page
,
@RequestParam
(
defaultValue
=
"10"
)
int
rows
)
throws
Exception
{
return
baseIndDefService
.
getByPageAndKeyword
(
catalogId
,
keyword
,
page
,
rows
);
}
@ApiOperation
(
value
=
"新建考核指标"
,
notes
=
"新建考核指标"
)
@PostMapping
(
value
=
"/createAcsInd"
)
public
void
createAcsInd
(
@RequestParam
String
indId
,
@RequestParam
String
indName
,
@RequestParam
(
required
=
false
)
String
unt
,
@RequestParam
(
required
=
false
)
String
indType
,
@RequestParam
String
formula
)
throws
Exception
{
IndAcsDef
indAcsDef
=
new
IndAcsDef
();
indAcsDef
.
setIndId
(
indId
);
indAcsDef
.
setIndName
(
indName
);
indAcsDef
.
setUnt
(
unt
);
if
(
StringUtils
.
isNotBlank
(
indType
))
{
indAcsDef
.
setIndType
(
indType
);
//0:正向 1:反向
}
indAcsDef
.
setWeight
(
1.0
);
indAcsDef
.
setDefTime
(
new
Date
());
indAcsDef
.
setUpdTime
(
new
Date
());
indAcsDefService
.
saveOrUpdate
(
indAcsDef
);
IndAcsScoreInfo
indAcsScoreInfo
=
new
IndAcsScoreInfo
();
indAcsScoreInfo
.
setAppraisalsDate
(
202004
);
indAcsScoreInfo
.
setIndexId
(
indId
);
indAcsScoreInfo
.
setScoreFormula
(
formula
);
indAcsScoreInfo
.
setWeight
(
1.0
);
indAcsScoreInfo
.
setUpdateTime
(
new
Date
());
indAscScoreService
.
save
(
indAcsScoreInfo
);
@PostMapping
(
value
=
"/createDriveInd"
)
public
void
createDriveInd
(
@RequestBody
DriveIndDef
driveIndDef
,
@RequestParam
String
catalogId
,
@RequestParam
String
catalogIdPath
,
@RequestParam
String
user
)
throws
Exception
{
driveIndDefService
.
saveOrUpdate
(
driveIndDef
,
catalogId
,
catalogIdPath
,
user
);
}
@ApiOperation
(
value
=
"删除考核指标"
,
notes
=
"删除考核指标"
)
@PostMapping
(
value
=
"/deleteDriveInd"
)
public
void
deleteDriveInd
(
@RequestParam
String
indId
)
throws
Exception
{
driveIndDefService
.
delete
(
indId
);
}
@ApiOperation
(
value
=
"根据关键字查询考核指标"
,
notes
=
"根据关键字查询考核指标"
)
@PostMapping
(
value
=
"/getDriveByPageAndKeyword"
)
public
Map
<
String
,
Object
>
getDriveByPageAndKeyword
(
@RequestParam
String
catalogId
,
@RequestParam
(
required
=
false
)
String
keyword
,
@RequestParam
(
defaultValue
=
"0"
)
int
page
,
@RequestParam
(
defaultValue
=
"10"
)
int
rows
)
throws
Exception
{
return
driveIndDefService
.
getByPageAndKeyword
(
catalogId
,
keyword
,
page
,
rows
);
}
@ApiOperation
(
value
=
"对标计算"
,
notes
=
"对标计算"
)
...
...
src/main/java/com/keymobile/indicators/api/hytobacco/IndicatorsValueCtrl.java
View file @
d7fe37f7
...
...
@@ -91,4 +91,19 @@ public class IndicatorsValueCtrl {
@RequestParam
String
dateString
)
throws
Exception
{
indicatorsValueService
.
fillExcelFileSix
(
indIds
,
dateString
);
}
@ApiOperation
(
value
=
"填充excel file7数据"
,
notes
=
"填充excel file7数据"
)
@PostMapping
(
value
=
"/fillExcelFileSeven"
)
public
void
fillExcelFileSeven
(
@RequestBody
List
<
String
>
indIds
,
@RequestParam
int
date
,
@RequestParam
String
compareObjString
,
@RequestParam
int
groupNum
,
@RequestParam
int
type
)
throws
Exception
{
indicatorsValueService
.
fillExcelXianJuanYanGroup
(
indIds
,
date
,
compareObjString
,
groupNum
,
type
);
}
@ApiOperation
(
value
=
"填充excel file10数据"
,
notes
=
"填充excel file10数据"
)
@PostMapping
(
value
=
"/fillExcelFileTen"
)
public
void
fillExcelXianScore
(
@RequestBody
List
<
String
>
indIds
,
@RequestParam
int
date
,
@RequestParam
String
compareObjString
,
@RequestParam
int
groupNum
,
@RequestParam
int
type
)
throws
Exception
{
indicatorsValueService
.
fillExcelXianScore
(
indIds
,
date
,
compareObjString
,
groupNum
,
type
);
}
}
src/main/java/com/keymobile/indicators/api/indicators/DeriveIndicatorsCtrl.java
deleted
100644 → 0
View file @
8495a010
//package com.keymobile.indicators.api.indicators;
//
//import java.util.List;
//import java.util.Map;
//
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.RestController;
//
//import com.keymobile.indicators.model.indicators.DeriveIndicators;
//import com.keymobile.indicators.service.indicators.DeriveIndicatorsService;
//
//import io.swagger.annotations.ApiOperation;
//
//@RestController
//@RequestMapping(value = "/deriveIndicatorsCtrl")
//public class DeriveIndicatorsCtrl {
//
// @Autowired
// private DeriveIndicatorsService derIndecatorsService;
//
// @ApiOperation(value = "新增/修改衍生指标", notes = "新增/修改衍生指标")
// @PostMapping(value = "/saveOrUpdateDerIndi")
// public String saveOrUpdateDerIndicators(@RequestParam String operator,
// @RequestBody DeriveIndicators derIndicators) throws Exception{
// return derIndecatorsService.saveOrUpdate(derIndicators, operator);
// }
//
// @ApiOperation(value = "删除衍生指标", notes = "删除衍生指标")
// @PostMapping(value = "/deleteDerIndicators")
// public void deleteDerIndicators(@RequestParam String derIndiId) throws Exception{
// derIndecatorsService.delete(derIndiId);
// }
//
// @ApiOperation(value = "获取衍生指标列表", notes = "获取衍生指标列表")
// @PostMapping(value = "/getDerIndicatorsList")
// public List<DeriveIndicators> getDerIndicatorsList(@RequestParam(required=false) String keyword)throws Exception{
// return derIndecatorsService.getDerIndicatorsList(keyword);
// }
//
// @ApiOperation(value = "获取衍生指标详情", notes = "获取衍生指标详情")
// @PostMapping(value = "/getDerIndicatorsDetial")
// public DeriveIndicators getDerIndicatorsDetail(@RequestParam String id) throws Exception{
// return derIndecatorsService.getDerIndicatorsDetail(id);
// }
//
// @ApiOperation(value = "获取衍生指标关联的原生指标共同的维度", notes = "获取衍生指标关联的原生指标共同的维度")
// @PostMapping(value = "/getSameDim")
// public List<String> getSameDim(@RequestParam String indiDefIdString) throws Exception{
// return derIndecatorsService.getSameDim(indiDefIdString);
// }
//
// @ApiOperation(value = "计算衍生指标的值", notes = "计算衍生指标的值")
// @PostMapping(value = "/calculate")
// public double calculateDeriveIndicators(@RequestParam String derIndiId,
// @RequestBody Map<String,Object> dimValues) throws Exception{
// return derIndecatorsService.calculateDeriveIndicators(derIndiId, dimValues);
// }
//
// @ApiOperation(value = "对标单元获取指标报表", notes = "对标单元获取指标报表")
// @PostMapping(value = "/getIndicatorsReport")
// public Map<String,Object> getIndicatorsReport(@RequestParam String StandardUnitId,
// @RequestParam String compareIndiIds,
// @RequestBody List<String> compareDims,@RequestParam String year)throws Exception{
// return derIndecatorsService.getIndicatorsReport(StandardUnitId, compareIndiIds, compareDims, year);
// }
//}
src/main/java/com/keymobile/indicators/api/indicators/IndicatorsCtrl.java
deleted
100644 → 0
View file @
8495a010
//package com.keymobile.indicators.api.indicators;
//
//import java.io.InputStream;
//import java.util.List;
//import java.util.Map;
//
//import org.apache.poi.xssf.usermodel.XSSFWorkbook;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestBody;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.RestController;
//import org.springframework.web.multipart.MultipartFile;
//
//import com.keymobile.indicators.model.indicators.IndicatorsDef;
//import com.keymobile.indicators.model.indicators.IndicatorsDim;
//import com.keymobile.indicators.service.indicators.IndicatorsService;
//
//import io.swagger.annotations.ApiOperation;
//
//@RestController
//@RequestMapping(value = "/indicatorsCtrl")
//public class IndicatorsCtrl {
//
// @Autowired
// private IndicatorsService indicatorsService;
//
// @ApiOperation(value = "新增/修改指标", notes = "新增/修改指标")
// @PostMapping(value = "/saveOrUpdateIndiDef")
// public String saveOrUpdateIndicators(
// @RequestBody IndicatorsDef indiDef,
// @RequestParam String operator)throws Exception{
// return indicatorsService.saveOrUpdateIndiDef(indiDef,operator);
// }
//
// @ApiOperation(value = "新增/修改维度(isUpdate:false(新增) true(修改))", notes = "新增/修改维度")
// @PostMapping(value = "/saveOrUpdateIndiDim")
// public String saveOrUpdateDim(@RequestBody List<IndicatorsDim> indiDims,
// @RequestParam String indiDefId,
// @RequestParam String operator,
// @RequestParam String isUpdate) throws Exception{
// return indicatorsService.saveOrUpdateDim(indiDefId, indiDims, operator, isUpdate);
// }
//
// @ApiOperation(value = "判断原生指标能否修改 true:能 false:不能", notes = "判断原生指标能否修改 true:能 false:不能")
// @PostMapping(value = "/canBeUpdate")
// public boolean canBeUpdate(@RequestParam String indicatorsId) throws Exception{
// return indicatorsService.canBeUpdate(indicatorsId);
// }
//
// @ApiOperation(value = "删除指标", notes = "删除指标")
// @PostMapping(value = "/deleteIndicators")
// public String delete(@RequestParam String indicatorsId)throws Exception{
// return indicatorsService.delete(indicatorsId);
// }
//
// @ApiOperation(value = "获取指标列表", notes = "获取指标列表")
// @PostMapping(value = "/getIndiDefList")
// public List<IndicatorsDef> getIndiDefList(@RequestParam(required=false) String keyword)throws Exception{
// return indicatorsService.getIndicatorsDefList(keyword);
// }
//
// @ApiOperation(value = "获取指标详情", notes = "获取指标详情")
// @PostMapping(value = "/getIndiDefDetail")
// public Map<String,Object> getIndiDefDetail(@RequestParam String indiDefId)throws Exception{
// return indicatorsService.getIndicatorsDefDetail(indiDefId);
// }
//
// @ApiOperation(value = "获取上传文件表头", notes = "获取上传文件表头")
// @PostMapping(value = "/getUploadExcelHead")
// public List<Map<String,Object>> getUploadExcelHead(
// @RequestParam("file") MultipartFile file)throws Exception{
// try (InputStream is = file.getInputStream()){
// XSSFWorkbook xssfWorkbook = new XSSFWorkbook(is);
// return indicatorsService.getUploadExcelHead(xssfWorkbook);
// }
// }
//
// @ApiOperation(value = "判断上传文件表头和指标映射字段是否符合", notes = "判断上传文件表头和指标映射字段是否符合")
// @PostMapping(value = "/isCorrespondence")
// public String isCorrespondence(@RequestParam String indiDefId,
// @RequestParam("file") MultipartFile file)throws Exception{
// try (InputStream is = file.getInputStream()){
// XSSFWorkbook xssfWorkbook = new XSSFWorkbook(is);
// return indicatorsService.isCorrespondence(indiDefId, xssfWorkbook);
// }
// }
//
// @ApiOperation(value = "上传解析指标数据", notes = "上传解析指标数据")
// @PostMapping(value = "/importIndiData")
// public String importIndicatorsData(@RequestParam String indiDefId,
// @RequestParam("file") MultipartFile file)throws Exception{
// try (InputStream is = file.getInputStream()){
// XSSFWorkbook xssfWorkbook = new XSSFWorkbook(is);
// return indicatorsService.importIndicatorsData(indiDefId, xssfWorkbook);
// }
// }
//
// @ApiOperation(value = "查询指标值", notes = "查询指标值")
// @PostMapping(value = "/queryIndiValue")
// public Map<String,Object> queryIndicatorsValue(@RequestParam String indiDefId,
// @RequestBody Map<String,Object> dimValue)throws Exception{
// return indicatorsService.queryIndicatorsValue(indiDefId, dimValue,false);
// }
//
// @ApiOperation(value = "获取未审批指标值", notes = "获取未审批指标值")
// @PostMapping(value = "/getUnApplyIndiValue")
// public Map<String,Object> getUnApplyIndiValue() throws Exception{
// return indicatorsService.getUnApplyIndiValueList();
// }
//
// @ApiOperation(value = "审批指标值", notes = "审批指标值")
// @PostMapping(value = "/applyIndiValue")
// public void applyIndicatorsValue(@RequestBody List<String> indiValueId) throws Exception{
// indicatorsService.applyIndicatorsValue(indiValueId);
// }
//
//}
src/main/java/com/keymobile/indicators/model/entity/GeneralParm.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
model
.
entity
;
import
java.util.Date
;
import
javax.persistence.Table
;
import
lombok.Data
;
/**
* author:zhangkb time:2020-4-15 desc:系统通用参数表
*/
@Data
@Table
(
name
=
"gen_general_parm"
)
public
class
GeneralParm
{
private
String
rootParmId
;
//根参数ID
private
String
prnParmId
;
//父参数ID
private
String
subParmId
;
//子参数ID
private
String
parmNm
;
//参数名
private
String
cmt
;
//备注
private
String
updUserId
;
//更新人用户编号
private
Date
updTime
;
//更新时间
}
src/main/java/com/keymobile/indicators/model/entity/IndAcsData.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
model
.
entity
;
import
javax.persistence.Table
;
import
lombok.Data
;
/**
* author:zhangkb time:2020-4-15 desc:考核指标数据表
*/
@Data
@Table
(
name
=
"ind_acs_ind_data_stat"
)
public
class
IndAcsData
{
private
String
dwStatDt
;
//统计日期
private
Integer
statMonId
;
//统计月份
private
String
orgId
;
//机构编号
private
String
indId
;
//指标编号
private
String
indName
;
//指标名称
private
String
indType
;
//指标类型
private
Double
statVal
;
//统计值
}
src/main/java/com/keymobile/indicators/model/entity/IndAcsDef.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
model
.
entity
;
import
lombok.Data
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.util.Date
;
/**
* author:zhangkb time:2020-4-15 desc:考核指标定义表
*/
@Table
(
name
=
"ind_acs_ind_def_inf"
)
@Data
public
class
IndAcsDef
{
@Id
private
String
indId
;
//指标编号
private
String
indName
;
//指标名称
private
String
indTypeCd
;
//指标类型代码1 纯系统直接出数2 系统+手工3 纯手工上传4.系统衍生(从关系类)
private
String
indType
;
//指标类型1 纯系统直接出数2 系统+手工3 纯手工上传4.系统衍生(从关系类)
private
String
acsSysCd
;
//考核体系代码
private
String
acsSysName
;
//考核体系
private
String
acsDimCd
;
//考核维度代码
private
String
acsDimName
;
//考核维度
private
String
undType
;
//单位类型
private
String
unt
;
//单位
private
String
markTypeCd
;
//计分类型代码
private
String
markType
;
//计分类型
private
String
freqCd
;
//频率代码
private
String
freqName
;
//频率名称
private
Double
weight
;
//权重
private
String
cltCmt
;
//口径说明(汉字描述)
private
String
markRule
;
//计分规则(汉字描述)
private
String
dataSrc
;
//数据来源
private
String
dataHbr
;
//数据粒度
private
String
isValid
;
//是否有效
private
String
defUserId
;
//定义人用户编号
private
Date
defTime
;
//定义时间
private
String
updUserId
;
//更新人用户编号
private
Date
updTime
;
//更新时间
}
src/main/java/com/keymobile/indicators/model/entity/IndAcsScoreInfo.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
model
.
entity
;
import
java.util.Date
;
import
javax.persistence.Table
;
import
lombok.Data
;
/**
* author:zhangkb time:2020-4-15 desc:考核指标计分信息表
*/
@Data
@Table
(
name
=
"indsch_kpi_score_info"
)
public
class
IndAcsScoreInfo
{
private
Integer
appraisalsDate
;
//考核月份
private
String
orgId
;
//机构编号
private
String
orgName
;
//机构名称
private
String
indexId
;
//考核指标编号
private
String
indexAttrId
;
//指标属性编号001 目标002 市场003 实际值004 参考值…
private
String
scoreMode
;
//计分方式
private
String
scoreFormula
;
//计分公式
private
Double
weight
;
// double comment "权重"
private
String
isValid
;
//是否有效Y N
private
String
updateUserId
;
//更新人id
private
String
updateUserName
;
//更新人姓名
private
Date
updateTime
;
//更新时间
}
src/main/java/com/keymobile/indicators/model/entity/IndAnaData.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
model
.
entity
;
import
java.util.Date
;
import
javax.persistence.Table
;
import
lombok.Data
;
/**
* author:zhangkb time:2020-4-15 desc:分析指标数据表
*/
@Data
@Table
(
name
=
"ind_ana_ind_data_stat"
)
public
class
IndAnaData
{
private
Date
dwStatDt
;
//统计日期
private
Integer
statMonId
;
//统计月份
private
String
indId
;
//指标编号
private
String
indType
;
//指标类型
private
String
indName
;
//指标名称
private
String
orgId
;
//机构编号
private
Double
statVal
;
//统计值
}
src/main/java/com/keymobile/indicators/model/entity/IndAnaDef.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
model
.
entity
;
import
java.util.Date
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
lombok.Data
;
/**
* author:zhangkb time:2020-4-15 desc:分析指标定义表
*/
@Data
@Table
(
name
=
"ind_ana_ind_def_inf"
)
public
class
IndAnaDef
{
@Id
private
String
indId
;
//指标编号
private
String
indName
;
//指标名称
private
String
indTypeCd
;
//指标类型代码
private
String
indType
;
//指标类型
private
String
cltCmt
;
//口径说明(汉字描述)
private
String
undType
;
//单位类型
private
String
unt
;
//单位
private
String
dataHbr
;
//数据粒度
private
String
isValid
;
//是否有效
private
String
defUserId
;
//定义人用户编号
private
Date
defTime
;
//定义时间
private
String
updUserId
;
//更新人用户编号
private
Date
updTime
;
//更新时间
private
Integer
defStaTime
;
//生效开始年月
private
Integer
defEndTime
;
//生效结束年月
private
String
srcTypCd
;
//来源类型
}
src/main/java/com/keymobile/indicators/model/entity/IndRelInf.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
model
.
entity
;
import
javax.persistence.Table
;
import
lombok.Data
;
/**
* author:zhangkb time:2020-4-15 desc:指标层级关系表
*/
@Data
@Table
(
name
=
"ind_index_hbr_rel_inf"
)
public
class
IndRelInf
{
private
Integer
relId
;
//关系id
private
String
subIndId
;
//子指标编号
private
String
subIndName
;
//子指标名称
private
String
subIndType
;
//子指标类型
private
String
parIndId
;
//父指标编号
private
String
parIndName
;
//父指标名称
private
String
parIndType
;
//父指标类型
private
Integer
relHbr
;
//关系层级
}
src/main/java/com/keymobile/indicators/model/entity/IndRelTree.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
model
.
entity
;
import
java.util.ArrayList
;
import
java.util.List
;
import
lombok.Data
;
@Data
public
class
IndRelTree
{
private
Double
weight
;
private
String
indId
;
private
String
indName
;
private
String
indAttrId
;
private
String
type
;
private
List
<
IndRelTree
>
children
=
new
ArrayList
<>();
}
src/main/java/com/keymobile/indicators/model/entity/indicators/BaseIndDef.java
0 → 100644
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
import
java.util.Date
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
lombok.Data
;
/**
* author:zhangkb time:2020-5-20 desc:基础项指标
*/
@Data
@Table
(
name
=
"base_ind_def"
)
public
class
BaseIndDef
{
@Id
private
String
indId
;
//数据项编码
private
String
indName
;
//数据项名称
private
String
indLevel
;
//数据项级别
private
String
indType
;
//数据项类别
private
String
indDept
;
//数据项归属部门
private
String
indUnit
;
//数据项单位
private
String
indDesc
;
//说明
private
String
indSource
;
//数据项来源
private
String
indFrequency
;
//数据源频度
private
String
creater
;
private
Date
createTime
;
private
String
updater
;
private
Date
updateTime
;
private
Integer
defStaTime
;
private
Integer
defEndTime
;
private
String
version
;
//版本号
private
String
catalogId
;
//挂靠目录id
private
String
catalogIdPath
;
//挂靠目录idPath,方便用目录类别找到对应的挂靠指标
}
src/main/java/com/keymobile/indicators/model/entity/indicators/BaseIndDefVersionData.java
0 → 100644
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
import
java.io.Serializable
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
lombok.Data
;
/**
*author:zhangkb time:2020-5-20 desc:基础项数据版本数据
*/
@Data
@Document
(
collection
=
"base_ind_def_version_data"
)
public
class
BaseIndDefVersionData
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
private
String
id
;
private
String
indId
;
private
String
indName
;
private
String
version
;
private
String
dataJson
;
}
src/main/java/com/keymobile/indicators/model/entity/indicators/DriveIndCatalog.java
0 → 100644
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
import
java.io.Serializable
;
import
java.util.Date
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
com.keymobile.indicators.utils.DateUtils
;
import
lombok.Data
;
/**
*author:zhangkb time:2020-5-18 desc:考核指标目录
*/
@Data
@Document
(
collection
=
"drive_ind_catalog"
)
public
class
DriveIndCatalog
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
private
String
id
;
private
String
catalogName
;
//private String type;
private
String
catalogType
;
//分为数据项级别和数据项类别 0:数据项级别 1:数据项类别 2:普通目录
private
String
parentId
;
//顶层节点parentId为0
private
String
idPath
;
private
String
code
;
//目录编码
private
String
lastUpdater
;
private
String
lastUpdateTime
=
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
);
}
src/main/java/com/keymobile/indicators/model/entity/indicators/DriveIndDef.java
0 → 100644
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
import
java.util.Date
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
lombok.Data
;
/**
* author:zhangkb time:2020-5-21 desc:考核指标
*/
@Data
@Table
(
name
=
"drive_ind_def"
)
public
class
DriveIndDef
{
@Id
private
String
indId
;
//指标编码
private
String
indName
;
//指标名称
private
String
indLevel
;
//指标级别
private
String
indType
;
//指标类别
private
String
indDept
;
//指标归属部门
private
String
indUnit
;
//指标单位
private
String
indDesc
;
//说明
private
String
indFormat
;
//指标公式
private
String
indFormatDesc
;
//指标公式描述
private
String
isCalScore
;
//是否计分 是:1 否:0
private
String
indRule
;
//指标正负属性:正向指标0 反向指标1
private
String
indCalScoreRule
;
//计分规则
private
String
indCalScoreRuleDesc
;
//计分规则描述
private
String
isUnitCalScore
;
//是否参与单位得分计算 是:1 否:0
private
String
indFrequency
;
//指标频度
private
String
version
;
//版本号
private
String
catalogId
;
//挂靠目录id
private
String
catalogIdPath
;
//挂靠目录idPath,方便用目录类别找到对应的挂靠指标
private
String
indShortboardRule
;
//短板规则
private
String
indShortboardRuleDesc
;
//短板规则描述
private
String
creater
;
private
Date
createTime
;
private
String
updater
;
private
Date
updateTime
;
private
Integer
defStaTime
;
private
Integer
defEndTime
;
}
src/main/java/com/keymobile/indicators/model/entity/indicators/DriveIndDefVersionData.java
0 → 100644
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
import
java.io.Serializable
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
lombok.Data
;
/**
*author:zhangkb time:2020-5-21 desc:考核指标数据版本数据
*/
@Data
@Document
(
collection
=
"drive_ind_def_version_data"
)
public
class
DriveIndDefVersionData
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
private
String
id
;
private
String
indId
;
private
String
indName
;
private
String
version
;
private
String
dataJson
;
}
src/main/java/com/keymobile/indicators/model/entity/indicators/IndCatalog.java
0 → 100644
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
indicators
;
import
java.io.Serializable
;
import
java.util.Date
;
import
java.util.List
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
com.keymobile.indicators.utils.DateUtils
;
import
lombok.Data
;
/**
*author:zhangkb time:2020-5-18 desc:基础项目录
*/
@Data
@Document
(
collection
=
"ind_catalog"
)
public
class
IndCatalog
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
private
String
id
;
private
String
catalogName
;
//private String type;
private
String
catalogType
;
//分为数据项级别和数据项类别 0:数据项级别 1:数据项类别 2:普通目录
private
String
parentId
;
//顶层节点parentId为0
private
String
idPath
;
private
String
code
;
//目录编码
private
String
lastUpdater
;
private
String
lastUpdateTime
=
DateUtils
.
formatDate
(
new
Date
(),
"yyyy-MM-dd HH:mm:ss"
);
}
src/main/java/com/keymobile/indicators/model/entity/objscorerule/IndTypeWeight.java
0 → 100644
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
objscorerule
;
import
java.io.Serializable
;
import
lombok.Data
;
/**
* author:zhangkb time:2020-6-2 desc:指标类型权重
*/
@Data
public
class
IndTypeWeight
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
private
String
catalogIdPath
;
private
String
weight
;
//权重,百分比形式(例如:10 代表 10%)
private
int
index
;
}
src/main/java/com/keymobile/indicators/model/entity/objscorerule/ScoreRule.java
0 → 100644
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
model
.
entity
.
objscorerule
;
import
java.io.Serializable
;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.mongodb.core.mapping.Document
;
import
lombok.Data
;
/**
*author:zhangkb time:2020-6-2 desc:单位评分规则实体
*/
@Data
@Document
(
collection
=
"obj_score_rule"
)
public
class
ScoreRule
implements
Serializable
{
/**
*
*/
private
static
final
long
serialVersionUID
=
1L
;
@Id
private
String
id
;
private
String
ruleName
;
//规则名称
private
String
scoreType
;
//得分类型:0 指标值直接参与计算 1 指标得分分数参与计算(综合评分和改善提升分开算) 2指标得分分数参与计算(指标分数=综合+改善)
private
String
calType
;
//计算类型:0 计算组内所有考核指标平均数 1 根据目录类别分类算平均分后根据权重计算考核指标
private
List
<
IndTypeWeight
>
indTypeWeights
=
new
ArrayList
<>();
//目录类别权重数据
private
String
code
;
//标识编码
public
List
<
IndTypeWeight
>
getIndTypeWeights
(){
return
indTypeWeights
;
}
public
void
setIndTypeWeights
(
List
<
IndTypeWeight
>
indTypeWeights
){
this
.
indTypeWeights
.
addAll
(
indTypeWeights
);
}
}
src/main/java/com/keymobile/indicators/model/entity/scorecard/IndScorecard.java
View file @
d7fe37f7
...
...
@@ -39,6 +39,7 @@ public class IndScorecard implements Serializable{
private
double
worstIndScore
;
//最差指标分
private
String
otherCalFormula
;
//其他计算公式
//改善提升
private
String
isIncluScore
;
//是否纳入单位计分 0:不纳入 1:纳入
private
double
limitScore
;
//上限分数
private
List
<
ImproveScoreDef
>
improveScoreItem
=
new
ArrayList
<>();
//改善提升分数
...
...
src/main/java/com/keymobile/indicators/model/indicators/DeriveIndicators.java
deleted
100644 → 0
View file @
8495a010
//package com.keymobile.indicators.model.indicators;
//
//import java.io.Serializable;
//import java.util.Date;
//
//import org.springframework.data.annotation.Id;
//import org.springframework.data.mongodb.core.mapping.Document;
//
//import com.fasterxml.jackson.annotation.JsonFormat;
//
///**
// * 衍生指标
// */
//@Document(collection="indi_derive")
//public class DeriveIndicators implements Serializable{
// /**
// *
// */
// private static final long serialVersionUID = 1L;
//
// @Id
// private String id;
// private String derName;
// private String derCnName;
// private String derUnit;//计算单位
// private String derFormula;
// private String indiDefIds;
// private String dimNames;
// private String derFormulaDesc;//公式中文描述
//
// private String status;
//
// @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
// private Date createTime;
// @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
// private Date updateTime;
//
// private String creator;
// private String updator;
//
// public String getId() {
// return id;
// }
// public void setId(String id) {
// this.id = id;
// }
// public String getDerName() {
// return derName;
// }
// public void setDerName(String derName) {
// this.derName = derName;
// }
// public String getDerCnName() {
// return derCnName;
// }
// public void setDerCnName(String derCnName) {
// this.derCnName = derCnName;
// }
// public String getDerUnit() {
// return derUnit;
// }
// public void setDerUnit(String derUnit) {
// this.derUnit = derUnit;
// }
// public String getDerFormula() {
// return derFormula;
// }
// public void setDerFormula(String derFormula) {
// this.derFormula = derFormula;
// }
// public String getIndiDefIds() {
// return indiDefIds;
// }
// public void setIndiDefIds(String indiDefIds) {
// this.indiDefIds = indiDefIds;
// }
// public String getDimNames() {
// return dimNames;
// }
// public void setDimNames(String dimNames) {
// this.dimNames = dimNames;
// }
// public String getDerFormulaDesc() {
// return derFormulaDesc;
// }
// public void setDerFormulaDesc(String derFormulaDesc) {
// this.derFormulaDesc = derFormulaDesc;
// }
// public String getStatus() {
// return status;
// }
// public void setStatus(String status) {
// this.status = status;
// }
// public Date getCreateTime() {
// return createTime;
// }
// public void setCreateTime(Date createTime) {
// this.createTime = createTime;
// }
// public Date getUpdateTime() {
// return updateTime;
// }
// public void setUpdateTime(Date updateTime) {
// this.updateTime = updateTime;
// }
// public String getCreator() {
// return creator;
// }
// public void setCreator(String creator) {
// this.creator = creator;
// }
// public String getUpdator() {
// return updator;
// }
// public void setUpdator(String updator) {
// this.updator = updator;
// }
//}
src/main/java/com/keymobile/indicators/model/indicators/IndicatorsDef.java
deleted
100644 → 0
View file @
8495a010
//package com.keymobile.indicators.model.indicators;
//
//import java.io.Serializable;
//import java.util.Date;
//
//import org.springframework.data.annotation.Id;
//import org.springframework.data.mongodb.core.mapping.Document;
//
//import com.fasterxml.jackson.annotation.JsonFormat;
//
///**
// * 指标定义表
// */
//@Document(collection="indi_def")
//public class IndicatorsDef implements Serializable{
// /**
// *
// */
// private static final long serialVersionUID = 1L;
//
// @Id
// private String id;
// private String indiName;
// private String indiCnName;
// private int valueMapping = -1;
// private String valueMappingName;
// private String indiUnit;
// private String dataType;
// private String status;
//
// @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
// private Date createTime;
// @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
// private Date updateTime;
//
// private String creator;
// private String updator;
//
// //添加基础指标编号和公式属性
// private String indiCode;
// private String indiFormula;
//
// public String getId() {
// return id;
// }
// public void setId(String id) {
// this.id = id;
// }
// public String getIndiName() {
// return indiName;
// }
// public void setIndiName(String indiName) {
// this.indiName = indiName;
// }
// public String getIndiCnName() {
// return indiCnName;
// }
// public void setIndiCnName(String indiCnName) {
// this.indiCnName = indiCnName;
// }
// public int getValueMapping() {
// return valueMapping;
// }
// public void setValueMapping(int valueMapping) {
// this.valueMapping = valueMapping;
// }
// public String getValueMappingName() {
// return valueMappingName;
// }
// public void setValueMappingName(String valueMappingName) {
// this.valueMappingName = valueMappingName;
// }
// public String getIndiUnit() {
// return indiUnit;
// }
// public void setIndiUnit(String indiUnit) {
// this.indiUnit = indiUnit;
// }
// public String getDataType() {
// return dataType;
// }
// public void setDataType(String dataType) {
// this.dataType = dataType;
// }
// public String getStatus() {
// return status;
// }
// public void setStatus(String status) {
// this.status = status;
// }
// public Date getCreateTime() {
// return createTime;
// }
// public void setCreateTime(Date createTime) {
// this.createTime = createTime;
// }
// public Date getUpdateTime() {
// return updateTime;
// }
// public void setUpdateTime(Date updateTime) {
// this.updateTime = updateTime;
// }
// public String getCreator() {
// return creator;
// }
// public void setCreator(String creator) {
// this.creator = creator;
// }
// public String getUpdator() {
// return updator;
// }
// public void setUpdator(String updator) {
// this.updator = updator;
// }
// public String getIndiCode() {
// return indiCode;
// }
// public void setIndiCode(String indiCode) {
// this.indiCode = indiCode;
// }
// public String getIndiFormula() {
// return indiFormula;
// }
// public void setIndiFormula(String indiFormula) {
// this.indiFormula = indiFormula;
// }
//}
src/main/java/com/keymobile/indicators/model/indicators/IndicatorsDim.java
deleted
100644 → 0
View file @
8495a010
//package com.keymobile.indicators.model.indicators;
//
//import java.io.Serializable;
//import java.util.Date;
//
//import org.springframework.data.annotation.Id;
//import org.springframework.data.mongodb.core.mapping.Document;
//
//import com.fasterxml.jackson.annotation.JsonFormat;
//
///**
// * 指标维度表
// */
//@Document(collection="indi_dim")
//public class IndicatorsDim implements Serializable{
// /**
// *
// */
// private static final long serialVersionUID = 1L;
//
// @Id
// private String id;
// private String dimName;
// private String dimCnName;
// private String dimType;
// private int dimMapping = -1;
// private String dimMappingName;
// private String dataType;
// private int sort;
// private String indiDefId;
//
// @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
// private Date createTime;
// @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
// private Date updateTime;
//
// private String creator;
// private String updator;
// public String getId() {
// return id;
// }
// public void setId(String id) {
// this.id = id;
// }
// public String getDimName() {
// return dimName;
// }
// public void setDimName(String dimName) {
// this.dimName = dimName;
// }
// public String getDimCnName() {
// return dimCnName;
// }
// public void setDimCnName(String dimCnName) {
// this.dimCnName = dimCnName;
// }
// public String getDimType() {
// return dimType;
// }
// public void setDimType(String dimType) {
// this.dimType = dimType;
// }
// public int getDimMapping() {
// return dimMapping;
// }
// public void setDimMapping(int dimMapping) {
// this.dimMapping = dimMapping;
// }
// public String getDimMappingName() {
// return dimMappingName;
// }
// public void setDimMappingName(String dimMappingName) {
// this.dimMappingName = dimMappingName;
// }
// public String getDataType() {
// return dataType;
// }
// public void setDataType(String dataType) {
// this.dataType = dataType;
// }
// public int getSort() {
// return sort;
// }
// public void setSort(int sort) {
// this.sort = sort;
// }
// public String getIndiDefId() {
// return indiDefId;
// }
// public void setIndiDefId(String indiDefId) {
// this.indiDefId = indiDefId;
// }
// public Date getCreateTime() {
// return createTime;
// }
// public void setCreateTime(Date createTime) {
// this.createTime = createTime;
// }
// public Date getUpdateTime() {
// return updateTime;
// }
// public void setUpdateTime(Date updateTime) {
// this.updateTime = updateTime;
// }
// public String getCreator() {
// return creator;
// }
// public void setCreator(String creator) {
// this.creator = creator;
// }
// public String getUpdator() {
// return updator;
// }
// public void setUpdator(String updator) {
// this.updator = updator;
// }
//
//
//}
src/main/java/com/keymobile/indicators/model/mapper/GeneralParmMapper.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
model
.
mapper
;
import
java.util.List
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.GeneralParm
;
@Mapper
public
interface
GeneralParmMapper
{
public
List
<
GeneralParm
>
getAll
();
}
src/main/java/com/keymobile/indicators/model/mapper/IndAcsDataMapper.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
model
.
mapper
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
IndAcsDataMapper
{
}
src/main/java/com/keymobile/indicators/model/mapper/IndAcsScoreInfoMapper.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
model
.
mapper
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.IndAcsScoreInfo
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
IndAcsScoreInfoMapper
extends
BaseMapper
<
IndAcsScoreInfo
>{
}
src/main/java/com/keymobile/indicators/model/mapper/IndAnaDataMapper.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
model
.
mapper
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
IndAnaDataMapper
{
}
src/main/java/com/keymobile/indicators/model/mapper/IndRelInfMapper.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
model
.
mapper
;
import
org.apache.ibatis.annotations.Mapper
;
@Mapper
public
interface
IndRelInfMapper
{
}
src/main/java/com/keymobile/indicators/model/mapper/
IndAna
DefMapper.java
→
src/main/java/com/keymobile/indicators/model/mapper/
indicators/BaseInd
DefMapper.java
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
model
.
mapper
;
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indicators
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.
IndAna
Def
;
import
com.keymobile.indicators.model.entity.
indicators.BaseInd
Def
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
IndAnaDefMapper
extends
BaseMapper
<
IndAna
Def
>{
public
List
<
IndAna
Def
>
getPageByKeyword
(
Map
<
String
,
Object
>
param
);
public
interface
BaseIndDefMapper
extends
BaseMapper
<
BaseInd
Def
>{
public
List
<
BaseInd
Def
>
getPageByKeyword
(
Map
<
String
,
Object
>
param
);
public
int
getByKeywordCount
(
Map
<
String
,
Object
>
param
);
public
List
<
IndAnaDef
>
getByKeyword
(
Map
<
String
,
Object
>
param
);
public
void
deleteByCatalogIdIn
(
List
<
String
>
catalogIds
);
}
src/main/java/com/keymobile/indicators/model/mapper/
IndAcs
DefMapper.java
→
src/main/java/com/keymobile/indicators/model/mapper/
indicators/DriveInd
DefMapper.java
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
model
.
mapper
;
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indicators
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.ibatis.annotations.Mapper
;
import
com.keymobile.indicators.model.entity.IndAcsDef
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDef
;
import
tk.mybatis.mapper.common.BaseMapper
;
@Mapper
public
interface
IndAcsDefMapper
extends
BaseMapper
<
IndAcsDef
>
{
public
List
<
IndAcsDef
>
getAll
();
public
List
<
IndAcsDef
>
getPageByKeyword
(
Map
<
String
,
Object
>
param
);
public
interface
DriveIndDefMapper
extends
BaseMapper
<
DriveIndDef
>{
public
List
<
DriveIndDef
>
getPageByKeyword
(
Map
<
String
,
Object
>
param
);
public
int
getByKeywordCount
(
Map
<
String
,
Object
>
param
);
public
List
<
IndAcsDef
>
getByKeyword
(
Map
<
String
,
Object
>
param
);
public
void
deleteByCatalogIdIn
(
List
<
String
>
catalogIds
);
}
src/main/java/com/keymobile/indicators/persistence/hyindicators/BaseIndDefVersionRepository.java
0 → 100644
View file @
d7fe37f7
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/DriveIndCalResultRepository.java
View file @
d7fe37f7
...
...
@@ -29,4 +29,8 @@ public interface DriveIndCalResultRepository extends MongoRepository<DriveIndCal
public
List
<
DriveIndCalResult
>
findByIndIdAndDateAndCompareId
(
String
indId
,
int
date
,
String
compareId
,
Sort
sort
);
public
List
<
DriveIndCalResult
>
findByIndIdAndDateAndCompareId
(
String
indId
,
int
date
,
String
compareId
);
public
List
<
DriveIndCalResult
>
findByCompareObjAndDate
(
String
compareObj
,
int
date
);
public
List
<
DriveIndCalResult
>
findByCompareObjAndDateAndIndIdIn
(
String
compareObj
,
int
date
,
List
<
String
>
indIds
);
}
src/main/java/com/keymobile/indicators/persistence/hyindicators/DriveIndCatalogRepository.java
0 → 100644
View file @
d7fe37f7
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
0 → 100644
View file @
d7fe37f7
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
0 → 100644
View file @
d7fe37f7
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/ScoreRuleRepository.java
0 → 100644
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
persistence
.
hyindicators
;
import
java.util.List
;
import
org.springframework.data.mongodb.repository.MongoRepository
;
import
com.keymobile.indicators.model.entity.objscorerule.ScoreRule
;
public
interface
ScoreRuleRepository
extends
MongoRepository
<
ScoreRule
,
String
>{
List
<
ScoreRule
>
findByCode
(
String
code
);
}
src/main/java/com/keymobile/indicators/persistence/indicators/DeriveIndicatorsRepository.java
deleted
100644 → 0
View file @
8495a010
//package com.keymobile.indicators.persistence.indicators;
//
//import java.util.List;
//
//import org.springframework.data.mongodb.repository.MongoRepository;
//
//import com.keymobile.indicators.model.indicators.DeriveIndicators;
//
//public interface DeriveIndicatorsRepository extends MongoRepository<DeriveIndicators,String>{
//
// //判断原生指标是否关联了衍生指标
// public List<DeriveIndicators> findByIndiDefIdsLike(String indiDefId);
//
// public List<DeriveIndicators> findByDerNameLikeOrDerCnNameLike(String name,String cnName);
//}
src/main/java/com/keymobile/indicators/persistence/indicators/IndicatorsDefRepository.java
deleted
100644 → 0
View file @
8495a010
//package com.keymobile.indicators.persistence.indicators;
//
//import java.util.List;
//
//import org.springframework.data.mongodb.repository.MongoRepository;
//
//import com.keymobile.indicators.model.indicators.IndicatorsDef;
//
//public interface IndicatorsDefRepository extends MongoRepository<IndicatorsDef,String>{
// public List<IndicatorsDef> findByStatus(String status);
//
// public List<IndicatorsDef> findByIndiNameLikeOrIndiCnNameLikeAndStatus(String name,String cnName,String status);
//}
src/main/java/com/keymobile/indicators/persistence/indicators/IndicatorsDimRepository.java
deleted
100644 → 0
View file @
8495a010
//package com.keymobile.indicators.persistence.indicators;
//
//import java.util.List;
//import java.util.Optional;
//
//import org.springframework.data.mongodb.repository.MongoRepository;
//
//import com.keymobile.indicators.model.indicators.IndicatorsDim;
//
//public interface IndicatorsDimRepository extends MongoRepository<IndicatorsDim,String>{
// public void deleteByIndiDefId(String indiDefId);
//
// public List<IndicatorsDim> findByIndiDefId(String indiDefId);
//
// public Optional<IndicatorsDim> findByIndiDefIdAndDimMappingName(String indiDefId,String dimMappindName);
//
// public Optional<IndicatorsDim> findByIndiDefIdAndDimCnName(String indiDefId,String dimCnName);
//}
src/main/java/com/keymobile/indicators/service/cmbkpi/GeneralParmService.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
service
.
cmbkpi
;
import
java.util.List
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.keymobile.indicators.model.entity.GeneralParm
;
import
com.keymobile.indicators.model.mapper.GeneralParmMapper
;
@Service
public
class
GeneralParmService
{
@Autowired
private
GeneralParmMapper
genrealParmMapper
;
public
List
<
GeneralParm
>
getAll
(){
return
genrealParmMapper
.
getAll
();
}
}
src/main/java/com/keymobile/indicators/service/cmbkpi/IndAcsDataService.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
service
.
cmbkpi
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.keymobile.indicators.model.mapper.IndAcsDataMapper
;
@Service
public
class
IndAcsDataService
{
@Autowired
private
IndAcsDataMapper
indAcsDataMapper
;
}
src/main/java/com/keymobile/indicators/service/cmbkpi/IndAcsDefService.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
service
.
cmbkpi
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.keymobile.indicators.model.entity.IndAcsDef
;
import
com.keymobile.indicators.model.entity.IndAcsScoreInfo
;
import
com.keymobile.indicators.model.mapper.IndAcsDefMapper
;
@Service
public
class
IndAcsDefService
{
@Autowired
private
IndAcsDefMapper
indAcsDefMapper
;
@Autowired
private
IndAcsScoreInfoService
indAcsScoreService
;
public
List
<
IndAcsDef
>
getAll
(){
return
indAcsDefMapper
.
getAll
();
}
public
IndAcsDef
getById
(
String
id
)
{
IndAcsDef
def
=
new
IndAcsDef
();
def
.
setIndId
(
id
);
return
indAcsDefMapper
.
selectOne
(
def
);
}
public
String
saveOrUpdate
(
IndAcsDef
indAcsDef
)
throws
Exception
{
if
(
StringUtils
.
isBlank
(
indAcsDef
.
getIndId
()))
{
return
"indId is not be null"
;
}
//根据考核指标编号判断是否已存在
IndAcsDef
dbIndAcsDef
=
this
.
getById
(
indAcsDef
.
getIndId
());
if
(
dbIndAcsDef
==
null
)
{
indAcsDefMapper
.
insert
(
indAcsDef
);
}
else
{
indAcsDefMapper
.
updateByPrimaryKey
(
indAcsDef
);
}
return
indAcsDef
.
getIndId
();
}
public
Map
<
String
,
Object
>
getByPageAndKeyword
(
String
keyword
,
int
page
,
int
rows
)
throws
Exception
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
if
(
StringUtils
.
isBlank
(
keyword
))
{
paramMap
.
put
(
"keyword"
,
null
);
}
else
{
paramMap
.
put
(
"keyword"
,
"%"
+
keyword
+
"%"
);
}
//计算总数
int
count
=
indAcsDefMapper
.
getByKeywordCount
(
paramMap
);
//计算start
int
start
=
page
*
rows
;
paramMap
.
put
(
"start"
,
start
);
paramMap
.
put
(
"end"
,
rows
);
List
<
IndAcsDef
>
resultList
=
indAcsDefMapper
.
getPageByKeyword
(
paramMap
);
resultMap
.
put
(
"resultList"
,
resultList
);
resultMap
.
put
(
"total"
,
count
);
return
resultMap
;
}
public
void
delete
(
String
indId
)
throws
Exception
{
indAcsDefMapper
.
deleteByPrimaryKey
(
indId
);
//删除考核指标关联的公式
List
<
IndAcsScoreInfo
>
indAcsScoreInfos
=
indAcsScoreService
.
getListByIndId
(
indId
);
if
(!
indAcsScoreInfos
.
isEmpty
())
{
for
(
IndAcsScoreInfo
acsScore
:
indAcsScoreInfos
)
{
indAcsScoreService
.
delete
(
acsScore
.
getOrgId
(),
acsScore
.
getIndexId
(),
acsScore
.
getIndexAttrId
());
}
}
}
}
src/main/java/com/keymobile/indicators/service/cmbkpi/IndAcsScoreInfoService.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
service
.
cmbkpi
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.google.common.collect.Maps
;
import
com.googlecode.aviator.AviatorEvaluator
;
import
com.keymobile.indicators.model.entity.IndAcsDef
;
import
com.keymobile.indicators.model.entity.IndAcsScoreInfo
;
import
com.keymobile.indicators.model.entity.IndAnaDef
;
import
com.keymobile.indicators.model.entity.IndRelTree
;
import
com.keymobile.indicators.model.mapper.IndAcsDefMapper
;
import
com.keymobile.indicators.model.mapper.IndAcsScoreInfoMapper
;
import
com.keymobile.indicators.model.mapper.IndAnaDefMapper
;
import
com.keymobile.indicators.service.hytobacco.BaseIndDataService
;
import
com.keymobile.indicators.utils.CalculateUtils
;
import
com.keymobile.indicators.utils.FormulaUtils
;
@Service
public
class
IndAcsScoreInfoService
{
@Autowired
private
IndAcsScoreInfoMapper
indAcsScoreInfoMapper
;
@Autowired
private
IndAnaDefMapper
indAnaDefMapper
;
@Autowired
private
IndAcsDefMapper
indAcsDefMapper
;
@Autowired
private
BaseIndDataService
baseIndDataService
;
public
String
save
(
IndAcsScoreInfo
indAcsScoreInfo
)
throws
Exception
{
// if(StringUtils.isBlank(indAcsScoreInfo.getOrgId())||
// StringUtils.isBlank(indAcsScoreInfo.getIndexId())||
// StringUtils.isBlank(indAcsScoreInfo.getIndexAttrId())) {
// return "orgId,indexId,indexAttrId can not be null";
// }else {
// //根据组织机构id,指标编号和指标类型判断是否有公式存在
// IndAcsScoreInfo dbIndAcsScoreInfo = this.selectOneByOrgIdAndIndidAndIndtype(
// indAcsScoreInfo.getOrgId(),indAcsScoreInfo.getIndexId(),indAcsScoreInfo.getIndexAttrId());
// if(dbIndAcsScoreInfo!=null) {
// return "the indicators have exist,can not save to the database";
// }else {
indAcsScoreInfoMapper
.
insert
(
indAcsScoreInfo
);
// }
// }
return
"save success"
;
}
public
void
delete
(
String
orgId
,
String
indId
,
String
indAttrId
)
throws
Exception
{
IndAcsScoreInfo
indAcsScoreInfo
=
this
.
selectOneByOrgIdAndIndidAndIndtype
(
orgId
,
indId
,
indAttrId
);
if
(
indAcsScoreInfo
!=
null
)
{
indAcsScoreInfoMapper
.
delete
(
indAcsScoreInfo
);
}
}
public
List
<
IndAcsScoreInfo
>
getListByIndId
(
String
indId
)
throws
Exception
{
IndAcsScoreInfo
indAcsScoreInfo
=
new
IndAcsScoreInfo
();
indAcsScoreInfo
.
setIndexId
(
indId
);
return
indAcsScoreInfoMapper
.
select
(
indAcsScoreInfo
);
}
public
IndAcsScoreInfo
selectOneByOrgIdAndIndidAndIndtype
(
String
orgId
,
String
indId
,
String
indAttrId
)
throws
Exception
{
IndAcsScoreInfo
indAcsScoreInfo
=
new
IndAcsScoreInfo
();
indAcsScoreInfo
.
setOrgId
(
orgId
);
indAcsScoreInfo
.
setIndexId
(
indId
);
indAcsScoreInfo
.
setIndexAttrId
(
indAttrId
);
return
indAcsScoreInfoMapper
.
selectOne
(
indAcsScoreInfo
);
}
//type:0 分析指标 ;1 考核指标
public
List
<
Map
<
String
,
Object
>>
getIndByKeywordAndType
(
String
keyword
,
String
type
)
throws
Exception
{
List
<
Map
<
String
,
Object
>>
resultList
=
new
ArrayList
<>();
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
if
(
StringUtils
.
isBlank
(
keyword
))
{
paramMap
.
put
(
"keyword"
,
null
);
}
else
{
paramMap
.
put
(
"keyword"
,
"%"
+
keyword
+
"%"
);
}
if
(
StringUtils
.
isNotBlank
(
type
))
{
if
(
"0"
.
equals
(
type
))
{
List
<
IndAnaDef
>
indAnaDefs
=
indAnaDefMapper
.
getByKeyword
(
paramMap
);
if
(!
indAnaDefs
.
isEmpty
())
{
for
(
IndAnaDef
indAnaDef
:
indAnaDefs
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"indId"
,
indAnaDef
.
getIndId
());
map
.
put
(
"indName"
,
indAnaDef
.
getIndName
());
map
.
put
(
"type"
,
"0"
);
resultList
.
add
(
map
);
}
}
}
else
{
List
<
IndAcsDef
>
indAcsDefs
=
indAcsDefMapper
.
getByKeyword
(
paramMap
);
if
(!
indAcsDefs
.
isEmpty
())
{
for
(
IndAcsDef
indAcsDef
:
indAcsDefs
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"indId"
,
indAcsDef
.
getIndId
());
map
.
put
(
"indName"
,
indAcsDef
.
getIndName
());
map
.
put
(
"type"
,
"1"
);
resultList
.
add
(
map
);
}
}
}
}
else
{
List
<
IndAnaDef
>
indAnaDefs
=
indAnaDefMapper
.
getByKeyword
(
paramMap
);
List
<
IndAcsDef
>
indAcsDefs
=
indAcsDefMapper
.
getByKeyword
(
paramMap
);
if
(!
indAnaDefs
.
isEmpty
())
{
for
(
IndAnaDef
indAnaDef
:
indAnaDefs
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"indId"
,
indAnaDef
.
getIndId
());
map
.
put
(
"indName"
,
indAnaDef
.
getIndName
());
map
.
put
(
"type"
,
"0"
);
resultList
.
add
(
map
);
}
}
if
(!
indAcsDefs
.
isEmpty
())
{
for
(
IndAcsDef
indAcsDef
:
indAcsDefs
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<>();
map
.
put
(
"indId"
,
indAcsDef
.
getIndId
());
map
.
put
(
"indName"
,
indAcsDef
.
getIndName
());
map
.
put
(
"type"
,
"1"
);
resultList
.
add
(
map
);
}
}
}
return
resultList
;
}
public
Map
<
String
,
String
>
getIndicatorByInId
(
String
indId
){
Map
<
String
,
String
>
result
=
new
HashMap
<>();
IndAcsDef
indAscDef
=
new
IndAcsDef
();
indAscDef
.
setIndId
(
indId
);
IndAnaDef
indAnaDef
=
new
IndAnaDef
();
indAnaDef
.
setIndId
(
indId
);
IndAcsDef
ascDef
=
indAcsDefMapper
.
selectOne
(
indAscDef
);
if
(
ascDef
!=
null
)
{
result
.
put
(
"indId"
,
ascDef
.
getIndId
());
result
.
put
(
"indName"
,
ascDef
.
getIndName
());
result
.
put
(
"type"
,
"1"
);
}
else
{
IndAnaDef
anaDef
=
indAnaDefMapper
.
selectOne
(
indAnaDef
);
if
(
anaDef
!=
null
)
{
result
.
put
(
"indId"
,
anaDef
.
getIndId
());
result
.
put
(
"indName"
,
anaDef
.
getIndName
());
result
.
put
(
"type"
,
"0"
);
}
}
return
result
;
}
public
IndRelTree
analysisIndTree
(
String
orgId
,
String
indId
,
String
indAttrId
)
throws
Exception
{
IndRelTree
indRelTree
=
new
IndRelTree
();
//获取指标信息
Map
<
String
,
String
>
indInfo
=
this
.
getIndicatorByInId
(
indId
);
if
(
indInfo
.
isEmpty
())
{
indRelTree
.
setIndId
(
indId
+
" has been deleted"
);
indRelTree
.
setIndName
(
indId
+
" 被删除"
);
indRelTree
.
setType
(
indInfo
.
get
(
"unknown"
));
}
else
{
indRelTree
.
setIndId
(
indInfo
.
get
(
"indId"
));
indRelTree
.
setIndName
(
indInfo
.
get
(
"indName"
));
indRelTree
.
setType
(
indInfo
.
get
(
"type"
));
}
indRelTree
.
setChildren
(
new
ArrayList
<
IndRelTree
>());
//根据机构id,指标id和指标类型获取考核指标
IndAcsScoreInfo
indAcsScoreInfo
=
this
.
selectOneByOrgIdAndIndidAndIndtype
(
orgId
,
indId
,
indAttrId
);
if
(
indAcsScoreInfo
!=
null
)
{
indRelTree
.
setIndAttrId
(
indAcsScoreInfo
.
getIndexAttrId
());
indRelTree
.
setWeight
(
indAcsScoreInfo
.
getWeight
());
//分析公式
String
formula
=
indAcsScoreInfo
.
getScoreFormula
();
if
(
StringUtils
.
isNotBlank
(
formula
))
{
List
<
Map
<
String
,
String
>>
formulaInfo
=
FormulaUtils
.
analysisFormula
(
formula
);
for
(
Map
<
String
,
String
>
map
:
formulaInfo
)
{
indRelTree
.
getChildren
().
add
(
analysisIndTree
(
orgId
,
map
.
get
(
"indId"
),
map
.
get
(
"indAttrId"
)));
}
}
}
return
indRelTree
;
}
public
String
calGroupAverage
(
String
driveIndFormula
,
List
<
String
>
compareObjs
,
int
date
)
throws
Exception
{
String
result
=
"0.0"
;
List
<
String
>
indIdList
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotBlank
(
driveIndFormula
))
{
Pattern
p
=
Pattern
.
compile
(
"(\\[[^\\]]*\\])"
);
Matcher
m
=
p
.
matcher
(
driveIndFormula
);
while
(
m
.
find
()){
indIdList
.
add
(
m
.
group
().
substring
(
1
,
m
.
group
().
length
()-
1
));
}
//获取公式中的基础指标id
int
indIdSize
=
indIdList
.
size
();
if
(
indIdSize
!=
0
)
{
if
(
indIdSize
==
1
)
{
List
<
String
>
indDateList
=
baseIndDataService
.
getIndData
(
indIdList
.
get
(
0
),
date
,
compareObjs
);
result
=
CalculateUtils
.
averageValue
(
indDateList
);
}
else
{
Map
<
String
,
Object
>
env
=
Maps
.
newHashMap
();
for
(
String
indId
:
indIdList
)
{
List
<
String
>
indDateList
=
baseIndDataService
.
getIndData
(
indId
,
date
,
compareObjs
);
String
sumValue
=
CalculateUtils
.
sumValue
(
indDateList
);
env
.
put
(
indId
,
Double
.
valueOf
(
sumValue
));
driveIndFormula
=
driveIndFormula
.
replace
(
"["
+
indId
+
"]"
,
indId
);
}
result
=
AviatorEvaluator
.
execute
(
driveIndFormula
,
env
).
toString
();
//保留四位小数
if
(!
result
.
equals
(
"NaN"
))
{
result
=
String
.
format
(
"%.4f"
,
new
BigDecimal
(
Double
.
valueOf
(
result
)));
}
}
}
}
return
result
;
}
}
src/main/java/com/keymobile/indicators/service/cmbkpi/IndAnaDataService.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
service
.
cmbkpi
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.keymobile.indicators.model.mapper.IndAnaDataMapper
;
@Service
public
class
IndAnaDataService
{
@Autowired
private
IndAnaDataMapper
indAnaDataMapper
;
}
src/main/java/com/keymobile/indicators/service/cmbkpi/IndAnaDefService.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
service
.
cmbkpi
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.keymobile.indicators.model.entity.IndAnaDef
;
import
com.keymobile.indicators.model.mapper.IndAnaDefMapper
;
@Service
public
class
IndAnaDefService
{
@Autowired
private
IndAnaDefMapper
indAnaDefMapper
;
public
String
saveOrUpdate
(
IndAnaDef
indAnaDef
)
throws
Exception
{
if
(
StringUtils
.
isBlank
(
indAnaDef
.
getIndId
()))
{
return
"indId can not be null"
;
}
//根据指标编号判断分析指标是否已存在
IndAnaDef
dbIndAnaDef
=
this
.
getById
(
indAnaDef
.
getIndId
());
if
(
dbIndAnaDef
==
null
)
{
indAnaDefMapper
.
insert
(
indAnaDef
);
}
else
{
indAnaDefMapper
.
updateByPrimaryKey
(
indAnaDef
);
}
return
indAnaDef
.
getIndId
();
}
public
void
delete
(
String
indId
)
throws
Exception
{
indAnaDefMapper
.
deleteByPrimaryKey
(
indId
);
}
public
IndAnaDef
getById
(
String
id
)
throws
Exception
{
IndAnaDef
anaDef
=
new
IndAnaDef
();
anaDef
.
setIndId
(
id
);
return
indAnaDefMapper
.
selectOne
(
anaDef
);
}
public
Map
<
String
,
Object
>
getByPageAndKeyword
(
String
keyword
,
int
page
,
int
rows
)
throws
Exception
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
if
(
StringUtils
.
isBlank
(
keyword
))
{
paramMap
.
put
(
"keyword"
,
null
);
}
else
{
paramMap
.
put
(
"keyword"
,
"%"
+
keyword
+
"%"
);
}
//计算总数
int
count
=
indAnaDefMapper
.
getByKeywordCount
(
paramMap
);
//计算start
int
start
=
page
*
rows
;
paramMap
.
put
(
"start"
,
start
);
paramMap
.
put
(
"end"
,
rows
);
List
<
IndAnaDef
>
resultList
=
indAnaDefMapper
.
getPageByKeyword
(
paramMap
);
resultMap
.
put
(
"resultList"
,
resultList
);
resultMap
.
put
(
"total"
,
count
);
return
resultMap
;
}
}
src/main/java/com/keymobile/indicators/service/cmbkpi/IndRelInfService.java
deleted
100644 → 0
View file @
8495a010
package
com
.
keymobile
.
indicators
.
service
.
cmbkpi
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.keymobile.indicators.model.mapper.IndRelInfMapper
;
@Service
public
class
IndRelInfService
{
@Autowired
private
IndRelInfMapper
indRelInfMapper
;
}
src/main/java/com/keymobile/indicators/service/hytobacco/BaseIndDataService.java
View file @
d7fe37f7
...
...
@@ -3,7 +3,6 @@ package com.keymobile.indicators.service.hytobacco;
import
java.util.ArrayList
;
import
java.util.List
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/BaseIndDefService.java
0 → 100644
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.keymobile.indicators.model.entity.indicators.BaseIndDef
;
import
com.keymobile.indicators.model.mapper.indicators.BaseIndDefMapper
;
@Service
public
class
BaseIndDefService
{
@Autowired
private
BaseIndDefMapper
baseIndDefMapper
;
@Autowired
private
BaseIndDefVersionService
baseIndDefVersionService
;
public
String
saveOrUpdate
(
BaseIndDef
baseIndDef
,
String
catalogId
,
String
catalogIdPath
,
String
user
)
throws
Exception
{
if
(
StringUtils
.
isBlank
(
baseIndDef
.
getIndId
()))
{
return
"indId can not be null"
;
}
BaseIndDef
dbBaseIndDef
=
this
.
getById
(
baseIndDef
.
getIndId
());
if
(
dbBaseIndDef
==
null
)
{
baseIndDef
.
setCreater
(
user
);
baseIndDef
.
setCreateTime
(
new
Date
());
baseIndDef
.
setUpdater
(
user
);
baseIndDef
.
setUpdateTime
(
new
Date
());
baseIndDef
.
setVersion
(
"1.0"
);
baseIndDef
.
setCatalogId
(
catalogId
);
baseIndDef
.
setCatalogIdPath
(
catalogIdPath
);
baseIndDefMapper
.
insert
(
baseIndDef
);
}
else
{
//生成版本
if
(
baseIndDefVersionService
.
save
(
dbBaseIndDef
))
{
String
oldVersion
=
dbBaseIndDef
.
getVersion
();
String
newVersion
=
String
.
valueOf
(
Double
.
valueOf
(
oldVersion
)+
1
);
//旧版本+1
baseIndDef
.
setUpdater
(
user
);
baseIndDef
.
setUpdateTime
(
new
Date
());
baseIndDef
.
setVersion
(
newVersion
);
baseIndDef
.
setCatalogId
(
catalogId
);
baseIndDef
.
setCatalogIdPath
(
catalogIdPath
);
baseIndDefMapper
.
updateByPrimaryKey
(
baseIndDef
);
}
}
return
"success;indId:"
+
baseIndDef
.
getIndId
();
}
public
BaseIndDef
getById
(
String
indId
)
throws
Exception
{
BaseIndDef
baseIndDef
=
new
BaseIndDef
();
baseIndDef
.
setIndId
(
indId
);
return
baseIndDefMapper
.
selectOne
(
baseIndDef
);
}
public
void
delete
(
String
indId
)
throws
Exception
{
baseIndDefMapper
.
deleteByPrimaryKey
(
indId
);
}
public
Map
<
String
,
Object
>
getByPageAndKeyword
(
String
catalogId
,
String
keyword
,
int
page
,
int
rows
)
throws
Exception
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
if
(
StringUtils
.
isBlank
(
catalogId
))
{
paramMap
.
put
(
"catalogId"
,
null
);
}
else
{
paramMap
.
put
(
"catalogId"
,
catalogId
);
}
if
(
StringUtils
.
isBlank
(
keyword
))
{
paramMap
.
put
(
"keyword"
,
null
);
}
else
{
paramMap
.
put
(
"keyword"
,
"%"
+
keyword
+
"%"
);
}
//计算总数
int
count
=
baseIndDefMapper
.
getByKeywordCount
(
paramMap
);
//计算start
int
start
=
page
*
rows
;
paramMap
.
put
(
"start"
,
start
);
paramMap
.
put
(
"end"
,
rows
);
List
<
BaseIndDef
>
resultList
=
baseIndDefMapper
.
getPageByKeyword
(
paramMap
);
resultMap
.
put
(
"resultList"
,
resultList
);
resultMap
.
put
(
"total"
,
count
);
return
resultMap
;
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/BaseIndDefVersionService.java
0 → 100644
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
import
com.keymobile.indicators.model.entity.indicators.BaseIndDef
;
import
com.keymobile.indicators.model.entity.indicators.BaseIndDefVersionData
;
import
com.keymobile.indicators.persistence.hyindicators.BaseIndDefVersionRepository
;
@Service
public
class
BaseIndDefVersionService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
BaseIndDefVersionService
.
class
);
@Autowired
private
BaseIndDefVersionRepository
baseIndDefVersionRepo
;
public
boolean
save
(
BaseIndDef
baseIndDef
)
throws
Exception
{
BaseIndDefVersionData
baseIndDefVersionData
=
new
BaseIndDefVersionData
();
baseIndDefVersionData
.
setIndId
(
baseIndDef
.
getIndId
());
baseIndDefVersionData
.
setIndName
(
baseIndDef
.
getIndName
());
baseIndDefVersionData
.
setVersion
(
baseIndDef
.
getVersion
());
GsonBuilder
gsonBuilder
=
new
GsonBuilder
();
gsonBuilder
.
setPrettyPrinting
();
Gson
gson
=
gsonBuilder
.
create
();
baseIndDefVersionData
.
setDataJson
(
gson
.
toJson
(
baseIndDef
));
baseIndDefVersionRepo
.
save
(
baseIndDefVersionData
);
return
true
;
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndCatalogService.java
0 → 100644
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Optional
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndCatalog
;
import
com.keymobile.indicators.model.mapper.indicators.DriveIndDefMapper
;
import
com.keymobile.indicators.persistence.hyindicators.DriveIndCatalogRepository
;
@Service
public
class
DriveIndCatalogService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
DriveIndCatalogService
.
class
);
@Autowired
private
DriveIndCatalogRepository
driveIndCatalogRepo
;
@Autowired
private
DriveIndDefMapper
driveIndDefMapper
;
public
DriveIndCatalog
saveOrUpdate
(
DriveIndCatalog
driveIndCatalog
)
throws
Exception
{
if
(
StringUtils
.
isBlank
(
driveIndCatalog
.
getId
()))
{
//新增
//保存
driveIndCatalog
=
driveIndCatalogRepo
.
save
(
driveIndCatalog
);
}
//获取parentId拼接idPath
String
parentId
=
driveIndCatalog
.
getParentId
();
if
(
StringUtils
.
isBlank
(
parentId
)
||
"0"
.
equals
(
parentId
))
{
//顶层节点
driveIndCatalog
.
setIdPath
(
driveIndCatalog
.
getId
());
}
else
{
Optional
<
DriveIndCatalog
>
parentDriveIndCatalog
=
driveIndCatalogRepo
.
findById
(
driveIndCatalog
.
getParentId
());
if
(!
parentDriveIndCatalog
.
isPresent
())
{
throw
new
Exception
(
"父节点不存在:parent catalog is not exist"
);
}
else
{
driveIndCatalog
.
setIdPath
(
parentDriveIndCatalog
.
get
().
getIdPath
()+
";"
+
driveIndCatalog
.
getId
());
}
}
//保存
driveIndCatalog
=
driveIndCatalogRepo
.
save
(
driveIndCatalog
);
return
driveIndCatalog
;
}
public
void
delete
(
List
<
String
>
ids
)
{
driveIndCatalogRepo
.
deleteByIdIn
(
ids
);
}
//递归查找父目录下的子目录
public
List
<
String
>
getDeleteCatalogId
(
String
id
){
List
<
String
>
result
=
new
ArrayList
<>();
result
.
add
(
id
);
//根据id获取子节点
List
<
DriveIndCatalog
>
children
=
driveIndCatalogRepo
.
findByParentId
(
id
);
if
(!
children
.
isEmpty
())
{
for
(
DriveIndCatalog
child
:
children
)
{
result
.
addAll
(
getDeleteCatalogId
(
child
.
getId
()));
}
}
return
result
;
}
//递归删除
public
void
recursionDelete
(
List
<
String
>
ids
)
{
for
(
String
id
:
ids
)
{
List
<
String
>
result
=
this
.
getDeleteCatalogId
(
id
);
this
.
delete
(
result
);
//删除目录关联的指标
driveIndDefMapper
.
deleteByCatalogIdIn
(
result
);
}
}
//获取目录树
public
List
<
DriveIndCatalog
>
getCatalog
(
String
parentId
,
List
<
String
>
codes
){
if
(
StringUtils
.
isBlank
(
parentId
)
||
"0"
.
equals
(
parentId
))
{
return
driveIndCatalogRepo
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
"0"
,
codes
);
}
return
driveIndCatalogRepo
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
parentId
,
codes
);
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndDefService.java
0 → 100644
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
import
java.math.BigDecimal
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.regex.Matcher
;
import
java.util.regex.Pattern
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.google.common.collect.Maps
;
import
com.googlecode.aviator.AviatorEvaluator
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDef
;
import
com.keymobile.indicators.model.mapper.indicators.DriveIndDefMapper
;
import
com.keymobile.indicators.utils.CalculateUtils
;
@Service
public
class
DriveIndDefService
{
@Autowired
private
DriveIndDefMapper
driveIndDefMapper
;
@Autowired
private
DriveIndDefVersionService
driveIndDefVersionService
;
@Autowired
private
BaseIndDataService
baseIndDataService
;
public
String
saveOrUpdate
(
DriveIndDef
driveIndDef
,
String
catalogId
,
String
catalogIdPath
,
String
user
)
throws
Exception
{
if
(
StringUtils
.
isBlank
(
driveIndDef
.
getIndId
()))
{
return
"indId can not be null"
;
}
DriveIndDef
dbBaseIndDef
=
this
.
getById
(
driveIndDef
.
getIndId
());
if
(
dbBaseIndDef
==
null
)
{
driveIndDef
.
setCreater
(
user
);
driveIndDef
.
setCreateTime
(
new
Date
());
driveIndDef
.
setUpdater
(
user
);
driveIndDef
.
setUpdateTime
(
new
Date
());
driveIndDef
.
setVersion
(
"1.0"
);
driveIndDef
.
setCatalogId
(
catalogId
);
driveIndDef
.
setCatalogIdPath
(
catalogIdPath
);
driveIndDefMapper
.
insert
(
driveIndDef
);
}
else
{
//生成版本
if
(
driveIndDefVersionService
.
save
(
dbBaseIndDef
))
{
String
oldVersion
=
dbBaseIndDef
.
getVersion
();
String
newVersion
=
String
.
valueOf
(
Double
.
valueOf
(
oldVersion
)+
1
);
//旧版本+1
driveIndDef
.
setUpdater
(
user
);
driveIndDef
.
setUpdateTime
(
new
Date
());
driveIndDef
.
setVersion
(
newVersion
);
driveIndDef
.
setCatalogId
(
catalogId
);
driveIndDef
.
setCatalogIdPath
(
catalogIdPath
);
driveIndDefMapper
.
updateByPrimaryKey
(
driveIndDef
);
}
}
return
"success;driveIndId:"
+
driveIndDef
.
getIndId
();
}
public
DriveIndDef
getById
(
String
indId
)
throws
Exception
{
DriveIndDef
driveIndDef
=
new
DriveIndDef
();
driveIndDef
.
setIndId
(
indId
);
return
driveIndDefMapper
.
selectOne
(
driveIndDef
);
}
public
void
delete
(
String
indId
)
throws
Exception
{
driveIndDefMapper
.
deleteByPrimaryKey
(
indId
);
}
public
Map
<
String
,
Object
>
getByPageAndKeyword
(
String
catalogId
,
String
keyword
,
int
page
,
int
rows
)
throws
Exception
{
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
Map
<
String
,
Object
>
resultMap
=
new
HashMap
<>();
if
(
StringUtils
.
isBlank
(
catalogId
))
{
paramMap
.
put
(
"catalogId"
,
null
);
}
else
{
paramMap
.
put
(
"catalogId"
,
catalogId
);
}
if
(
StringUtils
.
isBlank
(
keyword
))
{
paramMap
.
put
(
"keyword"
,
null
);
}
else
{
paramMap
.
put
(
"keyword"
,
"%"
+
keyword
+
"%"
);
}
//计算总数
int
count
=
driveIndDefMapper
.
getByKeywordCount
(
paramMap
);
//计算start
int
start
=
page
*
rows
;
paramMap
.
put
(
"start"
,
start
);
paramMap
.
put
(
"end"
,
rows
);
List
<
DriveIndDef
>
resultList
=
driveIndDefMapper
.
getPageByKeyword
(
paramMap
);
resultMap
.
put
(
"resultList"
,
resultList
);
resultMap
.
put
(
"total"
,
count
);
return
resultMap
;
}
public
String
calGroupAverage
(
String
driveIndFormula
,
List
<
String
>
compareObjs
,
int
date
)
throws
Exception
{
String
result
=
"0.0"
;
List
<
String
>
indIdList
=
new
ArrayList
<>();
if
(
StringUtils
.
isNotBlank
(
driveIndFormula
))
{
Pattern
p
=
Pattern
.
compile
(
"(\\[[^\\]]*\\])"
);
Matcher
m
=
p
.
matcher
(
driveIndFormula
);
while
(
m
.
find
()){
indIdList
.
add
(
m
.
group
().
substring
(
1
,
m
.
group
().
length
()-
1
));
}
//获取公式中的基础指标id
int
indIdSize
=
indIdList
.
size
();
if
(
indIdSize
!=
0
)
{
if
(
indIdSize
==
1
)
{
List
<
String
>
indDateList
=
baseIndDataService
.
getIndData
(
indIdList
.
get
(
0
),
date
,
compareObjs
);
result
=
CalculateUtils
.
averageValue
(
indDateList
,
0
);
}
else
{
Map
<
String
,
Object
>
env
=
Maps
.
newHashMap
();
for
(
String
indId
:
indIdList
)
{
List
<
String
>
indDateList
=
baseIndDataService
.
getIndData
(
indId
,
date
,
compareObjs
);
String
sumValue
=
CalculateUtils
.
sumValue
(
indDateList
);
env
.
put
(
indId
,
Double
.
valueOf
(
sumValue
));
driveIndFormula
=
driveIndFormula
.
replace
(
"["
+
indId
+
"]"
,
indId
);
}
result
=
AviatorEvaluator
.
execute
(
driveIndFormula
,
env
).
toString
();
//保留四位小数
if
(!
result
.
equals
(
"NaN"
))
{
result
=
String
.
format
(
"%.4f"
,
new
BigDecimal
(
Double
.
valueOf
(
result
)));
}
}
}
}
return
result
;
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/DriveIndDefVersionService.java
0 → 100644
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.google.gson.Gson
;
import
com.google.gson.GsonBuilder
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDef
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDefVersionData
;
import
com.keymobile.indicators.persistence.hyindicators.DriveIndDefVersionRepository
;
@Service
public
class
DriveIndDefVersionService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
DriveIndDefVersionService
.
class
);
@Autowired
private
DriveIndDefVersionRepository
driveIndDefVersionRepo
;
public
boolean
save
(
DriveIndDef
driveIndDef
)
throws
Exception
{
DriveIndDefVersionData
driveIndDefVersionData
=
new
DriveIndDefVersionData
();
driveIndDefVersionData
.
setIndId
(
driveIndDef
.
getIndId
());
driveIndDefVersionData
.
setIndName
(
driveIndDef
.
getIndName
());
driveIndDefVersionData
.
setVersion
(
driveIndDef
.
getVersion
());
GsonBuilder
gsonBuilder
=
new
GsonBuilder
();
gsonBuilder
.
setPrettyPrinting
();
Gson
gson
=
gsonBuilder
.
create
();
driveIndDefVersionData
.
setDataJson
(
gson
.
toJson
(
driveIndDef
));
driveIndDefVersionRepo
.
save
(
driveIndDefVersionData
);
return
true
;
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/IndCatalogService.java
0 → 100644
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Optional
;
import
org.apache.commons.lang.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.keymobile.indicators.model.entity.indicators.IndCatalog
;
import
com.keymobile.indicators.model.mapper.indicators.BaseIndDefMapper
;
import
com.keymobile.indicators.persistence.hyindicators.IndCatalogRepository
;
@Service
public
class
IndCatalogService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
IndCatalogService
.
class
);
@Autowired
private
IndCatalogRepository
indCatalogRepo
;
@Autowired
private
BaseIndDefMapper
baseIndDefMapper
;
public
IndCatalog
saveOrUpdate
(
IndCatalog
indCatalog
)
throws
Exception
{
if
(
StringUtils
.
isBlank
(
indCatalog
.
getId
()))
{
//新增
//保存
indCatalog
=
indCatalogRepo
.
save
(
indCatalog
);
}
//获取parentId拼接idPath
String
parentId
=
indCatalog
.
getParentId
();
if
(
StringUtils
.
isBlank
(
parentId
)
||
"0"
.
equals
(
parentId
))
{
//顶层节点
indCatalog
.
setIdPath
(
indCatalog
.
getId
());
}
else
{
Optional
<
IndCatalog
>
parentIndCatalog
=
indCatalogRepo
.
findById
(
indCatalog
.
getParentId
());
if
(!
parentIndCatalog
.
isPresent
())
{
throw
new
Exception
(
"父节点不存在:parent catalog is not exist"
);
}
else
{
indCatalog
.
setIdPath
(
parentIndCatalog
.
get
().
getIdPath
()+
";"
+
indCatalog
.
getId
());
}
}
//保存
indCatalog
=
indCatalogRepo
.
save
(
indCatalog
);
return
indCatalog
;
}
public
void
delete
(
List
<
String
>
ids
)
{
indCatalogRepo
.
deleteByIdIn
(
ids
);
}
//递归查找父目录下的子目录
public
List
<
String
>
getDeleteCatalogId
(
String
id
){
List
<
String
>
result
=
new
ArrayList
<>();
result
.
add
(
id
);
//根据id获取子节点
List
<
IndCatalog
>
children
=
indCatalogRepo
.
findByParentId
(
id
);
if
(!
children
.
isEmpty
())
{
for
(
IndCatalog
child
:
children
)
{
result
.
addAll
(
getDeleteCatalogId
(
child
.
getId
()));
}
}
return
result
;
}
//递归删除
public
void
recursionDelete
(
List
<
String
>
ids
)
{
for
(
String
id
:
ids
)
{
List
<
String
>
result
=
this
.
getDeleteCatalogId
(
id
);
this
.
delete
(
result
);
//删除目录关联的指标
baseIndDefMapper
.
deleteByCatalogIdIn
(
result
);
}
}
//获取目录树
public
List
<
IndCatalog
>
getCatalog
(
String
parentId
,
List
<
String
>
codes
){
if
(
StringUtils
.
isBlank
(
parentId
)
||
"0"
.
equals
(
parentId
))
{
return
indCatalogRepo
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
"0"
,
codes
);
}
return
indCatalogRepo
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
parentId
,
codes
);
}
}
src/main/java/com/keymobile/indicators/service/hytobacco/IndScorecardService.java
View file @
d7fe37f7
...
...
@@ -17,13 +17,12 @@ import org.springframework.stereotype.Service;
import
com.google.common.collect.Maps
;
import
com.googlecode.aviator.AviatorEvaluator
;
import
com.keymobile.indicators.model.entity.DriveIndCalResult
;
import
com.keymobile.indicators.model.entity.
IndAcs
Def
;
import
com.keymobile.indicators.model.entity.
indicators.DriveInd
Def
;
import
com.keymobile.indicators.model.entity.scorecard.ImproveScoreDef
;
import
com.keymobile.indicators.model.entity.scorecard.IndScorecard
;
import
com.keymobile.indicators.model.entity.scorecard.RankScoreDef
;
import
com.keymobile.indicators.persistence.hyindicators.DriveIndCalResultRepository
;
import
com.keymobile.indicators.persistence.hyindicators.IndScorecardRepository
;
import
com.keymobile.indicators.service.cmbkpi.IndAcsDefService
;
import
com.keymobile.indicators.utils.CalculateUtils
;
@Service
...
...
@@ -35,7 +34,7 @@ public class IndScorecardService {
@Autowired
private
DriveIndCalResultRepository
driveIndResultRepo
;
@Autowired
private
IndAcsDefService
indAcs
DefService
;
private
DriveIndDefService
driveInd
DefService
;
//id不为空为修改,为空为新增
public
String
saveOrUpdate
(
IndScorecard
indScorecard
)
{
...
...
@@ -62,7 +61,7 @@ public class IndScorecardService {
}
public
Map
<
String
,
String
>
calculateIndiScore
(
String
indId
,
int
date
,
String
compareObj
,
String
indScorecardId
,
String
compareId
,
List
<
String
>
compareObjs
)
{
String
indScorecardId
,
String
compareId
,
List
<
String
>
compareObjs
)
throws
Exception
{
Map
<
String
,
String
>
result
=
new
HashMap
<>();
String
indScoreValue
=
"0.0"
;
String
indImproveScoreValue
=
"0.0"
;
...
...
@@ -74,10 +73,10 @@ public class IndScorecardService {
IndScorecard
scoreCard
=
this
.
findById
(
indScorecardId
);
double
baseScoreValue
=
0
;
if
(
scoreCard
!=
null
)
{
IndAcsDef
acsDef
=
indAcs
DefService
.
getById
(
indId
);
DriveIndDef
driveIndDef
=
driveInd
DefService
.
getById
(
indId
);
//获取指标是正向还是反向类型
String
acsType
=
acs
Def
.
getIndType
();
String
unit
=
acsDef
.
getUn
t
();
String
acsType
=
driveInd
Def
.
getIndType
();
String
unit
=
driveIndDef
.
getIndUni
t
();
List
<
DriveIndCalResult
>
currentDriveResult
=
driveIndResultRepo
.
findByIndIdAndDateAndCompareId
(
indId
,
date
,
compareId
,
...
...
@@ -166,20 +165,24 @@ public class IndScorecardService {
}
}
//改善提升
//同期
Optional
<
DriveIndCalResult
>
sameCompareObjResult
=
driveIndResultRepo
.
findByIndIdAndDateAndCompareObj
(
indId
,
(
date
-
100
),
compareObj
);
if
(
sameCompareObjResult
.
isPresent
())
{
double
improveScore
=
this
.
calImproveValue
(
acsType
,
unit
,
scoreCard
.
getImproveScoreItem
(),
currentCompareObjResult
.
get
(),
sameCompareObjResult
.
get
(),
compareObjs
);
if
(
scoreCard
.
getLimitScore
()!=
0
)
{
if
(
improveScore
>
scoreCard
.
getLimitScore
())
{
improveScore
=
scoreCard
.
getLimitScore
();
if
(
"1"
.
equals
(
scoreCard
.
getIsIncluScore
()))
{
//纳入单位得分计算
//同期
Optional
<
DriveIndCalResult
>
sameCompareObjResult
=
driveIndResultRepo
.
findByIndIdAndDateAndCompareObj
(
indId
,
(
date
-
100
),
compareObj
);
if
(
sameCompareObjResult
.
isPresent
())
{
double
improveScore
=
this
.
calImproveValue
(
acsType
,
unit
,
scoreCard
.
getImproveScoreItem
(),
currentCompareObjResult
.
get
(),
sameCompareObjResult
.
get
(),
compareObjs
);
if
(
scoreCard
.
getLimitScore
()!=
0
)
{
if
(
improveScore
>
scoreCard
.
getLimitScore
())
{
improveScore
=
scoreCard
.
getLimitScore
();
}
}
indImproveScoreValue
=
String
.
format
(
"%.4f"
,
new
BigDecimal
(
improveScore
));
result
.
put
(
"improveScore"
,
indImproveScoreValue
);
}
indImproveScoreValue
=
String
.
format
(
"%.4f"
,
new
BigDecimal
(
improveScore
));
result
.
put
(
"improveScore"
,
indImproveScoreValue
);
}
else
{
result
.
put
(
"improveScore"
,
"No"
);
//表示不纳入单位得分计算标识
}
}
}
else
{
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/IndicatorsValueService.java
View file @
d7fe37f7
This diff is collapsed.
Click to expand it.
src/main/java/com/keymobile/indicators/service/hytobacco/ScoreRuleService.java
0 → 100644
View file @
d7fe37f7
package
com
.
keymobile
.
indicators
.
service
.
hytobacco
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Optional
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.keymobile.indicators.model.entity.DriveIndCalResult
;
import
com.keymobile.indicators.model.entity.indicators.DriveIndDef
;
import
com.keymobile.indicators.model.entity.objscorerule.IndTypeWeight
;
import
com.keymobile.indicators.model.entity.objscorerule.ScoreRule
;
import
com.keymobile.indicators.model.mapper.indicators.DriveIndDefMapper
;
import
com.keymobile.indicators.persistence.hyindicators.DriveIndCalResultRepository
;
import
com.keymobile.indicators.persistence.hyindicators.ScoreRuleRepository
;
import
com.keymobile.indicators.utils.CalculateUtils
;
@Service
public
class
ScoreRuleService
{
private
Logger
logger
=
LoggerFactory
.
getLogger
(
ScoreRuleService
.
class
);
@Autowired
private
ScoreRuleRepository
scoreRuleRepo
;
@Autowired
private
DriveIndCalResultRepository
driveIndCalResultRepo
;
@Autowired
private
DriveIndDefMapper
driveIndDefMapper
;
public
String
save
(
ScoreRule
scoreRule
)
{
scoreRule
=
scoreRuleRepo
.
save
(
scoreRule
);
return
scoreRule
.
getId
();
}
public
void
delete
(
String
id
)
{
scoreRuleRepo
.
deleteById
(
id
);
}
public
List
<
ScoreRule
>
getAll
(
String
code
){
return
scoreRuleRepo
.
findByCode
(
code
);
}
public
ScoreRule
getById
(
String
id
)
{
Optional
<
ScoreRule
>
scoreRule
=
scoreRuleRepo
.
findById
(
id
);
if
(
scoreRule
.
isPresent
())
{
return
scoreRule
.
get
();
}
return
null
;
}
//计算组内考核指标平均值
private
Map
<
String
,
String
>
calGroupIndAverage
(
ScoreRule
scoreRule
,
List
<
String
>
indIds
,
String
compareObj
,
int
date
){
Map
<
String
,
String
>
result
=
new
HashMap
<>();
result
.
put
(
"compareObj"
,
compareObj
);
result
.
put
(
"scoreValue"
,
"0.0"
);
result
.
put
(
"improveValue"
,
"0.0"
);
result
.
put
(
"date"
,
String
.
valueOf
(
date
));
//根据日期,对标对象和考核的指标获取考核指标结果详情
List
<
DriveIndCalResult
>
calResults
=
driveIndCalResultRepo
.
findByCompareObjAndDateAndIndIdIn
(
compareObj
,
date
,
indIds
);
List
<
String
>
values
=
new
ArrayList
<>();
List
<
String
>
improveValues
=
new
ArrayList
<>();
if
(!
calResults
.
isEmpty
())
{
for
(
DriveIndCalResult
calResult
:
calResults
)
{
//得分类型:0 指标值直接参与计算
if
(
"0"
.
equals
(
scoreRule
.
getScoreType
()))
{
values
.
add
(
calResult
.
getValue
());
}
else
if
(
"1"
.
equals
(
scoreRule
.
getScoreType
()))
{
//1 指标得分分数参与计算(综合评分和改善提升分开算)
values
.
add
(
calResult
.
getScore
());
if
(!
"No"
.
equals
(
calResult
.
getImproveScore
()))
{
improveValues
.
add
(
calResult
.
getImproveScore
());
}
}
else
{
//2指标得分分数参与计算(指标分数=综合+改善)
if
(!
"No"
.
equals
(
calResult
.
getImproveScore
()))
{
double
indScore
=
Double
.
valueOf
(
calResult
.
getScore
());
double
improveScore
=
Double
.
valueOf
(
calResult
.
getImproveScore
());
double
sum
=
indScore
+
improveScore
;
values
.
add
(
String
.
valueOf
(
sum
));
}
else
{
values
.
add
(
calResult
.
getScore
());
}
}
}
//计算平均值
String
averageValue
=
CalculateUtils
.
averageValue
(
values
,
0
);
String
averageImproveValue
=
"0.0"
;
if
(!
improveValues
.
isEmpty
())
{
averageImproveValue
=
CalculateUtils
.
averageValue
(
improveValues
,
0
);
}
result
.
put
(
"scoreValue"
,
averageValue
);
result
.
put
(
"improveValue"
,
averageImproveValue
);
}
return
result
;
}
//按照指标类别进行分类分别计算平均分后再跟类别权重相乘后相加得到最终分数
private
Map
<
String
,
String
>
calIndCatalogTypeAverage
(
ScoreRule
scoreRule
,
String
compareObj
,
int
date
){
Map
<
String
,
String
>
result
=
new
HashMap
<>();
result
.
put
(
"compareObj"
,
compareObj
);
result
.
put
(
"scoreValue"
,
"0.0"
);
result
.
put
(
"improveValue"
,
"0.0"
);
result
.
put
(
"date"
,
String
.
valueOf
(
date
));
//根据对标对象,日期查找该对标对象对标的所有指标结果
List
<
DriveIndCalResult
>
calResults
=
driveIndCalResultRepo
.
findByCompareObjAndDate
(
compareObj
,
date
);
double
scoreValue
=
0.0
;
double
improveValue
=
0.0
;
if
(!
scoreRule
.
getIndTypeWeights
().
isEmpty
())
{
for
(
IndTypeWeight
indTypeWeight
:
scoreRule
.
getIndTypeWeights
())
{
Map
<
String
,
Double
>
calScores
=
this
.
calIndTypeScore
(
scoreRule
,
indTypeWeight
,
calResults
);
scoreValue
+=
(
calScores
.
get
(
"score"
)*
Double
.
valueOf
(
indTypeWeight
.
getWeight
()));
improveValue
+=
(
calScores
.
get
(
"improve"
)*
Double
.
valueOf
(
indTypeWeight
.
getWeight
()));
}
}
result
.
put
(
"scoreValue"
,
String
.
valueOf
(
scoreValue
));
result
.
put
(
"improveValue"
,
String
.
valueOf
(
improveValue
));
return
result
;
}
//根据指标分类计算指标平均值
private
Map
<
String
,
Double
>
calIndTypeScore
(
ScoreRule
scoreRule
,
IndTypeWeight
indTypeWeight
,
List
<
DriveIndCalResult
>
calResults
)
{
Map
<
String
,
Double
>
result
=
new
HashMap
<>();
result
.
put
(
"score"
,
0.0
);
result
.
put
(
"improve"
,
0.0
);
List
<
String
>
values
=
new
ArrayList
<>();
List
<
String
>
improveValues
=
new
ArrayList
<>();
for
(
DriveIndCalResult
calResult
:
calResults
)
{
String
catalogIdPath
=
indTypeWeight
.
getCatalogIdPath
();
//根据考核指标id获取考核指标
DriveIndDef
driveIndDef
=
driveIndDefMapper
.
selectByPrimaryKey
(
calResult
.
getIndId
());
if
(
driveIndDef
!=
null
)
{
//如果考核指标是参与单位计分的
if
(
"1"
.
equals
(
driveIndDef
.
getIsUnitCalScore
()))
{
//如果指标是该指标分类下的
if
(
indTypeWeight
.
getCatalogIdPath
().
indexOf
(
catalogIdPath
)>=
0
)
{
//得分类型:0 指标值直接参与计算
if
(
"0"
.
equals
(
scoreRule
.
getScoreType
()))
{
values
.
add
(
calResult
.
getValue
());
}
else
if
(
"1"
.
equals
(
scoreRule
.
getScoreType
()))
{
//1 指标得分分数参与计算(综合评分和改善提升分开算)
values
.
add
(
calResult
.
getScore
());
if
(!
"No"
.
equals
(
calResult
.
getImproveScore
()))
{
improveValues
.
add
(
calResult
.
getImproveScore
());
}
}
else
{
//2指标得分分数参与计算(指标分数=综合+改善)
if
(!
"No"
.
equals
(
calResult
.
getImproveScore
()))
{
double
indScore
=
Double
.
valueOf
(
calResult
.
getScore
());
double
improveScore
=
Double
.
valueOf
(
calResult
.
getImproveScore
());
double
sum
=
indScore
+
improveScore
;
values
.
add
(
String
.
valueOf
(
sum
));
}
else
{
values
.
add
(
calResult
.
getScore
());
}
}
}
}
}
}
//计算平均值
String
averageValue
=
CalculateUtils
.
averageValue
(
values
,
0
);
String
averageImproveValue
=
"0.0"
;
if
(!
improveValues
.
isEmpty
())
{
averageImproveValue
=
CalculateUtils
.
averageValue
(
improveValues
,
0
);
}
result
.
put
(
"score"
,
Double
.
valueOf
(
averageValue
));
result
.
put
(
"improve"
,
Double
.
valueOf
(
averageImproveValue
));
return
result
;
}
//根据单位评分规则计算单位分数
public
void
calObjScore
(
String
reportId
,
String
compareId
,
List
<
String
>
indIds
,
List
<
String
>
compareObjs
,
int
date
,
String
scoreRuleId
)
{
List
<
Map
<
String
,
String
>>
results
=
new
ArrayList
<>();
//根据单位得分评分卡id获取评分卡详情
ScoreRule
scoreRule
=
this
.
getById
(
scoreRuleId
);
if
(
scoreRule
!=
null
)
{
for
(
String
compareObj
:
compareObjs
)
{
//根据对标对象,日期查找该对标对象对标的所有指标结果
List
<
DriveIndCalResult
>
calResults
=
driveIndCalResultRepo
.
findByCompareObjAndDate
(
compareObj
,
date
);
if
(!
calResults
.
isEmpty
())
{
Map
<
String
,
String
>
resultMap
=
new
HashMap
<>();
//计算类型:0 计算组内所有考核指标平均数
if
(
"0"
.
equals
(
scoreRule
.
getCalType
()))
{
resultMap
=
this
.
calGroupIndAverage
(
scoreRule
,
indIds
,
compareObj
,
date
);
}
else
{
//1 根据目录类别分类算平均分后根据权重计算考核指标
resultMap
=
this
.
calIndCatalogTypeAverage
(
scoreRule
,
compareObj
,
date
);
}
resultMap
.
put
(
"reportId"
,
reportId
);
resultMap
.
put
(
"compareId"
,
compareId
);
results
.
add
(
resultMap
);
}
}
}
else
{
logger
.
info
(
"单位评分卡id:"
+
scoreRuleId
+
" 不存在"
);
}
System
.
out
.
println
(
results
);
}
}
src/main/java/com/keymobile/indicators/service/indicators/DeriveIndicatorsService.java
deleted
100644 → 0
View file @
8495a010
//package com.keymobile.indicators.service.indicators;
//
//import java.util.ArrayList;
//import java.util.Date;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//import java.util.Optional;
//
//import org.apache.commons.lang.StringUtils;
//import org.mariuszgromada.math.mxparser.Expression;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Service;
//
//import com.keymobile.indicators.model.indicators.DeriveIndicators;
//import com.keymobile.indicators.model.indicators.IndicatorsDef;
//import com.keymobile.indicators.model.indicators.IndicatorsDim;
//import com.keymobile.indicators.persistence.indicators.DeriveIndicatorsRepository;
//import com.keymobile.indicators.persistence.indicators.IndicatorsDefRepository;
//import com.keymobile.indicators.persistence.indicators.IndicatorsDimRepository;
//
//@Service
//public class DeriveIndicatorsService {
// private Logger logger = LoggerFactory.getLogger(DeriveIndicatorsService.class);
//
// @Autowired
// private DeriveIndicatorsRepository derIndicatorsRepo;
// @Autowired
// private IndicatorsDimRepository indicatorsDimRepo;
// @Autowired
// private IndicatorsService indicatorsService;
// @Autowired
// private IndicatorsDefRepository indicatorsDefRepo;
//
// //新增/修改衍生指标
// public String saveOrUpdate(DeriveIndicators derIndicators,String operator)throws Exception {
// //新增
// if(StringUtils.isBlank(derIndicators.getId())) {
// derIndicators.setCreateTime(new Date());
// derIndicators.setCreator(operator);
// derIndicators.setUpdateTime(new Date());
// derIndicators.setUpdator(operator);
// }else {
// derIndicators.setUpdateTime(new Date());
// derIndicators.setUpdator(operator);
// }
// derIndicators.setStatus("0");
// if(StringUtils.isBlank(derIndicators.getDimNames())) {
// derIndicators.setDimNames("地区;年份");
// }
// derIndicatorsRepo.save(derIndicators);
// return derIndicators.getId();
// }
//
// //删除衍生指标
// public void delete(String id) throws Exception{
// derIndicatorsRepo.deleteById(id);
// }
//
// //获取衍生列表
// public List<DeriveIndicators> getDerIndicatorsList(String keyword)throws Exception{
// if(StringUtils.isBlank(keyword)) {
// return derIndicatorsRepo.findAll();
// }
// return derIndicatorsRepo.findByDerNameLikeOrDerCnNameLike(keyword, keyword);
// }
//
// //获取衍生指标详情
// public DeriveIndicators getDerIndicatorsDetail(String id) throws Exception{
// Optional<DeriveIndicators> deriveIndi = derIndicatorsRepo.findById(id);
// if(deriveIndi.isPresent()) {
// return deriveIndi.get();
// }
// return null;
// }
//
// //根据衍生指标关联的原生指标获取共同的维度
// public List<String> getSameDim(String indiDefIdString) throws Exception{
// if(indiDefIdString.endsWith(";")) {
// indiDefIdString = indiDefIdString.substring(0, indiDefIdString.length()-1);
// }
// String[] indiDefIds = indiDefIdString.split(";");
// List<String> retainList = new ArrayList<>();
// for(int i=0;i<indiDefIds.length;i++) {
// //根据原生指标定义id获取维度名称
// List<String> dimNameList = this.getIndiDefDimNames(indiDefIds[i]);
// if(i==0) {
// if(dimNameList.isEmpty()) {
// break;
// }else {
// retainList.addAll(dimNameList);
// continue;
// }
// }
// retainList.retainAll(dimNameList);
// if(retainList.isEmpty()) {
// break;
// }
// }
// return retainList;
// }
//
// //计算衍生指标值
// public double calculateDeriveIndicators(String derIndiId,Map<String,Object> dimValues) throws Exception{
// //根据衍生指标id获取衍生指标
// Optional<DeriveIndicators> derIndicators = derIndicatorsRepo.findById(derIndiId);
// //获取衍生指标计算公式
// String derFormula = derIndicators.get().getDerFormula();
// logger.info("未替换公式:"+derFormula);
//
// //获取衍生指标关联的原生指标id
// String indiDefIdsString = derIndicators.get().getIndiDefIds();
// if(indiDefIdsString.endsWith(";")) {
// indiDefIdsString = indiDefIdsString.substring(0, indiDefIdsString.length()-1);
// }
// String[] indiDefIds = indiDefIdsString.split(";");
// for(String indiDefId : indiDefIds) {
// Map<String,Object> resultMap = indicatorsService.queryIndicatorsValue(indiDefId, dimValues, true);
// Object count = resultMap.get("count");
// //替换公式中的原生指标id为对应的值
// derFormula = derFormula.replace(indiDefId, count.toString());
// }
// logger.info("替换后的公式:"+derFormula);
//
// Expression e = new Expression(derFormula);
//
// double result = (double) Math.round((e.calculate()) * 100) / 100;
// return result;
// }
//
// public Map<String,Object> getIndicatorsReport(String StandardUnitId,
// String compareIndiIds,List<String> compareDims,String year) throws Exception{
// Map<String,Object> reportMap = new HashMap<>();
// reportMap.put("StandardUnitId", StandardUnitId);
//
// //拆分年份维度
// String[] yearDim = year.split(":");
//
// if(compareIndiIds.endsWith(";")) {
// compareIndiIds = compareIndiIds.substring(0, compareIndiIds.length()-1);
// }
// String[] compareIndiId = compareIndiIds.split(";");
//
// List<Map<String,Object>> indiReportList = new ArrayList<>();
// for(String indiId : compareIndiId) {
// Map<String,Object> indiReport = new HashMap<>();
// String[] inId = indiId.split(":");
// //如果是原生指标
// if("0".equals(inId[1])) {
// //根据原生指标id获取原生指标详情
// Optional<IndicatorsDef> indiDef = indicatorsDefRepo.findById(inId[0]);
// indiReport.put("indicatorsName", indiDef.get().getIndiCnName());
//
// List<Map<String,Object>> resultList = new ArrayList<>();
//
// String unit = indiDef.get().getIndiUnit();
// for(String compareDim : compareDims) {
// if(compareDim.endsWith(";")) {
// compareDim = compareDim.substring(0, compareDim.length()-1);
// }
// String[] compDim = compareDim.split(":");
// String dimCnName = compDim[0];
// String[] dimValues = compDim[1].split(";");
// for(String dimValue : dimValues) {
// Map<String,Object> queryMap = new HashMap<>();
// queryMap.put(dimCnName, dimValue);
// queryMap.put(yearDim[0],yearDim[1]);
//
// Map<String,Object> resultMap = new HashMap<>();
// resultMap.put("dimValue", dimValue);
// resultMap.put("unit", unit);
// Map<String,Object> result = indicatorsService.queryIndicatorsValue(
// inId[0], queryMap, true);
// resultMap.put("result", result.get("count"));
//
// resultList.add(resultMap);
// }
// }
// indiReport.put("resultList", resultList);
//
// indiReportList.add(indiReport);
// }else {
// //根据衍生指标id获取衍生指标详情
// Optional<DeriveIndicators> derIndicators = derIndicatorsRepo.findById(inId[0]);
// indiReport.put("indicatorsName", derIndicators.get().getDerCnName());
//
// List<Map<String,Object>> resultList = new ArrayList<>();
//
// //获取单位
// String unit = derIndicators.get().getDerUnit();
// for(String compareDim : compareDims) {
// if(compareDim.endsWith(";")) {
// compareDim = compareDim.substring(0, compareDim.length()-1);
// }
// String[] compDim = compareDim.split(":");
// String dimCnName = compDim[0];
// String[] dimValues = compDim[1].split(";");
// for(String dimValue : dimValues) {
// Map<String,Object> queryMap = new HashMap<>();
// queryMap.put(dimCnName, dimValue);
// queryMap.put(yearDim[0],yearDim[1]);
//
// Map<String,Object> resultMap = new HashMap<>();
// resultMap.put("dimValue", dimValue);
// resultMap.put("unit", unit);
// double result = this.calculateDeriveIndicators(inId[0], queryMap);
// resultMap.put("result", result);
//
// resultList.add(resultMap);
// }
// }
// indiReport.put("resultList", resultList);
//
// indiReportList.add(indiReport);
// }
// }
// reportMap.put("report", indiReportList);
// return reportMap;
// }
//
// private List<String> getIndiDefDimNames(String indiDefId){
// List<String> result = new ArrayList<>();
// List<IndicatorsDim> dims = indicatorsDimRepo.findByIndiDefId(indiDefId);
// for(IndicatorsDim dim : dims) {
// result.add(dim.getDimMappingName());
// }
// return result;
// }
//}
src/main/java/com/keymobile/indicators/service/indicators/IndicatorsExcelService.java
deleted
100644 → 0
View file @
8495a010
//package com.keymobile.indicators.service.indicators;
//
//import java.text.DecimalFormat;
//import java.text.SimpleDateFormat;
//import java.util.ArrayList;
//import java.util.HashMap;
//import java.util.List;
//import java.util.Map;
//
//import org.apache.commons.lang.StringUtils;
//import org.apache.poi.hssf.usermodel.HSSFDateUtil;
//import org.apache.poi.xssf.usermodel.XSSFRow;
//import org.apache.poi.xssf.usermodel.XSSFSheet;
//import org.apache.poi.xssf.usermodel.XSSFWorkbook;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Service;
//
//import com.keymobile.indicators.conf.MongoDBConfig;
//import com.keymobile.indicators.model.indicators.IndicatorsDef;
//import com.keymobile.indicators.model.indicators.IndicatorsDim;
//import com.mongodb.BasicDBObject;
//import com.mongodb.DB;
//import com.mongodb.DBCollection;
//import com.mongodb.DBObject;
//import com.mongodb.MongoClient;
//
//@Service
//public class IndicatorsExcelService {
//
// private Logger logger = LoggerFactory.getLogger(IndicatorsExcelService.class);
// @Autowired
// private MongoDBConfig mongoDbConfig;
//
// @Value("${mongodb.database}")
// private String database;
//
// //获取上传文件的excel头
// public Map<String,Object> getUploadExcelHead(XSSFWorkbook xssfWorkbook)throws Exception{
// int startDataRow = 0;//开始读excel数据的行号
// Map<String,Object> result = new HashMap<>();
// List<Map<String,Object>> cellDetailList = new ArrayList<>();
// List<String> cellList = new ArrayList<>();
// result.put("cellDetailList", cellDetailList);
// result.put("cellList", cellList);
// for(XSSFSheet excelSheet : xssfWorkbook) {
// XSSFRow xssfRow = excelSheet.getRow(startDataRow);
// int i = 0;
// while(StringUtils.isNotBlank(this.getCellValue(i,xssfRow))) {
// Map<String,Object> excelHead = new HashMap<>();
// excelHead.put("name", this.getCellValue(i,xssfRow));
// excelHead.put("index", i);
// cellDetailList.add(excelHead);
// cellList.add(this.getCellValue(i,xssfRow));
// i++;
// }
// break;
// }
// result.put("cellDetailList", cellDetailList);
// result.put("cellList", cellList);
// return result;
// }
//
// public String importIndicatorsData(IndicatorsDef indiDef,List<IndicatorsDim> dimList,
// XSSFWorkbook xssfWorkbook)throws Exception{
// StringBuilder message = new StringBuilder("");
// List<DBObject> datas = new ArrayList<>();
// //excel读取
// int startDataRow = 1;//开始读excel数据的行号
// for(XSSFSheet excelSheet : xssfWorkbook) {
// //抽取工作表内容
// for (int rowNum = startDataRow; rowNum <= excelSheet.getLastRowNum(); rowNum++) {
// /*创建DBObject对象,通过该对象来向集合中添加记录 */
// DBObject doc = new BasicDBObject();
// doc.put("inId", indiDef.getId());
//
// XSSFRow xssfRow = excelSheet.getRow(rowNum);
//
// //获取值映射列index
// int indiValueMapping = indiDef.getValueMapping();
// String indiValue = getCellValue(indiValueMapping,xssfRow);//指标值
// if(StringUtils.isBlank(indiValue)) {
// break;
// }
// doc.put("value", indiValue);
// doc.put("status", "1");//未生效(待审批)
// for(IndicatorsDim dim : dimList) {
// //获取映射名
// String dimName = dim.getDimName();
// //获取映射index
// int indiDimMapping = dim.getDimMapping();
// String dimValue = getCellValue(indiDimMapping,xssfRow);//维度值
// doc.put(dimName,dimValue);
// }
// datas.add(doc);
// }
// }
// if(!datas.isEmpty()) {
// this.addIndicatorData(datas);
// }
// return message.toString();
// }
//
// //
//
// private void addIndicatorData(List<DBObject> datas) throws Exception{
// MongoClient client = mongoDbConfig.mongoClient();
// /* 新建数据库实例,有则使用已有的数据库,没有则准别新建 */
// DB dataBase = client.getDB(database);
//
// /* 新建集合命名为user_info,如果该集合存在,则使用。否则新建 */
// DBCollection collection = dataBase.getCollection("indi_data");
//
// collection.insert(datas);
//
// client.close();
// }
//
// //获取列值
// private String getCellValue(int cellIndex,XSSFRow xssfRow) {
// String cellValue = "";
// try {
// //如果是字符串列
// cellValue = xssfRow.getCell(cellIndex) == null ?
// "" : xssfRow.getCell(cellIndex).getStringCellValue();
// } catch (Exception e) {
// try {
// if(HSSFDateUtil.isCellDateFormatted(xssfRow.getCell(cellIndex))) {
// //如果是日期
// SimpleDateFormat sdf = new SimpleDateFormat("yyyy/MM/dd");
// cellValue = sdf.format(xssfRow.getCell(cellIndex).getDateCellValue());// 日期
// }else {
// //如果是数据列
// DecimalFormat decimalFormat = new DecimalFormat("###################.###########");
// cellValue = xssfRow.getCell(cellIndex) == null ?
// "" : String.valueOf(decimalFormat.format(xssfRow.getCell(cellIndex).getNumericCellValue()));
// }
// } catch (Exception e2) {
// try {
// cellValue = xssfRow.getCell(cellIndex) == null ?
// "" : xssfRow.getCell(cellIndex).getCellFormula();
// } catch (Exception e3) {
// cellValue = xssfRow.getCell(cellIndex) == null ?
// "" : String.valueOf(xssfRow.getCell(cellIndex).getBooleanCellValue());
// }
// }
// }
// return cellValue;
// }
//}
src/main/java/com/keymobile/indicators/service/indicators/IndicatorsService.java
deleted
100644 → 0
View file @
8495a010
This diff is collapsed.
Click to expand it.
src/main/java/com/keymobile/indicators/utils/CalculateUtils.java
View file @
d7fe37f7
...
...
@@ -56,7 +56,8 @@ public class CalculateUtils {
//将map中的无效值挑出来
for
(
Entry
<
String
,
String
>
entry
:
valueMap
.
entrySet
())
{
if
(
"NaN"
.
equals
(
entry
.
getValue
())||
"0(Error)"
.
equals
(
entry
.
getValue
())
||
"0.0000"
.
equals
(
entry
.
getValue
())
||
"0"
.
equals
(
entry
.
getValue
()))
{
||
"0.0000"
.
equals
(
entry
.
getValue
())
||
"0"
.
equals
(
entry
.
getValue
())
||
""
.
equals
(
entry
.
getValue
()))
{
invalidMap
.
put
(
entry
.
getKey
(),
entry
.
getValue
());
}
else
{
compareMap
.
put
(
entry
.
getKey
(),
Double
.
valueOf
(
entry
.
getValue
()));
...
...
@@ -117,17 +118,26 @@ public class CalculateUtils {
}
//计算平均值
public
static
String
averageValue
(
List
<
String
>
values
)
{
public
static
String
averageValue
(
List
<
String
>
values
,
int
type
)
{
String
calValue
=
"0.0"
;
StringBuilder
formula
=
new
StringBuilder
();
if
(!
values
.
isEmpty
())
{
int
size
=
values
.
size
();
formula
.
append
(
"("
);
for
(
int
i
=
0
;
i
<
values
.
size
();
i
++)
{
if
(
"NaN"
.
equals
(
values
.
get
(
i
))
||
"0(Error)"
.
equals
(
values
.
get
(
i
))
||
"0.0000"
.
equals
(
values
.
get
(
i
))
||
"0"
.
equals
(
values
.
get
(
i
)))
{
size
-=
1
;
continue
;
if
(
type
==
0
)
{
if
(
"NaN"
.
equals
(
values
.
get
(
i
))
||
"0(Error)"
.
equals
(
values
.
get
(
i
))
||
"0.0000"
.
equals
(
values
.
get
(
i
))
||
"0"
.
equals
(
values
.
get
(
i
))
||
""
.
equals
(
values
.
get
(
i
)))
{
size
-=
1
;
continue
;
}
}
else
{
if
(
"NaN"
.
equals
(
values
.
get
(
i
))
||
"0(Error)"
.
equals
(
values
.
get
(
i
))
||
""
.
equals
(
values
.
get
(
i
)))
{
size
-=
1
;
continue
;
}
}
if
(
i
==
values
.
size
()-
1
)
{
//最后一个不加+号
formula
.
append
(
"("
).
append
(
values
.
get
(
i
)).
append
(
")"
);
...
...
@@ -202,14 +212,14 @@ public class CalculateUtils {
// // 输出的是6.333333333333333
// System.out.println(AviatorEvaluator.execute("F004/F002*100", env));
List
<
String
>
values
=
new
ArrayList
<>();
values
.
add
(
"0"
);
values
.
add
(
"18"
);
values
.
add
(
"18"
);
values
.
add
(
"17.2837"
);
CalculateUtils
cal
=
new
CalculateUtils
();
String
average
=
cal
.
sumValue
(
values
);
System
.
out
.
println
(
average
);
//
List<String> values = new ArrayList<>();
//
values.add("0");
//
values.add("18");
//
values.add("18");
//
values.add("17.2837");
//
CalculateUtils cal = new CalculateUtils();
//
String average = cal.sumValue(values);
//
System.out.println(average);
// Map<String,String> map = new HashMap<>();
// map.put("1", "NaN");
...
...
@@ -223,5 +233,9 @@ public class CalculateUtils {
// CalculateUtils cal = new CalculateUtils();
// Map<String,Integer> result = cal.rankValue(map, "1");
// System.out.println(result);
String
version
=
"1.0"
;
double
anoterVersion
=
Double
.
valueOf
(
version
)+
1
;
System
.
out
.
println
(
String
.
valueOf
(
anoterVersion
));
}
}
src/main/resources/mybatis/mapping/BaseIndDefMapper.xml
0 → 100644
View file @
d7fe37f7
<?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.indicators.BaseIndDefMapper"
>
<select
id=
"getPageByKeyword"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.indicators.BaseIndDef"
>
select *
from base_ind_def
where 1=1
<if
test=
"catalogId!=null"
>
and catalog_id = #{catalogId}
</if>
<if
test=
"keyword!=null"
>
and (ind_name like #{keyword} or ind_id like #{keyword})
</if>
limit #{start},#{end}
</select>
<select
id=
"getByKeywordCount"
parameterType=
"map"
resultType=
"java.lang.Integer"
>
select count(1)
from base_ind_def
where 1=1
<if
test=
"catalogId!=null"
>
and catalog_id = #{catalogId}
</if>
<if
test=
"keyword!=null"
>
and (ind_name like #{keyword} or ind_id like #{keyword})
</if>
</select>
<delete
id=
"deleteByCatalogIdIn"
parameterType=
"java.util.List"
>
delete
from base_ind_def
where catalog_id in
<foreach
item=
"id"
collection=
"list"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/DriveIndDefMapper.xml
0 → 100644
View file @
d7fe37f7
<?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.indicators.DriveIndDefMapper"
>
<select
id=
"getPageByKeyword"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.indicators.DriveIndDef"
>
select *
from drive_ind_def
where 1=1
<if
test=
"catalogId!=null"
>
and catalog_id = #{catalogId}
</if>
<if
test=
"keyword!=null"
>
and (ind_name like #{keyword} or ind_id like #{keyword})
</if>
limit #{start},#{end}
</select>
<select
id=
"getByKeywordCount"
parameterType=
"map"
resultType=
"java.lang.Integer"
>
select count(1)
from drive_ind_def
where 1=1
<if
test=
"catalogId!=null"
>
and catalog_id = #{catalogId}
</if>
<if
test=
"keyword!=null"
>
and (ind_name like #{keyword} or ind_id like #{keyword})
</if>
</select>
<delete
id=
"deleteByCatalogIdIn"
parameterType=
"java.util.List"
>
delete
from drive_ind_def
where catalog_id in
<foreach
item=
"id"
collection=
"list"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/GeneralParmMapper.xml
deleted
100644 → 0
View file @
8495a010
<?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.GeneralParmMapper"
>
<select
id=
"getAll"
resultType=
"com.keymobile.indicators.model.entity.GeneralParm"
>
select * from gen_general_parm
</select>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/IndAcsDataMapper.xml
deleted
100644 → 0
View file @
8495a010
<?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.IndAcsDataMapper"
>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/IndAcsDefMapper.xml
deleted
100644 → 0
View file @
8495a010
<?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.IndAcsDefMapper"
>
<select
id=
"getAll"
resultType=
"com.keymobile.indicators.model.entity.IndAcsDef"
>
select * from ind_acs_ind_def_inf
</select>
<select
id=
"getPageByKeyword"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.IndAcsDef"
>
select * from ind_acs_ind_def_inf
<if
test=
"keyword!=null"
>
where ind_name like #{keyword} or ind_id like #{keyword}
</if>
limit #{start},#{end}
</select>
<select
id=
"getByKeywordCount"
parameterType=
"map"
resultType=
"java.lang.Integer"
>
select count(1) from ind_acs_ind_def_inf
<if
test=
"keyword!=null"
>
where ind_name like #{keyword} or ind_id like #{keyword}
</if>
</select>
<select
id=
"getByKeyword"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.IndAcsDef"
>
select * from ind_acs_ind_def_inf
<if
test=
"keyword!=null"
>
where ind_name like #{keyword} or ind_id like #{keyword}
</if>
</select>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/IndAcsScoreInfoMapper.xml
deleted
100644 → 0
View file @
8495a010
<?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.IndAcsScoreInfoMapper"
>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/IndAnaDataMapper.xml
deleted
100644 → 0
View file @
8495a010
<?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.IndAnaDataMapper"
>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/IndAnaDefMapper.xml
deleted
100644 → 0
View file @
8495a010
<?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.IndAnaDefMapper"
>
<select
id=
"getPageByKeyword"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.IndAnaDef"
>
select * from ind_ana_ind_def_inf
<if
test=
"keyword!=null"
>
where ind_name like #{keyword} or ind_id like #{keyword}
</if>
limit #{start},#{end}
</select>
<select
id=
"getByKeywordCount"
parameterType=
"map"
resultType=
"java.lang.Integer"
>
select count(1) from ind_ana_ind_def_inf
<if
test=
"keyword!=null"
>
where ind_name like #{keyword} or ind_id like #{keyword}
</if>
</select>
<select
id=
"getByKeyword"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.IndAnaDef"
>
select * from ind_ana_ind_def_inf
<if
test=
"keyword!=null"
>
where ind_name like #{keyword} or ind_id like #{keyword}
</if>
</select>
</mapper>
\ No newline at end of file
src/main/resources/mybatis/mapping/IndRelInfMapper.xml
deleted
100644 → 0
View file @
8495a010
<?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.IndRelInfMapper"
>
</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