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
fe345cd8
Commit
fe345cd8
authored
Feb 14, 2023
by
dengwei
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
权重配置管理功能新增
parent
c422a57c
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
416 additions
and
1 deletion
+416
-1
ObjScoreIndWeightCfgCtrl.java
...le/indicators/api/hytobacco/ObjScoreIndWeightCfgCtrl.java
+87
-0
Constants.java
...ain/java/com/keymobile/indicators/constant/Constants.java
+5
-0
ObjScoreIndWeightCfg.java
...ymobile/indicators/model/entity/ObjScoreIndWeightCfg.java
+69
-0
ObjScoreIndWeightCfgMapper.java
...s/model/mapper/indicators/ObjScoreIndWeightCfgMapper.java
+60
-0
ObjScoreIndWeightCfgService.java
...obile/indicators/service/ObjScoreIndWeightCfgService.java
+61
-0
IndScorecardService.java
...ile/indicators/service/hytobacco/IndScorecardService.java
+1
-0
ObjScoreIndWeightCfgServiceImpl.java
...icators/service/impl/ObjScoreIndWeightCfgServiceImpl.java
+73
-0
ModelPathEnum.java
...in/java/com/keymobile/indicators/utils/ModelPathEnum.java
+3
-1
ObjScoreIndWeightCfgMapper.xml
.../resources/mybatis/mapping/ObjScoreIndWeightCfgMapper.xml
+57
-0
No files found.
src/main/java/com/keymobile/indicators/api/hytobacco/ObjScoreIndWeightCfgCtrl.java
0 → 100644
View file @
fe345cd8
package
com
.
keymobile
.
indicators
.
api
.
hytobacco
;
import
com.keymobile.indicators.constant.Constants
;
import
com.keymobile.indicators.model.entity.ObjScoreIndWeightCfg
;
import
com.keymobile.indicators.result.Result
;
import
com.keymobile.indicators.service.ObjScoreIndWeightCfgService
;
import
com.keymobile.indicators.utils.LogManager
;
import
com.keymobile.indicators.utils.SystemUserUtil
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiParam
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.web.bind.annotation.GetMapping
;
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
java.util.Date
;
import
java.util.List
;
/**
* @author DW
* @date 2023-02-10-0010 9:59
* @description
*/
@Api
(
tags
={
"数据填报-权重配置"
})
@RestController
@RequestMapping
(
value
=
"/weightCfg"
)
@Slf4j
public
class
ObjScoreIndWeightCfgCtrl
{
@Autowired
private
ObjScoreIndWeightCfgService
weightCfgService
;
@ApiOperation
(
"分页查询权重配置信息"
)
@GetMapping
(
"/findByPage"
)
public
Page
<
ObjScoreIndWeightCfg
>
findByPage
(
@ApiParam
(
"搜索关键字(名字)"
)
@RequestParam
(
value
=
"keyword"
,
required
=
false
)
String
keyword
,
@ApiParam
(
"页码,从1开始"
)
@RequestParam
(
value
=
"page"
,
defaultValue
=
"1"
)
int
page
,
@ApiParam
(
"每页条数"
)
@RequestParam
(
value
=
"pageSize"
,
defaultValue
=
"10"
)
int
pageSize
,
@ApiParam
(
"机构编号"
)
@RequestParam
(
value
=
"orgNo"
,
required
=
false
)
String
orgNo
)
{
LogManager
.
logInfo
(
Constants
.
LOG_INDICATOR_WEIGHTCFG_API
,
"根据参数分页查询权重配置信息{}"
,
keyword
);
return
weightCfgService
.
findByPage
(
page
,
pageSize
,
keyword
,
orgNo
);
}
@ApiOperation
(
value
=
"新增/修改"
,
notes
=
"新增/修改"
)
@PostMapping
(
value
=
"/saveOrUpdate"
)
public
Result
saveOrUpdate
(
@RequestBody
ObjScoreIndWeightCfg
weightCfg
){
String
message
;
Date
now
=
new
Date
();
String
currentUserId
=
SystemUserUtil
.
getCurrentUserId
();
weightCfg
.
setUpdater
(
currentUserId
);
weightCfg
.
setUpdateTime
(
now
);
if
(
weightCfg
.
getId
()
==
null
||
weightCfg
.
getId
()
==
0
)
{
message
=
"新增权重配置信息:{}"
;
weightCfg
.
setCreator
(
currentUserId
);
weightCfg
.
setCreateTime
(
now
);
weightCfgService
.
createWeight
(
weightCfg
);
}
else
{
message
=
"修改权重配置信息:{}"
;
ObjScoreIndWeightCfg
cfg
=
weightCfgService
.
getById
(
weightCfg
.
getId
());
weightCfg
.
setCreator
(
cfg
.
getCreator
());
weightCfg
.
setCreateTime
(
cfg
.
getCreateTime
());
weightCfgService
.
updateWeight
(
weightCfg
);
}
LogManager
.
logInfo
(
Constants
.
LOG_INDICATOR_WEIGHTCFG_API
,
message
,
weightCfg
.
getName
());
return
Result
.
genOkResult
(
weightCfg
);
}
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除"
)
@PostMapping
(
value
=
"/delete"
)
public
Result
delete
(
@RequestParam
List
<
Integer
>
ids
)
{
StringBuilder
message
=
new
StringBuilder
();
List
<
ObjScoreIndWeightCfg
>
weightCfgs
=
weightCfgService
.
findByIdList
(
ids
);
for
(
ObjScoreIndWeightCfg
weightCfg
:
weightCfgs
)
{
message
.
append
(
weightCfg
.
getName
()).
append
(
";"
);
}
weightCfgService
.
delete
(
ids
);
LogManager
.
logInfo
(
Constants
.
LOG_INDICATOR_WEIGHTCFG_API
,
"删除权重配置信息:{}"
,
message
.
toString
());
return
Result
.
genOkResult
();
}
}
src/main/java/com/keymobile/indicators/constant/Constants.java
View file @
fe345cd8
...
@@ -56,6 +56,11 @@ public class Constants {
...
@@ -56,6 +56,11 @@ public class Constants {
public
static
final
String
LOG_INDICATOR_SHORTBOARD_AUDIT_API
=
"indicator.shortboardaudit"
;
public
static
final
String
LOG_INDICATOR_SHORTBOARD_AUDIT_API
=
"indicator.shortboardaudit"
;
/**
/**
* 权重配置
*/
public
static
final
String
LOG_INDICATOR_WEIGHTCFG_API
=
"indicator.weightcfg"
;
/**
*短板管理结果汇总
*短板管理结果汇总
**/
**/
public
static
final
String
LOG_INDICATOR_SHORTBOARD_RESULT_API
=
"indicator.shortboardresult"
;
public
static
final
String
LOG_INDICATOR_SHORTBOARD_RESULT_API
=
"indicator.shortboardresult"
;
...
...
src/main/java/com/keymobile/indicators/model/entity/ObjScoreIndWeightCfg.java
0 → 100644
View file @
fe345cd8
package
com
.
keymobile
.
indicators
.
model
.
entity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.GenerationType
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.math.BigDecimal
;
/**
* @author DW
* @date 2023-02-09-0009 9:57
* @description 权重配置实体类
*/
@Data
@Table
(
name
=
"obj_score_ind_weight_cfg"
)
@ApiModel
(
"权重配置"
)
public
class
ObjScoreIndWeightCfg
extends
BaseModel
{
@Id
@GeneratedValue
(
strategy
=
GenerationType
.
IDENTITY
)
private
Integer
id
;
// 主键
@ApiModelProperty
(
value
=
"配置名称"
)
private
String
name
;
// 配置名称
@ApiModelProperty
(
value
=
"配置级别"
)
private
String
levelName
;
// 配置级别
@ApiModelProperty
(
value
=
"配置周期"
)
private
String
dateValue
;
// 配置周期
@ApiModelProperty
(
value
=
"对标主体分组ID"
)
private
String
orgGroupId
;
// 对标主体分组ID
@ApiModelProperty
(
value
=
"对标主体分组名称"
)
private
String
orgGroupName
;
// 对标主体分组名称
@ApiModelProperty
(
value
=
"指标ID"
)
private
String
indIds
;
// 指标ID
@ApiModelProperty
(
value
=
"指标名称"
)
private
String
indNames
;
// 指标名称
@ApiModelProperty
(
value
=
"两烟区大类权重"
)
private
BigDecimal
weightTwo
;
// 两烟区大类权重
@ApiModelProperty
(
value
=
"两烟区单位"
)
private
String
weightTwoUnit
;
// 两烟区单位
@ApiModelProperty
(
value
=
"纯销区大类权重"
)
private
BigDecimal
weightOne
;
// 纯销区大类权重
@ApiModelProperty
(
value
=
"纯销区单位"
)
private
String
weightOneUnit
;
// 纯销区单位
@ApiModelProperty
(
value
=
"租户组织CODE,区分不同单位"
)
private
String
code
;
// 租户组织CODE,区分不同单位
@ApiModelProperty
(
value
=
"所属组织机构"
)
private
String
orgNo
;
// 所属组织机构
@ApiModelProperty
(
value
=
"备注"
)
private
String
remark
;
// 备注
}
src/main/java/com/keymobile/indicators/model/mapper/indicators/ObjScoreIndWeightCfgMapper.java
0 → 100644
View file @
fe345cd8
package
com
.
keymobile
.
indicators
.
model
.
mapper
.
indicators
;
import
com.keymobile.indicators.model.entity.ObjScoreIndWeightCfg
;
import
org.apache.ibatis.annotations.Mapper
;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.common.BaseMapper
;
import
java.util.List
;
@Mapper
public
interface
ObjScoreIndWeightCfgMapper
extends
BaseMapper
<
ObjScoreIndWeightCfg
>
{
/**
* 根据id获取权重配置
* @param id 主键ID
* @return 权重配置内容
*/
ObjScoreIndWeightCfg
getById
(
Integer
id
);
/**
* 根据id删除权重配置
* @param id 主键id
*/
void
deleteById
(
Integer
id
);
/**
* 批量删除权重配置
* @param ids
*/
void
deleteByIdIn
(
@Param
(
"ids"
)
List
<
Integer
>
ids
);
/**
* 分页查询
* @param keyword
* @param start
* @param pageSize
* @param orgNo
* @return
*/
List
<
ObjScoreIndWeightCfg
>
findByPage
(
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"start"
)
long
start
,
@Param
(
"pageSize"
)
int
pageSize
,
@Param
(
"orgNo"
)
String
orgNo
);
/**
* 查询权重配置记录数
* @param keyword
* @param orgNo
* @return
*/
long
findCount
(
@Param
(
"keyword"
)
String
keyword
,
@Param
(
"orgNo"
)
String
orgNo
);
/**
* 根据id集合查询权重配置
* @param ids
* @return
*/
List
<
ObjScoreIndWeightCfg
>
findByIdList
(
List
<
Integer
>
ids
);
}
src/main/java/com/keymobile/indicators/service/ObjScoreIndWeightCfgService.java
0 → 100644
View file @
fe345cd8
package
com
.
keymobile
.
indicators
.
service
;
import
com.keymobile.indicators.model.entity.ObjScoreIndWeightCfg
;
import
org.springframework.data.domain.Page
;
import
java.util.List
;
/**
* 权重管理
*/
public
interface
ObjScoreIndWeightCfgService
{
/**
* 根据id删除权重配置
* @param id 主键ID
*/
void
deleteById
(
Integer
id
);
/**
* 根据id获取权重配置
* @param id 主键ID
*/
ObjScoreIndWeightCfg
getById
(
Integer
id
);
/**
* 分页查询
* @param page
* @param pageSize
* @param keyword
* @param orgNo
* @return
*/
Page
<
ObjScoreIndWeightCfg
>
findByPage
(
Integer
page
,
Integer
pageSize
,
String
keyword
,
String
orgNo
);
/**
* 新增权重配置
* @param weightCfg
*/
void
createWeight
(
ObjScoreIndWeightCfg
weightCfg
);
/**
* 更新权重配置
* @param weightCfg
*/
void
updateWeight
(
ObjScoreIndWeightCfg
weightCfg
);
/**
* 批量删除
* @param ids
* @return
*/
void
delete
(
List
<
Integer
>
ids
);
/**
* 根据id集合查询权重配置
* @param ids
* @return
*/
List
<
ObjScoreIndWeightCfg
>
findByIdList
(
List
<
Integer
>
ids
);
}
src/main/java/com/keymobile/indicators/service/hytobacco/IndScorecardService.java
View file @
fe345cd8
...
@@ -680,6 +680,7 @@ public class IndScorecardService {
...
@@ -680,6 +680,7 @@ public class IndScorecardService {
if
(
"2"
.
equals
(
section
[
7
])){
if
(
"2"
.
equals
(
section
[
7
])){
//不按比例。满才加分 去掉小数点取整
//不按比例。满才加分 去掉小数点取整
// TODO: 2023-02-09-0009 目前为小数向下取整,可能需要改成向上取整 -- 向上取整方法Math.ceil
scopeValue
=
Math
.
floor
(
scopeValue
);
scopeValue
=
Math
.
floor
(
scopeValue
);
}
}
//判断是加还是减
//判断是加还是减
...
...
src/main/java/com/keymobile/indicators/service/impl/ObjScoreIndWeightCfgServiceImpl.java
0 → 100644
View file @
fe345cd8
package
com
.
keymobile
.
indicators
.
service
.
impl
;
import
com.keymobile.indicators.constant.Constants
;
import
com.keymobile.indicators.model.entity.ObjScoreIndWeightCfg
;
import
com.keymobile.indicators.model.mapper.indicators.ObjScoreIndWeightCfgMapper
;
import
com.keymobile.indicators.service.ObjScoreIndWeightCfgService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.domain.Page
;
import
org.springframework.data.domain.PageImpl
;
import
org.springframework.data.domain.PageRequest
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author DW
* @date 2023-02-09-0009 14:59
* @description
*/
@Service
public
class
ObjScoreIndWeightCfgServiceImpl
implements
ObjScoreIndWeightCfgService
{
@Autowired
private
ObjScoreIndWeightCfgMapper
weightCfgMapper
;
@Override
public
void
deleteById
(
Integer
id
)
{
weightCfgMapper
.
deleteById
(
id
);
}
@Override
public
ObjScoreIndWeightCfg
getById
(
Integer
id
)
{
return
weightCfgMapper
.
getById
(
id
);
}
@Override
public
Page
<
ObjScoreIndWeightCfg
>
findByPage
(
Integer
page
,
Integer
pageSize
,
String
keyword
,
String
orgNo
)
{
long
total
=
weightCfgMapper
.
findCount
(
keyword
,
orgNo
);
PageRequest
request
=
PageRequest
.
of
(
page
-
1
,
pageSize
);
List
<
ObjScoreIndWeightCfg
>
list
=
new
ArrayList
<>();
if
(
total
>
0
)
{
list
=
weightCfgMapper
.
findByPage
(
keyword
,
request
.
getOffset
(),
pageSize
,
orgNo
);
}
return
new
PageImpl
<
ObjScoreIndWeightCfg
>(
list
,
request
,
total
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
createWeight
(
ObjScoreIndWeightCfg
weightCfg
)
{
weightCfg
.
setState
(
Constants
.
DATA_STATE_A
);
weightCfgMapper
.
insert
(
weightCfg
);
}
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
updateWeight
(
ObjScoreIndWeightCfg
weightCfg
)
{
weightCfg
.
setState
(
Constants
.
DATA_STATE_A
);
weightCfgMapper
.
updateByPrimaryKey
(
weightCfg
);
}
@Override
public
void
delete
(
List
<
Integer
>
ids
)
{
weightCfgMapper
.
deleteByIdIn
(
ids
);
}
@Override
public
List
<
ObjScoreIndWeightCfg
>
findByIdList
(
List
<
Integer
>
ids
)
{
return
weightCfgMapper
.
findByIdList
(
ids
);
}
}
src/main/java/com/keymobile/indicators/utils/ModelPathEnum.java
View file @
fe345cd8
...
@@ -24,7 +24,9 @@ public enum ModelPathEnum {
...
@@ -24,7 +24,9 @@ public enum ModelPathEnum {
LOG_INDICATOR_CONFIG_INFO
(
"indicator.config.info"
,
"系统管理/配置项管理"
),
LOG_INDICATOR_CONFIG_INFO
(
"indicator.config.info"
,
"系统管理/配置项管理"
),
LOG_INDICATOR_LOG
(
"indicator.log"
,
"系统管理/操作日志"
),
LOG_INDICATOR_LOG
(
"indicator.log"
,
"系统管理/操作日志"
),
LOG_INDICATOR_AUDIT_ROLE_API
(
"indicator.audit.role"
,
"系统管理/填报审核角色配置管理 "
);
LOG_INDICATOR_AUDIT_ROLE_API
(
"indicator.audit.role"
,
"系统管理/填报审核角色配置管理 "
),
LOG_INDICATOR_WEIGHTCFG_API
(
"indicator.weightcfg"
,
"数据填报/权重配置"
);
private
String
modelName
;
private
String
modelName
;
private
String
modelPath
;
private
String
modelPath
;
...
...
src/main/resources/mybatis/mapping/ObjScoreIndWeightCfgMapper.xml
0 → 100644
View file @
fe345cd8
<?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.ObjScoreIndWeightCfgMapper"
>
<select
id=
"getById"
parameterType=
"java.lang.Integer"
resultType=
"com.keymobile.indicators.model.entity.ObjScoreIndWeightCfg"
>
select * from obj_score_ind_weight_cfg weight
where weight.id = #{id}
</select>
<delete
id=
"deleteById"
parameterType=
"java.lang.Integer"
>
update obj_score_ind_weight_cfg weight
set weight.state = 3
where weight.id = #{id}
</delete>
<select
id=
"findByPage"
resultType=
"com.keymobile.indicators.model.entity.ObjScoreIndWeightCfg"
>
select * from obj_score_ind_weight_cfg weight
<include
refid=
"findWhereSql"
/>
order by weight.update_time desc, weight.name asc
limit #{start}, #{pageSize}
</select>
<sql
id=
"findWhereSql"
>
where weight.state = 1
<if
test=
"keyword != null and keyword != ''"
>
and weight.name like concat('%', #{keyword}, '%')
</if>
<if
test=
"orgNo != null and orgNo != ''"
>
and weight.org_no = #{orgNo}
</if>
</sql>
<select
id=
"findCount"
resultType=
"long"
>
select count(1) from obj_score_ind_weight_cfg as weight
<include
refid=
"findWhereSql"
/>
</select>
<select
id=
"findByIdList"
resultType=
"com.keymobile.indicators.model.entity.ObjScoreIndWeightCfg"
>
select *
from obj_score_ind_weight_cfg as weight
where id in
<foreach
item=
"id"
collection=
"ids"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</select>
<delete
id=
"deleteByIdIn"
parameterType=
"java.util.List"
>
update obj_score_ind_weight_cfg weight
set weight.state = 3
where id in
<foreach
item=
"id"
collection=
"ids"
open=
"("
close=
")"
separator=
","
>
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment