提交修改

This commit is contained in:
quyixiao 2020-09-15 10:12:31 +08:00
parent ad9b449f99
commit edd57e3f49
6 changed files with 78 additions and 20 deletions

View File

@ -488,10 +488,13 @@ public class ResultRecordController extends AbstractController {
BigDecimal checkWeight = NumberUtil.objToBigDecimalDefault(resultDetail.getCheckWeight(), BigDecimal.ZERO); BigDecimal checkWeight = NumberUtil.objToBigDecimalDefault(resultDetail.getCheckWeight(), BigDecimal.ZERO);
BigDecimal acquireScore = NumberUtil.objToBigDecimalDefault(resultDetail.getAcquireScore(), BigDecimal.ZERO); BigDecimal acquireScore = NumberUtil.objToBigDecimalDefault(resultDetail.getAcquireScore(), BigDecimal.ZERO);
sum = sum.add(checkWeight.multiply(acquireScore)); sum = sum.add(checkWeight.multiply(acquireScore));
} }
sum = BigDecimalUtil.setScale(sum, 3); sum = BigDecimalUtil.setScale(sum, 3);
String scoreLevel = resultDetailService.getScoreLevel(sum.doubleValue());
resultRecord.setLastScore(sum); resultRecord.setLastScore(sum);
resultRecord.setAllScore(sum); resultRecord.setAllScore(sum);
resultRecord.setScoreLevel(scoreLevel);
resultRecordService.updateResultRecordById(resultRecord); resultRecordService.updateResultRecordById(resultRecord);
} }
return R.ok("保存成功").put("recordId", resultRecord.getId()); return R.ok("保存成功").put("recordId", resultRecord.getId());

View File

