解决无法添加多个相同维度问题

This commit is contained in:
wulin 2020-11-17 09:43:08 +08:00
parent 017cbb7f3a
commit d7cbc5a410
8 changed files with 64 additions and 21 deletions

View File

@ -378,9 +378,6 @@ public class ResultRecordController extends AbstractController {
}
}
//获取考核维度等信息
ResultRecordDetailDto resultRecordDetailDto = new ResultRecordDetailDto();
BeanUtils.copyProperties(resultRecord, resultRecordDetailDto);
@ -490,7 +487,7 @@ public class ResultRecordController extends AbstractController {
resultRecortModelDto.setMaxCount(null);
}
List<ResultDetailDto> detailDtos =
resultDetailService.selectDtosByRecordId(resultRecord.getId(), model.getType());
resultDetailService.selectDtosByRecordId(resultRecord.getId(), model.getId());
for (ResultDetailDto dto:detailDtos
) {
//下面设置计算公式

View File

@ -58,6 +58,8 @@ public class ResultDetailDto {
@ApiModelProperty(value = "评分详细", name = "scoreDtos")
private List<ResultScoreDto> scoreDtos;
@ApiModelProperty(value = "维度id lz_result_model的id", name = "modelId")
private Long modelId;
/**
*
* @return

View File

@ -45,5 +45,5 @@ public interface ResultDetailMapper extends BaseMapper<ResultDetail> {
Long insertResultDetails(@Param("list") List<ResultDetail> resultDetails);
List<ResultDetailDto> selectDtosByRecordId(@Param("recordResultId") Long id, @Param("type") int type);
List<ResultDetailDto> selectDtosByRecordId(@Param("recordResultId") Long id, @Param("modelId") int modelId);
}

View File

@ -1,57 +1,78 @@
package com.lz.modules.sys.entity.app;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.IdType;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import java.math.BigDecimal;
import java.util.Date;
/**
* <p>
* 菜单权限表
* </p>*绩效详情表
* </p>*业绩详情表
* @author quyixiao
* @since 2020-08-28
* @since 2020-11-17
*/
@Data
@TableName("lz_result_detail")
@ApiModel(value = "业绩详情表")
public class ResultDetail implements java.io.Serializable {
//
@TableId(value = "id", type = IdType.AUTO)
private Long id;
//是否删除状态1删除0有效
@ApiModelProperty(value = "是否删除状态1删除0有效", name = "isDelete")
private Integer isDelete;
//创建时间
@ApiModelProperty(value = "创建时间", name = "gmtCreate")
private Date gmtCreate;
//最后修改时间
@ApiModelProperty(value = "最后修改时间", name = "gmtModified")
private Date gmtModified;
//1绩效2文化价值观
//1业绩2文化价值观
@ApiModelProperty(value = "1业绩2文化价值观", name = "type")
private Integer type;
//目标
@ApiModelProperty(value = "目标", name = "target")
private String target;
//关键结果
@ApiModelProperty(value = "关键结果", name = "keyResult")
private String keyResult;
//关键结果_3.5标准
@ApiModelProperty(value = "关键结果_3.5标准", name = "keyResult35")
private String keyResult35;
//关键结果3.7分标准
@ApiModelProperty(value = "关键结果3.7分标准", name = "keyResult37")
private String keyResult37;
//考核权重
@ApiModelProperty(value = "考核权重", name = "checkWeight")
private BigDecimal checkWeight;
//考核结果
@ApiModelProperty(value = "考核结果", name = "checkResult")
private String checkResult;
//直属上级评分
@ApiModelProperty(value = "直属上级评分", name = "superScore")
private String superScore;
//得分
@ApiModelProperty(value = "得分", name = "acquireScore")
private BigDecimal acquireScore;
//评分说明
@ApiModelProperty(value = "评分说明", name = "scoreComment")
private String scoreComment;
//记录id
@ApiModelProperty(value = "记录id ", name = "recordId")
private Long recordId;
//用户id
@ApiModelProperty(value = "用户id", name = "staffId")
private Long staffId;
//优先级从大到小
@ApiModelProperty(value = "优先级,从大到小", name = "priority")
private Integer priority;
//维度id lz_result_model的id
@ApiModelProperty(value = "维度id lz_result_model的id", name = "modelId")
private Long modelId;
/**
*
* @return
@ -113,14 +134,14 @@ public class ResultDetail implements java.io.Serializable {
}
/**
* 12文化价值观
* 12文化价值观
* @return
*/
public Integer getType() {
return type;
}
/**
* 12文化价值观
* 12文化价值观
* @param type
*/
public void setType(Integer type) {
@ -307,6 +328,21 @@ public class ResultDetail implements java.io.Serializable {
this.priority = priority;
}
/**
* 维度id lz_result_model的id
* @return
*/
public Long getModelId() {
return modelId;
}
/**
* 维度id lz_result_model的id
* @param modelId
*/
public void setModelId(Long modelId) {
this.modelId = modelId;
}
@Override
public String toString() {
return "ResultDetail{" +
@ -327,6 +363,7 @@ public class ResultDetail implements java.io.Serializable {
",recordId=" + recordId +
",staffId=" + staffId +
",priority=" + priority +
",modelId=" + modelId +
"}";
}
}

View File

@ -69,5 +69,5 @@ public interface ResultDetailService extends IService<ResultDetail> {
Long insertResultDetails(List<ResultDetail> resultDetails);
List<ResultDetailDto> selectDtosByRecordId(Long id, int type);
List<ResultDetailDto> selectDtosByRecordId(Long id, Long modelId);
}

View File

@ -336,8 +336,8 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
}
@Override
public List<ResultDetailDto> selectDtosByRecordId(Long id, int type){
return resultDetailMapper.selectDtosByRecordId(id, type);
public List<ResultDetailDto> selectDtosByRecordId(Long id, Long modelId){
return resultDetailMapper.selectDtosByRecordId(id, modelId);
}
}

View File

@ -21,12 +21,13 @@
<result column="record_id" property="recordId"/>
<result column="staff_id" property="staffId"/>
<result column="priority" property="priority"/>
<result column="model_id" property="modelId"/>
</resultMap>
<!-- 通用查询结果列 -->
<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
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
</sql>
@ -52,6 +53,7 @@
<if test="recordId != null">record_id, </if>
<if test="staffId != null">staff_id, </if>
<if test="priority != null">priority, </if>
<if test="modelId != null">model_id, </if>
is_delete,
gmt_create,
gmt_modified
@ -69,6 +71,7 @@
<if test="recordId != null">#{ recordId}, </if>
<if test="staffId != null">#{ staffId}, </if>
<if test="priority != null">#{ priority}, </if>
<if test="modelId != null">#{ modelId}, </if>
0,
now(),
now()
@ -94,10 +97,11 @@
<if test="scoreComment != null">score_comment = #{scoreComment},</if>
<if test="recordId != null">record_id = #{recordId},</if>
<if test="staffId != null">staff_id = #{staffId},</if>
<if test="priority != null">priority = #{priority}</if>
<if test="priority != null">priority = #{priority},</if>
<if test="modelId != null">model_id = #{modelId}</if>
</trim>
,gmt_modified = now()
where id = #{id} limit 1
where id = #{id}
</update>
@ -119,7 +123,8 @@
score_comment = #{scoreComment},
record_id = #{recordId},
staff_id = #{staffId},
priority = #{priority}
priority = #{priority},
model_id = #{modelId}
,gmt_modified = now()
where id = #{id}
</update>
@ -158,6 +163,7 @@
record_id,
staff_id,
priority,
model_id,
is_delete
)values
<foreach collection="list" item="item" separator=",">
@ -173,13 +179,14 @@
#{ item.recordId},
#{ item.staffId},
#{ item.priority},
#{item.modelId},
0
)
</foreach>
</insert>
<select id="selectDtosByRecordId" resultType="com.lz.modules.flow.model.ResultDetailDto">
select * from lz_result_detail where record_id=#{recordResultId} and type = #{type} and is_delete = 0 order by priority asc
select * from lz_result_detail where record_id=#{recordResultId} and model_id = #{modelId} and is_delete = 0 order by priority asc
</select>
</mapper>

View File

@ -126,7 +126,7 @@ public class MysqlMain {
List<TablesBean> list = new ArrayList<TablesBean>();
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();