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
1b455519
Commit
1b455519
authored
Dec 28, 2020
by
hzc
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改基础指标删除的限制条件,去掉基础指标目录机构编码条件
parent
0248de02
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
94 additions
and
34 deletions
+94
-34
IndCatalogCtrl.java
...om/keymobile/indicators/api/hytobacco/IndCatalogCtrl.java
+19
-6
IndCatalogMapper.java
...e/indicators/model/mapper/indmapper/IndCatalogMapper.java
+15
-3
IndicatorsRelMapper.java
...ndicators/model/mapper/indmapper/IndicatorsRelMapper.java
+7
-0
BaseIndDefService.java
...obile/indicators/service/hytobacco/BaseIndDefService.java
+3
-3
IndCatalogService.java
...obile/indicators/service/hytobacco/IndCatalogService.java
+15
-3
IndicatorsRelService.java
...le/indicators/service/hytobacco/IndicatorsRelService.java
+10
-0
IndicatorsReportService.java
...le/indicators/service/report/IndicatorsReportService.java
+2
-2
IndCatalogMapper.xml
src/main/resources/mybatis/mapping/IndCatalogMapper.xml
+17
-17
IndicatorsRelMapper.xml
src/main/resources/mybatis/mapping/IndicatorsRelMapper.xml
+6
-0
No files found.
src/main/java/com/keymobile/indicators/api/hytobacco/IndCatalogCtrl.java
View file @
1b455519
...
...
@@ -60,25 +60,38 @@ public class IndCatalogCtrl {
indCatalogService
.
recursionDelete
(
ids
);
LogManager
.
logInfo
(
Constants
.
LOG_INDICATOR_BASE_INDI_API
,
"删除基础项目录:{}"
,
message
.
toString
());
}
/**
* mapper注释codes条件
* @Date 2020/12/28 11:04
* @Author hzc
**/
@ApiOperation
(
value
=
"获取基础指标目录"
,
notes
=
"获取基础指标目录"
)
@PostMapping
(
value
=
"/getBaseIndCatalog"
)
public
List
<
IndCatalog
>
getBaseIndCatalog
(
@RequestParam
(
required
=
false
)
Integer
parentId
,
@RequestParam
List
<
String
>
codes
){
@RequestParam
(
required
=
false
)
List
<
String
>
codes
){
return
indCatalogService
.
getCatalog
(
parentId
,
codes
);
}
/**
* mapper注释codes条件
* @Date 2020/12/28 11:04
* @Author hzc
**/
@ApiOperation
(
value
=
"根据关键字搜索获取基础指标目录"
,
notes
=
"根据关键字搜索获取基础指标目录"
)
@PostMapping
(
value
=
"/getBaseIndCatalogByKeyword"
)
public
List
<
IndCatalog
>
getBaseIndCatalogByKeyword
(
@RequestParam
(
required
=
false
)
String
keyword
,
@RequestParam
List
<
String
>
codes
){
@RequestParam
(
required
=
false
)
List
<
String
>
codes
){
return
indCatalogService
.
getCatalogByKeyword
(
keyword
,
codes
);
}
/**
* mapper注释codes条件
* @Date 2020/12/28 11:04
* @Author hzc
**/
@ApiOperation
(
value
=
"获取第一个有效的基础目录节点"
,
notes
=
"获取第一个有效的基础目录节点"
)
@PostMapping
(
value
=
"/getFirstVaildBaseIndCatalog"
)
public
IndCatalog
getFirstVaildBaseIndCatalog
(
@RequestParam
Integer
pid
,
@RequestParam
List
<
String
>
codes
){
@RequestParam
(
required
=
false
)
List
<
String
>
codes
){
return
indCatalogService
.
getFirstVaildCatalog
(
pid
,
codes
);
}
...
...
src/main/java/com/keymobile/indicators/model/mapper/indmapper/IndCatalogMapper.java
View file @
1b455519
...
...
@@ -13,13 +13,25 @@ import tk.mybatis.mapper.common.BaseMapper;
public
interface
IndCatalogMapper
extends
BaseMapper
<
IndCatalog
>{
public
void
deleteByIdIn
(
@Param
(
"ids"
)
List
<
Integer
>
ids
);
/**
* mapper注释codes条件
* @Date 2020/12/28 11:04
* @Author hzc
**/
public
List
<
IndCatalog
>
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
Map
<
String
,
Object
>
params
);
public
List
<
IndCatalog
>
findByParentId
(
@Param
(
"pid"
)
Integer
pid
);
/**
* mapper注释codes条件
* @Date 2020/12/28 11:04
* @Author hzc
**/
public
List
<
IndCatalog
>
findByKeyword
(
Map
<
String
,
Object
>
params
);
/**
* mapper注释codes条件
* @Date 2020/12/28 11:04
* @Author hzc
**/
public
List
<
IndCatalog
>
findFirstVaildCatalog
(
Map
<
String
,
Object
>
params
);
public
List
<
IndCatalog
>
findByCatalogIdIn
(
@Param
(
"ids"
)
List
<
Integer
>
ids
);
...
...
src/main/java/com/keymobile/indicators/model/mapper/indmapper/IndicatorsRelMapper.java
View file @
1b455519
...
...
@@ -14,4 +14,11 @@ public interface IndicatorsRelMapper extends BaseMapper<IndicatorsRel>{
public
List
<
IndicatorsRel
>
findByIndId
(
@Param
(
"indId"
)
String
indId
);
public
void
deleteByIndId
(
@Param
(
"indId"
)
String
indId
);
/**
* 通过关联指标id查询
* @Param [relIndId]
* @Date 2020/12/28 9:31
* @Author hzc
**/
List
<
IndicatorsRel
>
selectByRelIndId
(
@Param
(
"relIndId"
)
String
relIndId
);
}
src/main/java/com/keymobile/indicators/service/hytobacco/BaseIndDefService.java
View file @
1b455519
...
...
@@ -6,6 +6,8 @@ import java.util.HashMap;
import
java.util.List
;
import
java.util.Map
;
import
com.keymobile.indicators.model.entity.indicators.IndicatorsRel
;
import
com.keymobile.indicators.model.mapper.indmapper.IndicatorsRelMapper
;
import
org.apache.commons.lang.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
...
...
@@ -24,7 +26,6 @@ public class BaseIndDefService {
private
IndicatorsRelService
indRelService
;
@Autowired
private
DriveIndDefService
driveIndDefService
;
public
String
saveOrUpdate
(
BaseIndDef
baseIndDef
,
Integer
catalogId
,
String
catalogIdPath
,
String
user
,
String
isUpdate
,
String
code
)
throws
Exception
{
...
...
@@ -88,8 +89,7 @@ public class BaseIndDefService {
StringBuilder
message
=
new
StringBuilder
(
""
);
List
<
String
>
canDeleteList
=
new
ArrayList
<>();
for
(
String
indId
:
indIds
)
{
if
(
driveIndDefService
.
getByIndFormatLike
(
indId
).
isEmpty
()&&
this
.
getByIndFormatLike
(
indId
).
isEmpty
())
{
//基础项都没有关联指标才能删除
if
(
indRelService
.
selectByRelIndId
(
indId
).
isEmpty
())
{
//基础项都没有关联指标才能删除
canDeleteList
.
add
(
indId
);
}
else
{
BaseIndDef
baseIndDef
=
this
.
getById
(
indId
);
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/IndCatalogService.java
View file @
1b455519
...
...
@@ -86,7 +86,11 @@ public class IndCatalogService {
baseIndDefMapper
.
deleteByCatalogIdIn
(
result
);
}
}
/**
* mapper注释codes条件
* @Date 2020/12/28 11:04
* @Author hzc
**/
//获取目录树
public
List
<
IndCatalog
>
getCatalog
(
Integer
parentId
,
List
<
String
>
codes
){
Map
<
String
,
Object
>
paramMap
=
new
HashMap
<>();
...
...
@@ -94,7 +98,11 @@ public class IndCatalogService {
paramMap
.
put
(
"codes"
,
codes
);
return
indCatalogMapper
.
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
(
paramMap
);
}
/**
* mapper注释codes条件
* @Date 2020/12/28 11:04
* @Author hzc
**/
//根据目录树获取
public
List
<
IndCatalog
>
getCatalogByKeyword
(
String
keyword
,
List
<
String
>
codes
){
if
(
StringUtils
.
isBlank
(
keyword
))
{
...
...
@@ -105,7 +113,11 @@ public class IndCatalogService {
params
.
put
(
"codes"
,
codes
);
return
indCatalogMapper
.
findByKeyword
(
params
);
}
/**
* mapper注释codes条件
* @Date 2020/12/28 11:04
* @Author hzc
**/
//获取第一个有效目录节点
public
IndCatalog
getFirstVaildCatalog
(
Integer
pid
,
List
<
String
>
codes
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
...
...
src/main/java/com/keymobile/indicators/service/hytobacco/IndicatorsRelService.java
View file @
1b455519
...
...
@@ -189,4 +189,14 @@ public class IndicatorsRelService {
}
}
}
/**
* 通过关联指标id查询
* @Param [relIndId]
* @Date 2020/12/28 9:31
* @Author hzc
**/
public
List
<
IndicatorsRel
>
selectByRelIndId
(
String
relIndId
)
{
return
indicatorsRelMapper
.
selectByRelIndId
(
relIndId
);
}
}
src/main/java/com/keymobile/indicators/service/report/IndicatorsReportService.java
View file @
1b455519
...
...
@@ -141,7 +141,7 @@ public class IndicatorsReportService {
paramMap
.
put
(
"compareObjs"
,
compareObjs
);
log
.
info
(
"开始清除报表三数据:date={},type={},code={},compareObjs={}"
,
date
,
type
,
code
,
compareObjs
);
reportThreeMapper
.
deleteByParam
(
paramMap
);
log
.
info
(
"开始清除报表四数据:compareCatalog={}
"
,
compareCatalog
);
log
.
info
(
"开始清除报表四数据:compareCatalog={}
,date={}"
,
compareCatalog
,
date
);
indicatorsReportFourMapper
.
deleteByCompareCatalog
(
compareCatalog
,
date
);
}
else
{
...
...
@@ -252,7 +252,7 @@ public class IndicatorsReportService {
indReportData
.
setEffectiveIndCount
(
indReportData
.
getEffectiveIndCount
()+
1
);
}
//保存同期值
//保存同期值
报表四
indicatorsReportFour
.
setSameValue
(
sameCalResult
.
getValue
());
//算增幅
if
(!
"NaN"
.
equals
(
sameCalResult
.
getValue
())
...
...
src/main/resources/mybatis/mapping/IndCatalogMapper.xml
View file @
1b455519
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.keymobile.indicators.model.mapper.indmapper.IndCatalogMapper"
>
<delete
id=
"deleteByIdIn"
parameterType=
"java.util.List"
>
<delete
id=
"delete
findByParentIdAndCodeInOrderByLastUpdateTimeDesc
ByIdIn"
parameterType=
"java.util.List"
>
delete
from base_ind_catalog
where id in
...
...
@@ -13,11 +13,11 @@
<select
id=
"findByParentIdAndCodeInOrderByLastUpdateTimeDesc"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.indicators.IndCatalog"
>
select *
from base_ind_catalog
where parent_id = #{pid}
and
code in
<foreach
item=
"id"
collection=
"codes"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach
>
where parent_id = #{pid}
<!-- and code in-->
<!-- <foreach item="id" collection="codes" open="(" close=")" separator=",">--
>
<!-- #{id}-->
<!-- </foreach>--
>
order by last_update_time desc
</select>
...
...
@@ -30,22 +30,22 @@
<select
id=
"findByKeyword"
parameterType=
"map"
resultType=
"com.keymobile.indicators.model.entity.indicators.IndCatalog"
>
select *
from base_ind_catalog
where catalog_name like #{keyword}
and
code in
<foreach
item=
"id"
collection=
"codes"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach
>
where catalog_name like #{keyword}
<!-- and code in-->
<!-- <foreach item="id" collection="codes" open="(" close=")" separator=",">--
>
<!-- #{id}-->
<!-- </foreach>--
>
</select>
<select
id=
"findFirstVaildCatalog"
resultType=
"com.keymobile.indicators.model.entity.indicators.IndCatalog"
>
select *
from base_ind_catalog
where id_path like #{pidPath} and
catalog_type = '1'
and
code in
<foreach
item=
"id"
collection=
"codes"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach
>
where id_path like #{pidPath} and
catalog_type = '1'
<!-- and code in-->
<!-- <foreach item="id" collection="codes" open="(" close=")" separator=",">--
>
<!-- #{id}-->
<!-- </foreach>--
>
order by last_update_time desc
</select>
...
...
src/main/resources/mybatis/mapping/IndicatorsRelMapper.xml
View file @
1b455519
...
...
@@ -12,4 +12,9 @@
from ind_relation
where ind_id = #{indId}
</delete>
<select
id=
"selectByRelIndId"
resultType=
"com.keymobile.indicators.model.entity.indicators.IndicatorsRel"
>
select *
from ind_relation
where rel_ind_id = #{relIndId}
</select>
</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