@ -11,7 +11,7 @@ import java.util.Date;
* 菜单权限表 * 菜单权限表
* </p>*业绩记录表 * </p>*业绩记录表
* @author quyixiao * @author quyixiao
* @since 2020-08-20 * @since 2020-09-15
*/ */
@Data @Data
@ -48,12 +48,12 @@ public class ResultRecord implements java.io.Serializable {
private String departmentName; private String departmentName;
//员工姓名 //员工姓名
private String staffName; private String staffName;
//当前审批的员工 id //当前审批的员工 id
private Long currentApprovalStaffId; private Long currentApprovalStaffId;
//当前审批的员工名以逗号隔开 //当前审批的员工名以逗号隔开
private String currentApprovalStaffName; private String currentApprovalStaffName;
//等级
private String scoreLevel;
/** /**
* *
* @return * @return
@ -130,14 +130,14 @@ public class ResultRecord implements java.io.Serializable {
} }
/** /**
* 0.新建1 提交审批中2 拒绝 * 0.新建1 提交审批中2 拒绝, 3 侍提交 4 审批通过,5 驳回
* @return * @return
*/ */
public Integer getStatus() { public Integer getStatus() {
return status; return status;
} }
/** /**
* 0.新建1 提交审批中2 拒绝 * 0.新建1 提交审批中2 拒绝, 3 侍提交 4 审批通过,5 驳回
* @param status * @param status
*/ */
public void setStatus(Integer status) { public void setStatus(Integer status) {
@ -241,10 +241,8 @@ public class ResultRecord implements java.io.Serializable {
public String getDepartmentId() { public String getDepartmentId() {
return departmentId; return departmentId;
} }
/** /**
* 员工所在部门 id * 员工所在部门 id
*
* @param departmentId * @param departmentId
*/ */
public void setDepartmentId(String departmentId) { public void setDepartmentId(String departmentId) {
@ -252,14 +250,12 @@ public class ResultRecord implements java.io.Serializable {
} }
/** /**
* 员工所在部门名称 * 员工所在部门名称
*
* @return * @return
*/ */
public String getDepartmentName() { public String getDepartmentName() {
return departmentName; return departmentName;
} }
/** /**
* 员工所在部门名称 * 员工所在部门名称
* @param departmentName * @param departmentName
@ -283,22 +279,51 @@ public class ResultRecord implements java.io.Serializable {
this.staffName = staffName; this.staffName = staffName;
} }
/**
* 当前审批的员工 id
* @return
*/
public Long getCurrentApprovalStaffId() { public Long getCurrentApprovalStaffId() {
return currentApprovalStaffId; return currentApprovalStaffId;
} }
/**
* 当前审批的员工 id
* @param currentApprovalStaffId
*/
public void setCurrentApprovalStaffId(Long currentApprovalStaffId) { public void setCurrentApprovalStaffId(Long currentApprovalStaffId) {
this.currentApprovalStaffId = currentApprovalStaffId; this.currentApprovalStaffId = currentApprovalStaffId;
} }
/**
* 当前审批的员工名以逗号隔开
* @return
*/
public String getCurrentApprovalStaffName() { public String getCurrentApprovalStaffName() {
return currentApprovalStaffName; return currentApprovalStaffName;
} }
/**
* 当前审批的员工名以逗号隔开
* @param currentApprovalStaffName
*/
public void setCurrentApprovalStaffName(String currentApprovalStaffName) { public void setCurrentApprovalStaffName(String currentApprovalStaffName) {
this.currentApprovalStaffName = currentApprovalStaffName; this.currentApprovalStaffName = currentApprovalStaffName;
} }
/**
* 等级
* @return
*/
public String getScoreLevel() {
return scoreLevel;
}
/**
* 等级
* @param scoreLevel
*/
public void setScoreLevel(String scoreLevel) {
this.scoreLevel = scoreLevel;
}
@Override @Override
public String toString() { public String toString() {
return "ResultRecord{" + return "ResultRecord{" +
@ -317,9 +342,9 @@ public class ResultRecord implements java.io.Serializable {
",departmentId=" + departmentId + ",departmentId=" + departmentId +
",departmentName=" + departmentName + ",departmentName=" + departmentName +
",staffName=" + staffName + ",staffName=" + staffName +
",currentApprovalStaffId=" + currentApprovalStaffId +
",currentApprovalStaffName=" + currentApprovalStaffName +
",scoreLevel=" + scoreLevel +
"}"; "}";
} }
} }

View File

@ -61,4 +61,6 @@ public interface ResultDetailService extends IService<ResultDetail> {
String initRole(Long staffId, Long l); String initRole(Long staffId, Long l);
List<Step> getStepList(ResultRecord resultRecord); List<Step> getStepList(ResultRecord resultRecord);
String getScoreLevel(double doubleValue);
} }

View File

@ -283,4 +283,26 @@ public class ResultDetailServiceImpl extends ServiceImpl<ResultDetailMapper, Res
return stepList; return stepList;
} }
@Override
public String getScoreLevel(double doubleValue) {
if(doubleValue < 3.375){
return "3.25";
}else if(doubleValue < 3.5 ){
return "3.5-";
}else if (doubleValue < 3.583){
return "3.5";
}else if (doubleValue < 3.667){
return "3.5+";
}else if (doubleValue < 3.75){
return "3.75-";
}else if (doubleValue < 3.875){
return "3.75";
}else if (doubleValue < 4 ){
return "3.75+";
}else if (doubleValue == 4 ){
return "4";
}
return "0";
}
} }

View File

