resultScore 和resultDetail增加字段
This commit is contained in:
parent
59550c4dfb
commit
7685db0d7a
@ -727,6 +727,19 @@ public class ResultRecordController extends AbstractController {
|
||||
List<ResultScore> insertScores = new ArrayList<>();
|
||||
List<ResultScore> updateScores = new ArrayList<>();
|
||||
|
||||
List<ResultDetail> resultDetails = resultDetailService.selectByRecordId(dto.getId());
|
||||
Map<Long, ResultDetail> mapDetails =
|
||||
resultDetails.stream().collect(Collectors.toMap(ResultDetail::getId, Function.identity(), (e, r) -> e));
|
||||
|
||||
//获取当前绩效的节点
|
||||
boolean isSetKeyResult = false;
|
||||
List<FlowRecord> flowRecords = flowRecordService.selectFlowRecordByRecordIdStatus(dto.getId(), 2);
|
||||
if(flowRecords.size() > 0){
|
||||
if(flowRecords.get(0).getFlowProcess().intValue() == 0){
|
||||
//指定目标中
|
||||
isSetKeyResult = true;
|
||||
}
|
||||
}
|
||||
|
||||
for (ResultRecortModelDto model:dto.getRecortModelDtos()
|
||||
) {
|
||||
@ -739,6 +752,10 @@ public class ResultRecordController extends AbstractController {
|
||||
) {//排序
|
||||
ResultDetail resultDetail = new ResultDetail();
|
||||
BeanUtils.copyProperties(detailDto, resultDetail);
|
||||
if(!isSetKeyResult && resultDetail.getId() != null && mapDetails.containsKey(resultDetail.getId())){
|
||||
//这里判断是否有更新,或者删除
|
||||
|
||||
}
|
||||
resultDetail.setPriority(index);
|
||||
|
||||
index++;
|
||||
|
||||
@ -12,7 +12,7 @@ import java.util.Date;
|
||||
* <p>
|
||||
* </p>*业绩详情评分表
|
||||
* @author quyixiao
|
||||
* @since 2020-11-12
|
||||
* @since 2020-12-03
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ -46,6 +46,9 @@ public class ResultScore implements java.io.Serializable {
|
||||
//评分权重
|
||||
@ApiModelProperty(value = "评分权重", name = "weight")
|
||||
private BigDecimal weight;
|
||||
//根据权重计算除的实际得分
|
||||
@ApiModelProperty(value = "根据权重计算除的实际得分", name = "score")
|
||||
private BigDecimal score;
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
@ -181,6 +184,21 @@ public class ResultScore implements java.io.Serializable {
|
||||
this.weight = weight;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据权重计算除的实际得分
|
||||
* @return
|
||||
*/
|
||||
public BigDecimal getScore() {
|
||||
return score;
|
||||
}
|
||||
/**
|
||||
* 根据权重计算除的实际得分
|
||||
* @param score
|
||||
*/
|
||||
public void setScore(BigDecimal score) {
|
||||
this.score = score;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "ResultScore{" +
|
||||
@ -193,6 +211,7 @@ public class ResultScore implements java.io.Serializable {
|
||||
",approvalId=" + approvalId +
|
||||
",scoreComment=" + scoreComment +
|
||||
",weight=" + weight +
|
||||
",score=" + score +
|
||||
"}";
|
||||
}
|
||||
}
|
||||
@ -12,7 +12,7 @@ import java.util.Date;
|
||||
* <p>
|
||||
* </p>*业绩详情表
|
||||
* @author quyixiao
|
||||
* @since 2020-11-17
|
||||
* @since 2020-12-03
|
||||
*/
|
||||
|
||||
@Data
|
||||
@ -31,6 +31,12 @@ public class ResultDetail implements java.io.Serializable {
|
||||
//最后修改时间
|
||||
@ApiModelProperty(value = "最后修改时间", name = "gmtModified")
|
||||
private Date gmtModified;
|
||||
//备份id,本表得id
|
||||
@ApiModelProperty(value = "备份id,本表得id", name = "backId")
|
||||
private Long backId;
|
||||
//是否为备份,0非备份,1备份值
|
||||
@ApiModelProperty(value = "是否为备份,0非备份,1备份值", name = "isBack")
|
||||
private Integer isBack;
|
||||
//1,业绩,2文化价值观
|
||||
@ApiModelProperty(value = "1,业绩,2文化价值观", name = "type")
|
||||
private Integer type;
|
||||
@ -133,6 +139,36 @@ public class ResultDetail implements java.io.Serializable {
|
||||
this.gmtModified = gmtModified;
|
||||
}
|
||||
|
||||
/**
|
||||
* 备份id,本表得id
|
||||
* @return
|
||||
*/
|
||||
public Long getBackId() {
|
||||
return backId;
|
||||
}
|
||||
/**
|
||||
* 备份id,本表得id
|
||||
* @param backId
|
||||
*/
|
||||
public void setBackId(Long backId) {
|
||||
this.backId = backId;
|
||||
}
|
||||
|
||||
/**
|
||||
* 是否为备份,0非备份,1备份值
|
||||
* @return
|
||||
*/
|
||||
public Integer getIsBack() {
|
||||
return isBack;
|
||||
}
|
||||
/**
|
||||
* 是否为备份,0非备份,1备份值
|
||||
* @param isBack
|
||||
*/
|
||||
public void setIsBack(Integer isBack) {
|
||||
this.isBack = isBack;
|
||||
}
|
||||
|
||||
/**
|
||||
* 1,业绩,2文化价值观
|
||||
* @return
|
||||
@ -350,6 +386,8 @@ public class ResultDetail implements java.io.Serializable {
|
||||
",isDelete=" + isDelete +
|
||||
",gmtCreate=" + gmtCreate +
|
||||
",gmtModified=" + gmtModified +
|
||||
",backId=" + backId +
|
||||
",isBack=" + isBack +
|
||||
",type=" + type +
|
||||
",target=" + target +
|
||||
",keyResult=" + keyResult +
|
||||
|
||||
@ -8,6 +8,8 @@
|
||||
<result column="is_delete" property="isDelete"/>
|
||||
<result column="gmt_create" property="gmtCreate"/>
|
||||
<result column="gmt_modified" property="gmtModified"/>
|
||||
<result column="back_id" property="backId"/>
|
||||
<result column="is_back" property="isBack"/>
|
||||
<result column="type" property="type"/>
|
||||
<result column="target" property="target"/>
|
||||
<result column="key_result" property="keyResult"/>
|
||||
@ -27,7 +29,7 @@
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, type AS type, target AS target, key_result AS keyResult, key_result_3_5 AS keyResult35, key_result_3_7 AS keyResult37, check_weight AS checkWeight, check_result AS checkResult, super_score AS superScore, acquire_score AS acquireScore, score_comment AS scoreComment, record_id AS recordId, staff_id AS staffId, priority AS priority, model_id AS modelId
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, back_id AS backId, is_back AS isBack, type AS type, target AS target, key_result AS keyResult, key_result_3_5 AS keyResult35, key_result_3_7 AS keyResult37, check_weight AS checkWeight, check_result AS checkResult, super_score AS superScore, acquire_score AS acquireScore, score_comment AS scoreComment, record_id AS recordId, staff_id AS staffId, priority AS priority, model_id AS modelId
|
||||
</sql>
|
||||
|
||||
|
||||
@ -40,6 +42,8 @@
|
||||
|
||||
<insert id="insertResultDetail" parameterType="ResultDetail" useGeneratedKeys="true" keyProperty="id" >
|
||||
insert into lz_result_detail(
|
||||
<if test="backId != null">back_id, </if>
|
||||
<if test="isBack != null">is_back, </if>
|
||||
<if test="type != null">type, </if>
|
||||
<if test="target != null">target, </if>
|
||||
<if test="keyResult != null">key_result, </if>
|
||||
@ -58,6 +62,8 @@
|
||||
gmt_create,
|
||||
gmt_modified
|
||||
)values(
|
||||
<if test="backId != null">#{ backId}, </if>
|
||||
<if test="isBack != null">#{ isBack}, </if>
|
||||
<if test="type != null">#{ type}, </if>
|
||||
<if test="target != null">#{ target}, </if>
|
||||
<if test="keyResult != null">#{ keyResult}, </if>
|
||||
@ -85,6 +91,8 @@
|
||||
<trim prefix="set" suffixOverrides=",">
|
||||
<if test="isDelete != null">is_delete = #{isDelete},</if>
|
||||
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
|
||||
<if test="backId != null">back_id = #{backId},</if>
|
||||
<if test="isBack != null">is_back = #{isBack},</if>
|
||||
<if test="type != null">type = #{type},</if>
|
||||
<if test="target != null">target = #{target},</if>
|
||||
<if test="keyResult != null">key_result = #{keyResult},</if>
|
||||
@ -111,6 +119,8 @@
|
||||
set
|
||||
is_delete = #{isDelete},
|
||||
gmt_create = #{gmtCreate},
|
||||
back_id = #{backId},
|
||||
is_back = #{isBack},
|
||||
type = #{type},
|
||||
target = #{target},
|
||||
key_result = #{keyResult},
|
||||
@ -125,7 +135,7 @@
|
||||
staff_id = #{staffId},
|
||||
priority = #{priority},
|
||||
model_id = #{modelId}
|
||||
,gmt_modified = now()
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
@ -13,12 +13,13 @@
|
||||
<result column="approval_id" property="approvalId"/>
|
||||
<result column="score_comment" property="scoreComment"/>
|
||||
<result column="weight" property="weight"/>
|
||||
<result column="score" property="score"/>
|
||||
</resultMap>
|
||||
|
||||
|
||||
<!-- 通用查询结果列 -->
|
||||
<sql id="Base_Column_List">
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, acquire_score AS acquireScore, detail_id AS detailId, approval_id AS approvalId, score_comment AS scoreComment, weight AS weight
|
||||
id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, acquire_score AS acquireScore, detail_id AS detailId, approval_id AS approvalId, score_comment AS scoreComment, weight AS weight, score AS score
|
||||
</sql>
|
||||
|
||||
|
||||
@ -36,6 +37,7 @@
|
||||
<if test="approvalId != null">approval_id, </if>
|
||||
<if test="scoreComment != null">score_comment, </if>
|
||||
<if test="weight != null">weight, </if>
|
||||
<if test="score != null">score, </if>
|
||||
is_delete,
|
||||
gmt_create,
|
||||
gmt_modified
|
||||
@ -45,6 +47,7 @@
|
||||
<if test="approvalId != null">#{ approvalId}, </if>
|
||||
<if test="scoreComment != null">#{ scoreComment}, </if>
|
||||
<if test="weight != null">#{ weight}, </if>
|
||||
<if test="score != null">#{ score}, </if>
|
||||
0,
|
||||
now(),
|
||||
now()
|
||||
@ -62,7 +65,8 @@
|
||||
<if test="detailId != null">detail_id = #{detailId},</if>
|
||||
<if test="approvalId != null">approval_id = #{approvalId},</if>
|
||||
<if test="scoreComment != null">score_comment = #{scoreComment},</if>
|
||||
<if test="weight != null">weight = #{weight}</if>
|
||||
<if test="weight != null">weight = #{weight},</if>
|
||||
<if test="score != null">score = #{score}</if>
|
||||
</trim>
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
@ -79,14 +83,15 @@
|
||||
detail_id = #{detailId},
|
||||
approval_id = #{approvalId},
|
||||
score_comment = #{scoreComment},
|
||||
weight = #{weight}
|
||||
,gmt_modified = now()
|
||||
weight = #{weight},
|
||||
score = #{score}
|
||||
,gmt_modified = now()
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
|
||||
<update id="deleteResultScoreById" parameterType="java.lang.Long">
|
||||
update lz_result_score set is_delete = 1 where id=#{id} limit 1
|
||||
update lz_result_score set is_delete = 1 where id=#{id} limit 1
|
||||
</update>
|
||||
|
||||
<select id="selectResultScoresByDetailId" resultType="ResultScore" >
|
||||
|
||||
@ -84,7 +84,8 @@ public class MysqlMain {
|
||||
List<TablesBean> list = new ArrayList<TablesBean>();
|
||||
|
||||
|
||||
list.add(new TablesBean("third_msg_send_record"));
|
||||
list.add(new TablesBean("lz_result_score"));
|
||||
list.add(new TablesBean("lz_result_detail"));
|
||||
|
||||
List<TablesBean> list2 = new ArrayList<TablesBean>();
|
||||
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user