评分详情表增加评分说明字段

This commit is contained in:
wulin 2020-11-09 16:52:23 +08:00
parent 55ced3dc09
commit b9a1cb4548
6 changed files with 73 additions and 23 deletions

View File

@ -473,6 +473,8 @@ public class ResultRecordController extends AbstractController {
} }
//目前支持已生成对象的不支持当前非对象表中的数据如果要使用请用常量值
//lz_result_detail>check_weight*lz_result_detail>acquire_score
private String setCalculateValue(List<CalculateModel> calculateModels, Object model){ private String setCalculateValue(List<CalculateModel> calculateModels, Object model){
String mName = model.getClass().getName();//.replace("req", "dto"); String mName = model.getClass().getName();//.replace("req", "dto");
String cal = ""; String cal = "";
@ -480,7 +482,12 @@ public class ResultRecordController extends AbstractController {
//) { //) {
for(int i = 0; i < calculateModels.size(); i++){ for(int i = 0; i < calculateModels.size(); i++){
CalculateModel calculate = calculateModels.get(i); CalculateModel calculate = calculateModels.get(i);
if(mName.contains("." + calculate.getTaboleBeanName())){//支持表名生成的req和dto if(calculate.getTaboleBeanName() == null){//数字
cal += calculate.getFieldName();
if(calculate.getOpt() != null){
cal += calculate.getOpt();
}
}else if(mName.contains("." + calculate.getTaboleBeanName())){//支持表名生成的req和dto
//获取值 //获取值
try { try {
Class<?> clazz = model.getClass(); Class<?> clazz = model.getClass();
@ -519,10 +526,14 @@ public class ResultRecordController extends AbstractController {
CalculateModel calculateModel = null; CalculateModel calculateModel = null;
int type = 0;//0table名称 1字段名称 int type = 0;//0table名称 1字段名称
String value = ""; String value = "";
boolean isDig = false;//是否为数字
for (int i = 0; i < chars.length;i++ for (int i = 0; i < chars.length;i++
) { ) {
char b = chars[i]; char b = chars[i];
if(b == '*' || b == '/' || b == '+' || b == '-'){ if(b == '*' || b == '/' || b == '+' || b == '-'){
if(isDig){
calculateModel.setTableName(null);
}
calculateModel.setFieldName(value); calculateModel.setFieldName(value);
calculateModel.setFieldBeanName(getBeanName(value)); calculateModel.setFieldBeanName(getBeanName(value));
calculateModel.setOpt(String.valueOf(b)); calculateModel.setOpt(String.valueOf(b));
@ -530,6 +541,7 @@ public class ResultRecordController extends AbstractController {
calculateModel = null; calculateModel = null;
type = 0; type = 0;
value = ""; value = "";
isDig = false;
continue; continue;
}else if(b == '>'){ }else if(b == '>'){
@ -541,16 +553,24 @@ public class ResultRecordController extends AbstractController {
type--; type--;
type *= -1; type *= -1;
value = ""; value = "";
isDig = false;
continue; continue;
}else if(b > 47 && b < 58){
//数字
isDig = true;
} }
if(calculateModel == null){ if(calculateModel == null){
calculateModel = new CalculateModel(); calculateModel = new CalculateModel();
} }
value += String.valueOf(b); value += String.valueOf(b);
if(i == chars.length - 1){ if(i == chars.length - 1){
if(isDig){
calculateModel.setTableName(null);
}
calculateModel.setFieldName(value); calculateModel.setFieldName(value);
calculateModel.setFieldBeanName(getBeanName(value)); calculateModel.setFieldBeanName(getBeanName(value));
calculateModels.add(calculateModel); calculateModels.add(calculateModel);
isDig = false;
break; break;
} }

View File

@ -10,10 +10,9 @@ import java.math.BigDecimal;
import java.util.Date; import java.util.Date;
/** /**
* <p> * <p>
* 菜单权限表
* </p>*业绩详情评分表 * </p>*业绩详情评分表
* @author quyixiao * @author quyixiao
* @since 2020-10-13 * @since 2020-11-09
*/ */
@Data @Data
@ -41,6 +40,9 @@ public class ResultScore implements java.io.Serializable {
//审批人id //审批人id
@ApiModelProperty(value = "审批人id", name = "approvalId") @ApiModelProperty(value = "审批人id", name = "approvalId")
private Long approvalId; private Long approvalId;
//评分说明
@ApiModelProperty(value = "评分说明", name = "scoreComment")
private String scoreComment;
/** /**
* *
* @return * @return
@ -146,6 +148,21 @@ public class ResultScore implements java.io.Serializable {
this.approvalId = approvalId; this.approvalId = approvalId;
} }
/**
* 评分说明
* @return
*/
public String getScoreComment() {
return scoreComment;
}
/**
* 评分说明
* @param scoreComment
*/
public void setScoreComment(String scoreComment) {
this.scoreComment = scoreComment;
}
@Override @Override
public String toString() { public String toString() {
return "ResultScore{" + return "ResultScore{" +
@ -156,6 +173,7 @@ public class ResultScore implements java.io.Serializable {
",acquireScore=" + acquireScore + ",acquireScore=" + acquireScore +
",detailId=" + detailId + ",detailId=" + detailId +
",approvalId=" + approvalId + ",approvalId=" + approvalId +
",scoreComment=" + scoreComment +
"}"; "}";
} }
} }

View File

@ -35,6 +35,10 @@ public class ResultScoreDto {
//审批人id //审批人id
@ApiModelProperty(value = "所占权重", name = "weight") @ApiModelProperty(value = "所占权重", name = "weight")
private BigDecimal weight; private BigDecimal weight;
//评分说明
@ApiModelProperty(value = "评分说明", name = "scoreComment")
private String scoreComment;
/** /**
* *
* @return * @return

View File

@ -49,6 +49,9 @@ public class ResultScoreReq implements java.io.Serializable {
//审批人id //审批人id
@ApiModelProperty(value = "审批人id", name = "approvalId") @ApiModelProperty(value = "审批人id", name = "approvalId")
private Long approvalId; private Long approvalId;
//评分说明
@ApiModelProperty(value = "评分说明", name = "scoreComment")
private String scoreComment;
/** /**
* *
* @return * @return

View File

@ -11,50 +11,54 @@
<result column="acquire_score" property="acquireScore"/> <result column="acquire_score" property="acquireScore"/>
<result column="detail_id" property="detailId"/> <result column="detail_id" property="detailId"/>
<result column="approval_id" property="approvalId"/> <result column="approval_id" property="approvalId"/>
<result column="score_comment" property="scoreComment"/>
</resultMap> </resultMap>
<!-- 通用查询结果列 --> <!-- 通用查询结果列 -->
<sql id="Base_Column_List"> <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 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
</sql> </sql>
<select id="selectResultScoreById" resultType="ResultScore" > <select id="selectResultScoreById" resultType="ResultScore" >
select * from lz_result_score where id=#{id} and is_delete = 0 limit 1 select * from lz_result_score where id=#{id} and is_delete = 0 limit 1
</select> </select>
<insert id="insertResultScore" parameterType="ResultScore" useGeneratedKeys="true" keyProperty="id" > <insert id="insertResultScore" parameterType="ResultScore" useGeneratedKeys="true" keyProperty="id" >
insert into lz_result_score( insert into lz_result_score(
<if test="acquireScore != null">acquire_score, </if> <if test="acquireScore != null">acquire_score, </if>
<if test="detailId != null">detail_id, </if> <if test="detailId != null">detail_id, </if>
<if test="approvalId != null">approval_id, </if> <if test="approvalId != null">approval_id, </if>
is_delete, <if test="scoreComment != null">score_comment, </if>
gmt_create, is_delete,
gmt_modified gmt_create,
gmt_modified
)values( )values(
<if test="acquireScore != null">#{ acquireScore}, </if> <if test="acquireScore != null">#{ acquireScore}, </if>
<if test="detailId != null">#{ detailId}, </if> <if test="detailId != null">#{ detailId}, </if>
<if test="approvalId != null">#{ approvalId}, </if> <if test="approvalId != null">#{ approvalId}, </if>
0, <if test="scoreComment != null">#{ scoreComment}, </if>
now(), 0,
now() now(),
now()
) )
</insert> </insert>
<update id="updateResultScoreById" parameterType="ResultScore" > <update id="updateResultScoreById" parameterType="ResultScore" >
update update
lz_result_score lz_result_score
<trim prefix="set" suffixOverrides=","> <trim prefix="set" suffixOverrides=",">
<if test="isDelete != null">is_delete = #{isDelete},</if> <if test="isDelete != null">is_delete = #{isDelete},</if>
<if test="gmtCreate != null">gmt_create = #{gmtCreate},</if> <if test="gmtCreate != null">gmt_create = #{gmtCreate},</if>
<if test="acquireScore != null">acquire_score = #{acquireScore},</if> <if test="acquireScore != null">acquire_score = #{acquireScore},</if>
<if test="detailId != null">detail_id = #{detailId},</if> <if test="detailId != null">detail_id = #{detailId},</if>
<if test="approvalId != null">approval_id = #{approvalId}</if> <if test="approvalId != null">approval_id = #{approvalId},</if>
<if test="scoreComment != null">score_comment = #{scoreComment}</if>
</trim> </trim>
,gmt_modified = now() ,gmt_modified = now()
where id = #{id} where id = #{id}
@ -63,13 +67,14 @@
<update id="updateCoverResultScoreById" parameterType="ResultScore" > <update id="updateCoverResultScoreById" parameterType="ResultScore" >
update update
lz_result_score lz_result_score
set set
is_delete = #{isDelete}, is_delete = #{isDelete},
gmt_create = #{gmtCreate}, gmt_create = #{gmtCreate},
acquire_score = #{acquireScore}, acquire_score = #{acquireScore},
detail_id = #{detailId}, detail_id = #{detailId},
approval_id = #{approvalId} approval_id = #{approvalId},
score_comment = #{scoreComment}
,gmt_modified = now() ,gmt_modified = now()
where id = #{id} where id = #{id}
</update> </update>

View File

@ -126,7 +126,7 @@ public class MysqlMain {
List<TablesBean> list = new ArrayList<TablesBean>(); List<TablesBean> list = new ArrayList<TablesBean>();
list.add(new TablesBean("lz_flow_record")); list.add(new TablesBean("lz_result_score"));
List<TablesBean> list2 = new ArrayList<TablesBean>(); List<TablesBean> list2 = new ArrayList<TablesBean>();
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments(); Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();