@ -21,12 +21,13 @@
<result column="staff_name" property="staffName"/> <result column="staff_name" property="staffName"/>
<result column="current_approval_staff_id" property="currentApprovalStaffId"/> <result column="current_approval_staff_id" property="currentApprovalStaffId"/>
<result column="current_approval_staff_name" property="currentApprovalStaffName"/> <result column="current_approval_staff_name" property="currentApprovalStaffName"/>
<result column="score_level" property="scoreLevel"/>
</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, month_time AS monthTime, status AS status, last_score AS lastScore, all_score AS allScore, remark AS remark, staff_id AS staffId, type AS type, flow_staff_id_role AS flowStaffIdRole, department_id AS departmentId, department_name AS departmentName, staff_name AS staffName, current_approval_staff_id AS currentApprovalStaffId, current_approval_staff_name AS currentApprovalStaffName id AS id, is_delete AS isDelete, gmt_create AS gmtCreate, gmt_modified AS gmtModified, month_time AS monthTime, status AS status, last_score AS lastScore, all_score AS allScore, remark AS remark, staff_id AS staffId, type AS type, flow_staff_id_role AS flowStaffIdRole, department_id AS departmentId, department_name AS departmentName, staff_name AS staffName, current_approval_staff_id AS currentApprovalStaffId, current_approval_staff_name AS currentApprovalStaffName, score_level AS scoreLevel
</sql> </sql>
@ -52,6 +53,7 @@
<if test="staffName != null">staff_name, </if> <if test="staffName != null">staff_name, </if>
<if test="currentApprovalStaffId != null">current_approval_staff_id, </if> <if test="currentApprovalStaffId != null">current_approval_staff_id, </if>
<if test="currentApprovalStaffName != null">current_approval_staff_name, </if> <if test="currentApprovalStaffName != null">current_approval_staff_name, </if>
<if test="scoreLevel != null">score_level, </if>
is_delete, is_delete,
gmt_create, gmt_create,
gmt_modified gmt_modified
@ -69,6 +71,7 @@
<if test="staffName != null">#{ staffName}, </if> <if test="staffName != null">#{ staffName}, </if>
<if test="currentApprovalStaffId != null">#{ currentApprovalStaffId}, </if> <if test="currentApprovalStaffId != null">#{ currentApprovalStaffId}, </if>
<if test="currentApprovalStaffName != null">#{ currentApprovalStaffName}, </if> <if test="currentApprovalStaffName != null">#{ currentApprovalStaffName}, </if>
<if test="scoreLevel != null">#{ scoreLevel}, </if>
0, 0,
now(), now(),
now() now()
@ -94,7 +97,8 @@
<if test="departmentName != null">department_name = #{departmentName},</if> <if test="departmentName != null">department_name = #{departmentName},</if>
<if test="staffName != null">staff_name = #{staffName},</if> <if test="staffName != null">staff_name = #{staffName},</if>
<if test="currentApprovalStaffId != null">current_approval_staff_id = #{currentApprovalStaffId},</if> <if test="currentApprovalStaffId != null">current_approval_staff_id = #{currentApprovalStaffId},</if>
<if test="currentApprovalStaffName != null">current_approval_staff_name = #{currentApprovalStaffName}</if> <if test="currentApprovalStaffName != null">current_approval_staff_name = #{currentApprovalStaffName},</if>
<if test="scoreLevel != null">score_level = #{scoreLevel}</if>
</trim> </trim>
,gmt_modified = now() ,gmt_modified = now()
where id = #{id} where id = #{id}
@ -119,7 +123,8 @@
department_name = #{departmentName}, department_name = #{departmentName},
staff_name = #{staffName}, staff_name = #{staffName},
current_approval_staff_id = #{currentApprovalStaffId}, current_approval_staff_id = #{currentApprovalStaffId},
current_approval_staff_name = #{currentApprovalStaffName} current_approval_staff_name = #{currentApprovalStaffName},
score_level = #{scoreLevel}
,gmt_modified = now() ,gmt_modified = now()
where id = #{id} where id = #{id}
</update> </update>
@ -131,6 +136,7 @@
<select id="selectByCondition" resultType="com.lz.modules.sys.entity.app.ResultRecord"> <select id="selectByCondition" resultType="com.lz.modules.sys.entity.app.ResultRecord">
select * from lz_result_record where is_delete = 0 select * from lz_result_record where is_delete = 0
<if test="req.monthBeginDate != null and req.monthBeginDate != '' "> <if test="req.monthBeginDate != null and req.monthBeginDate != '' ">

View File

@ -63,7 +63,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_record"));
List<TablesBean> list2 = new ArrayList<TablesBean>(); List<TablesBean> list2 = new ArrayList<TablesBean>();
Map<String, String> map = MysqlUtil2ShowCreateTable.getComments(); Map<String, String> map = MysqlUtil2ShowCreateTable.getComments();