生成任务考核得分、修改投票接口bug处理

main
hshansha 5 months ago
parent 6a2314c481
commit 1aac635883

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<configuration> <configuration>
<!-- 日志存放路径 --> <!-- 日志存放路径 -->
<property name="log.path" value="/home/ruoyi/logs" /> <property name="log.path" value="/www/wwwroot/Jar_packages/kaohe/logs" />
<property name="log.path" value="/www/wwwroot/Jar_packages/kaohe/logs" />
<!-- 日志输出格式 --> <!-- 日志输出格式 -->
<property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> <property name="log.pattern" value="%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" />

@ -22,6 +22,11 @@
<artifactId>ruoyi-common</artifactId> <artifactId>ruoyi-common</artifactId>
<version>${ruoyi.version}</version> <version>${ruoyi.version}</version>
</dependency> </dependency>
<dependency>
<groupId>com.belerweb</groupId>
<artifactId>pinyin4j</artifactId>
<version>2.5.0</version>
</dependency>
</dependencies> </dependencies>
</project> </project>

@ -1,7 +1,16 @@
package com.ruoyi.kaohe.controller; package com.ruoyi.kaohe.controller;
import java.util.List; import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.kaohe.domain.*;
import com.ruoyi.kaohe.service.IKhVoteEmpService;
import com.ruoyi.kaohe.service.IKhVoteService;
import com.ruoyi.kaohe.util.PinYinUtil;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -16,7 +25,6 @@ import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController; import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.kaohe.domain.KhKhrwResult;
import com.ruoyi.kaohe.service.IKhKhrwResultService; import com.ruoyi.kaohe.service.IKhKhrwResultService;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
@ -33,6 +41,184 @@ public class KhKhrwResultController extends BaseController
{ {
@Autowired @Autowired
private IKhKhrwResultService khKhrwResultService; private IKhKhrwResultService khKhrwResultService;
@Autowired
private IKhVoteEmpService voteEmpService;
@Autowired
private IKhVoteService khVoteService;
/**
*
*/
//@PreAuthorize("@ss.hasPermi('kaohe:kh_result:add')")
@GetMapping("/generateResult")
public AjaxResult generateResult(KhPingce pc) { //传递参数 id、pc_title、bkhdxtype
JSONArray header = new JSONArray();//存放表头及表格关联数据
JSONObject headerData = new JSONObject();
headerData.put("name", null);
headerData.put("label", pc.getPcTitle());
List<Object> children = new ArrayList<>();
JSONObject tableColumn = new JSONObject();
tableColumn.put("name", "khdxName");
if (pc.getBkhdxType().equals("0")) {
tableColumn.put("label", "单位");
} else {
tableColumn.put("label", "姓名");
}
children.add(tableColumn);
JSONObject tableColumn2 = new JSONObject();
String pyPCtitle = PinYinUtil.getPinyinInitials(pc.getPcTitle());
tableColumn2.put("name", pyPCtitle);
tableColumn2.put("label", pc.getPcTitle());
//-----------------------------------------------------------------------------------------
JSONArray endData = new JSONArray (); //存放表格数据
List<KhVoteEmp> lists = new ArrayList<>();
KhVote khVote = new KhVote();
khVote.setPingceId(pc.getId());
//查询该考核任务下的所有评分任务
List<KhVote> votes = khVoteService.selectKhVoteList(khVote);
for (KhVote vote : votes) {
KhVoteEmp khVoteEmp = new KhVoteEmp();
khVoteEmp.setVoteId(vote.getId());
//查询该评分任务对应的所有被考核对象详情
List<KhVoteEmp> khVoteEmps = voteEmpService.selectKhVoteEmpList(khVoteEmp);
// votesMap.put(vote.getVoteTitle(),khVoteEmps);
lists.addAll(khVoteEmps);
}
//根据被考核对象名分组数据到map中
Map<String, List<KhVoteEmp>> khdxMap = lists.stream()
.collect(Collectors.groupingBy(KhVoteEmp::getBkhdxName,
LinkedHashMap::new, // 使用LinkedHashMap保持插入顺序这对于键很重要
Collectors.toList())); // 根据getBkhdxName分组*/lists.stream().
//循环map得到对应数据
Set<Map.Entry<String, List<KhVoteEmp>>> entries = khdxMap.entrySet();
for (Map.Entry<String, List<KhVoteEmp>> entry : entries) {
BigDecimal sumScore=BigDecimal.ZERO;
String key = entry.getKey();
//获取表头数据
List<Object> children2 = new ArrayList<>();
List<Object> children3 = new ArrayList<>();
JSONObject child1 = new JSONObject();
JSONObject child2 = new JSONObject();
JSONObject child3 = new JSONObject();
JSONObject child4 = new JSONObject();
JSONObject child5 = new JSONObject();
JSONObject child6 = new JSONObject();
//------------------------------------------------------------------------------------------------------
//获取表数据
JSONObject pcdata = new JSONObject();
List<KhVoteEmp> value = entry.getValue();
JSONObject votesDatas = new JSONObject();
Integer index=0;
for (KhVoteEmp voteEmp : value) {
index++;
String pyVoteTitle = PinYinUtil.getPinyinInitials(voteEmp.getVoteTitle());
JSONObject tabledata = new JSONObject();
tabledata.put("name", pyVoteTitle);
tabledata.put("label", voteEmp.getVoteTitle());
Object objectData;
//根据考核类型存储不同数据
if (voteEmp.getKhitemTypeid().equals(1L)) { //评分选项
KhXxpf xxpf = new KhXxpf();
xxpf.setOptionA(voteEmp.getOptionA());
xxpf.setOptionB(voteEmp.getOptionB());
xxpf.setOptionC(voteEmp.getOptionC());
xxpf.setOptionD(voteEmp.getOptionD());
xxpf.setAvgScore(voteEmp.getAvgScore());
xxpf.setPercentage(voteEmp.getPercentage());
objectData = xxpf;
sumScore=sumScore.add(voteEmp.getEndScore());
if(index==1){
child1.put("name","optionA");
child1.put("label","优秀");
child2.put("name","optionB");
child2.put("label","合格");
child3.put("name","optionC");
child3.put("label","基本合格");
child4.put("name","optionD");
child4.put("label","不合格");
child5.put("name","avgScore");
child5.put("label","得分");
child6.put("name","percentage");
child6.put("label","占比");
children3.add(child1);
children3.add(child2);
children3.add(child3);
children3.add(child4);
children3.add(child5);
children3.add(child6);
}
} else if (voteEmp.getKhitemTypeid().equals(2L)) {//评分占比
KhPfzb pfzb = new KhPfzb();
pfzb.setAvgScore(voteEmp.getAvgScore());
pfzb.setPercentage(voteEmp.getPercentage());
objectData = pfzb;
sumScore=sumScore.add(voteEmp.getEndScore());
if(index==1){
child1.put("name","avgScore");
child1.put("label","得分");
child2.put("name","percentage");
child2.put("label","占比");
children3.add(child2);
children3.add(child1);
}
} else {//单独评分
KhDdpf ddpf = new KhDdpf();
ddpf.setAvgScore(voteEmp.getAvgScore());
objectData = ddpf;
sumScore=sumScore.add(voteEmp.getAvgScore());
if(index==1){{
child1.put("name","avgScore");
child1.put("label","得分");
children3.add(child1);
}}
}
votesDatas.put(pyVoteTitle, objectData);
tabledata.put("children",children3);
children2.add(tabledata);
}
pcdata.put("khdxName", key);
pcdata.put(pyPCtitle, votesDatas);
pcdata.put("df",sumScore);
endData.add(pcdata);
tableColumn2.put("children",children2);
}
children.add(tableColumn2);
JSONObject tableColumn3 = new JSONObject();
tableColumn3.put("name", "df");
tableColumn3.put("label", "得分");
children.add(tableColumn3);
headerData.put("children",children);
header.add(headerData);
KhKhrwResult pcResult = new KhKhrwResult();
pcResult.setPcId(pc.getId());
pcResult.setPcName(pc.getPcTitle());
pcResult.setTableHeader(header.toJSONString());
pcResult.setTableData(endData.toJSONString());
khKhrwResultService.insertKhKhrwResult(pcResult);
return AjaxResult.success();
}
/** /**
* *

@ -1,13 +1,17 @@
package com.ruoyi.kaohe.controller; package com.ruoyi.kaohe.controller;
import java.util.List; import java.math.BigDecimal;
import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
import java.util.stream.Stream;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.alibaba.fastjson2.JSONObject;
import com.ruoyi.kaohe.domain.*; import com.ruoyi.kaohe.domain.*;
import com.ruoyi.kaohe.service.IKhPcEmpService; import com.ruoyi.kaohe.service.IKhPcEmpService;
import com.ruoyi.kaohe.service.IKhVoteEmpService; import com.ruoyi.kaohe.service.IKhVoteEmpService;
import com.ruoyi.kaohe.service.IKhVoteService; import com.ruoyi.kaohe.service.IKhVoteService;
import com.ruoyi.kaohe.util.PinYinUtil;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -40,39 +44,6 @@ public class KhPingceController extends BaseController {
private IKhPingceService khPingceService; private IKhPingceService khPingceService;
@Autowired @Autowired
private IKhPcEmpService pcEmpService; private IKhPcEmpService pcEmpService;
@Autowired
private IKhVoteEmpService voteEmpService;
@Autowired
private IKhVoteService khVoteService;
/**
*
*/
// @PreAuthorize("@ss.hasPermi('kaohe:pingce:list')")
@GetMapping("/generateResult")
public TableDataInfo generateResult(Long id) {
KhVote khVote = new KhVote();
khVote.setPingceId(id);
//查询该考核任务下的所有评分任务
List<KhVote> votes = khVoteService.selectKhVoteList(khVote);
for (KhVote vote : votes) {
KhVoteEmp khVoteEmp = new KhVoteEmp();
khVoteEmp.setVoteId(vote.getId());
//查询该评分任务对应的所有被考核对象详情
List<KhVoteEmp> khVoteEmps = voteEmpService.selectKhVoteEmpList(khVoteEmp);
for (KhVoteEmp voteEmp : khVoteEmps) {
//根据考核类型存储不同数据
if(vote.getKhitemTypeid().equals(1L)){
}else if(vote.getKhitemTypeid().equals(2L)) {
}else{
}
}
}
return getDataTable(null);
}
/** /**
* *

@ -152,8 +152,19 @@ public class KhVoteController extends BaseController {
@PreAuthorize("@ss.hasPermi('kaohe:vote:edit')") @PreAuthorize("@ss.hasPermi('kaohe:vote:edit')")
@Log(title = "投票评测", businessType = BusinessType.UPDATE) @Log(title = "投票评测", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
@Transactional
public AjaxResult edit(@RequestBody KhVote khVote) { public AjaxResult edit(@RequestBody KhVote khVote) {
return toAjax(khVoteService.updateKhVote(khVote)); //voteid查询职工评分修改对应值
KhVoteEmp query = new KhVoteEmp();
query.setVoteId(khVote.getId());
List<KhVoteEmp> khVoteEmps = voteEmpService.selectKhVoteEmpList(query);
for (KhVoteEmp khVoteEmp : khVoteEmps) {
khVoteEmp.setPercentage(khVote.getPercentage());
khVoteEmp.setVoteTitle(khVote.getVoteTitle());
voteEmpService.updateKhVoteEmp(khVoteEmp);
}
khVoteService.updateKhVote(khVote);
return AjaxResult.success();
} }
/** /**

@ -0,0 +1,29 @@
package com.ruoyi.kaohe.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import java.math.BigDecimal;
/**
*
*
* @author hs
* @date 2025-06-23
*/
public class KhDdpf extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 最终分数 */
@Excel(name = "得分")
private BigDecimal avgScore;
public BigDecimal getAvgScore() {
return avgScore;
}
public void setAvgScore(BigDecimal avgScore) {
this.avgScore = avgScore;
}
}

@ -1,6 +1,5 @@
package com.ruoyi.kaohe.domain; package com.ruoyi.kaohe.domain;
import java.math.BigDecimal;
import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle; import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel; import com.ruoyi.common.annotation.Excel;
@ -10,7 +9,7 @@ import com.ruoyi.common.core.domain.BaseEntity;
* kh_khrw_result * kh_khrw_result
* *
* @author hs * @author hs
* @date 2025-07-05 * @date 2025-07-09
*/ */
public class KhKhrwResult extends BaseEntity public class KhKhrwResult extends BaseEntity
{ {
@ -19,13 +18,13 @@ public class KhKhrwResult extends BaseEntity
/** 主键 */ /** 主键 */
private Long id; private Long id;
/** 考核任务id */ /** 考核id */
@Excel(name = "考核任务id") @Excel(name = "考核id")
private Long khrwId; private Long pcId;
/** 考核任务名称 */ /** 考核名称 */
@Excel(name = "考核任务名称") @Excel(name = "考核名称")
private String khrwName; private String pcName;
/** 表头 */ /** 表头 */
@Excel(name = "表头") @Excel(name = "表头")
@ -35,10 +34,6 @@ public class KhKhrwResult extends BaseEntity
@Excel(name = "表数据") @Excel(name = "表数据")
private String tableData; private String tableData;
/** 得分 */
@Excel(name = "得分")
private BigDecimal endScore;
public void setId(Long id) public void setId(Long id)
{ {
this.id = id; this.id = id;
@ -49,24 +44,24 @@ public class KhKhrwResult extends BaseEntity
return id; return id;
} }
public void setKhrwId(Long khrwId) public void setPcId(Long pcId)
{ {
this.khrwId = khrwId; this.pcId = pcId;
} }
public Long getKhrwId() public Long getPcId()
{ {
return khrwId; return pcId;
} }
public void setKhrwName(String khrwName) public void setPcName(String pcName)
{ {
this.khrwName = khrwName; this.pcName = pcName;
} }
public String getKhrwName() public String getPcName()
{ {
return khrwName; return pcName;
} }
public void setTableHeader(String tableHeader) public void setTableHeader(String tableHeader)
@ -89,25 +84,14 @@ public class KhKhrwResult extends BaseEntity
return tableData; return tableData;
} }
public void setEndScore(BigDecimal endScore)
{
this.endScore = endScore;
}
public BigDecimal getEndScore()
{
return endScore;
}
@Override @Override
public String toString() { public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE) return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId()) .append("id", getId())
.append("khrwId", getKhrwId()) .append("pcId", getPcId())
.append("khrwName", getKhrwName()) .append("pcName", getPcName())
.append("tableHeader", getTableHeader()) .append("tableHeader", getTableHeader())
.append("tableData", getTableData()) .append("tableData", getTableData())
.append("endScore", getEndScore())
.append("createBy", getCreateBy()) .append("createBy", getCreateBy())
.append("createTime", getCreateTime()) .append("createTime", getCreateTime())
.append("updateBy", getUpdateBy()) .append("updateBy", getUpdateBy())

@ -0,0 +1,45 @@
package com.ruoyi.kaohe.domain;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import java.math.BigDecimal;
/**
*
*
* @author hs
* @date 2025-06-23
*/
public class KhPfzb extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 最终分数 */
@Excel(name = "得分")
private BigDecimal avgScore;
/** 评分占比(0-1之间) */
@Excel(name = "评分占比(0-1之间)")
private BigDecimal percentage;
public BigDecimal getPercentage() {
return percentage;
}
public void setPercentage(BigDecimal percentage) {
this.percentage = percentage;
}
public BigDecimal getAvgScore() {
return avgScore;
}
public void setAvgScore(BigDecimal avgScore) {
this.avgScore = avgScore;
}
}

@ -0,0 +1,88 @@
package com.ruoyi.kaohe.domain;
import com.ruoyi.common.annotation.Excel;
import java.math.BigDecimal;
/**
*
*/
public class KhXxpf {
private static final long serialVersionUID = 1L;
/** 优秀 */
@Excel(name = "优秀")
private BigDecimal optionA;
/** 合格 */
@Excel(name = "合格")
private BigDecimal optionB;
/** 基本合格 */
@Excel(name = "基本合格")
private BigDecimal optionC;
/** 不合格 */
@Excel(name = "不合格")
private BigDecimal optionD;
/* *//** 平均分数 *//*
@Excel(name = "平均分数")
private BigDecimal avgScore;*/
/** 最终分数 */
@Excel(name = "得分")
private BigDecimal avgScore;
/** 评分占比(0-1之间) */
@Excel(name = "评分占比(0-1之间)")
private BigDecimal percentage;
public BigDecimal getOptionA() {
return optionA;
}
public void setOptionA(BigDecimal optionA) {
this.optionA = optionA;
}
public BigDecimal getOptionB() {
return optionB;
}
public void setOptionB(BigDecimal optionB) {
this.optionB = optionB;
}
public BigDecimal getOptionC() {
return optionC;
}
public void setOptionC(BigDecimal optionC) {
this.optionC = optionC;
}
public BigDecimal getOptionD() {
return optionD;
}
public void setOptionD(BigDecimal optionD) {
this.optionD = optionD;
}
public BigDecimal getPercentage() {
return percentage;
}
public void setPercentage(BigDecimal percentage) {
this.percentage = percentage;
}
public BigDecimal getAvgScore() {
return avgScore;
}
public void setAvgScore(BigDecimal avgScore) {
this.avgScore = avgScore;
}
}

@ -0,0 +1,25 @@
package com.ruoyi.kaohe.util;
import net.sourceforge.pinyin4j.PinyinHelper;
import org.springframework.stereotype.Component;
@Component
public class PinYinUtil {
// 判断是否为中文字符
public static String getPinyinInitials(String chinese) {
StringBuilder pinyinInitial = new StringBuilder();
for (char c : chinese.toCharArray()) {
String[] pinyinArray = PinyinHelper.toHanyuPinyinStringArray(c);
if (pinyinArray != null && pinyinArray.length > 0) {
// 取拼音的首字母并转换为大写
pinyinInitial.append(pinyinArray[0].charAt(0));
} else {
// 如果无法转换,可以添加其他处理,例如跳过或替换为特定字符
pinyinInitial.append(c);
}
}
return pinyinInitial.toString().toLowerCase(); // 可以选择转换为大写或小写
}
}

@ -6,11 +6,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<resultMap type="KhKhrwResult" id="KhKhrwResultResult"> <resultMap type="KhKhrwResult" id="KhKhrwResultResult">
<result property="id" column="id" /> <result property="id" column="id" />
<result property="khrwId" column="khrw_id" /> <result property="pcId" column="pc_id" />
<result property="khrwName" column="khrw_name" /> <result property="pcName" column="pc_name" />
<result property="tableHeader" column="table_header" /> <result property="tableHeader" column="table_header" />
<result property="tableData" column="table_data" /> <result property="tableData" column="table_data" />
<result property="endScore" column="end_score" />
<result property="createBy" column="create_by" /> <result property="createBy" column="create_by" />
<result property="createTime" column="create_time" /> <result property="createTime" column="create_time" />
<result property="updateBy" column="update_by" /> <result property="updateBy" column="update_by" />
@ -19,17 +18,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap> </resultMap>
<sql id="selectKhKhrwResultVo"> <sql id="selectKhKhrwResultVo">
select id, khrw_id, khrw_name, table_header, table_data, end_score, create_by, create_time, update_by, update_time, remark from kh_khrw_result select id, pc_id, pc_name, table_header, table_data, create_by, create_time, update_by, update_time, remark from kh_khrw_result
</sql> </sql>
<select id="selectKhKhrwResultList" parameterType="KhKhrwResult" resultMap="KhKhrwResultResult"> <select id="selectKhKhrwResultList" parameterType="KhKhrwResult" resultMap="KhKhrwResultResult">
<include refid="selectKhKhrwResultVo"/> <include refid="selectKhKhrwResultVo"/>
<where> <where>
<if test="khrwId != null "> and khrw_id = #{khrwId}</if> <if test="pcId != null "> and pc_id = #{pcId}</if>
<if test="khrwName != null and khrwName != ''"> and khrw_name like concat('%', #{khrwName}, '%')</if> <if test="pcName != null and pcName != ''"> and pc_name like concat('%', #{pcName}, '%')</if>
<if test="tableHeader != null and tableHeader != ''"> and table_header = #{tableHeader}</if> <if test="tableHeader != null and tableHeader != ''"> and table_header = #{tableHeader}</if>
<if test="tableData != null and tableData != ''"> and table_data = #{tableData}</if> <if test="tableData != null and tableData != ''"> and table_data = #{tableData}</if>
<if test="endScore != null "> and end_score = #{endScore}</if>
</where> </where>
</select> </select>
@ -41,11 +39,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert id="insertKhKhrwResult" parameterType="KhKhrwResult" useGeneratedKeys="true" keyProperty="id"> <insert id="insertKhKhrwResult" parameterType="KhKhrwResult" useGeneratedKeys="true" keyProperty="id">
insert into kh_khrw_result insert into kh_khrw_result
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="khrwId != null">khrw_id,</if> <if test="pcId != null">pc_id,</if>
<if test="khrwName != null">khrw_name,</if> <if test="pcName != null">pc_name,</if>
<if test="tableHeader != null">table_header,</if> <if test="tableHeader != null">table_header,</if>
<if test="tableData != null">table_data,</if> <if test="tableData != null">table_data,</if>
<if test="endScore != null">end_score,</if>
<if test="createBy != null">create_by,</if> <if test="createBy != null">create_by,</if>
<if test="createTime != null">create_time,</if> <if test="createTime != null">create_time,</if>
<if test="updateBy != null">update_by,</if> <if test="updateBy != null">update_by,</if>
@ -53,11 +50,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="remark != null">remark,</if> <if test="remark != null">remark,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="khrwId != null">#{khrwId},</if> <if test="pcId != null">#{pcId},</if>
<if test="khrwName != null">#{khrwName},</if> <if test="pcName != null">#{pcName},</if>
<if test="tableHeader != null">#{tableHeader},</if> <if test="tableHeader != null">#{tableHeader},</if>
<if test="tableData != null">#{tableData},</if> <if test="tableData != null">#{tableData},</if>
<if test="endScore != null">#{endScore},</if>
<if test="createBy != null">#{createBy},</if> <if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if> <if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if> <if test="updateBy != null">#{updateBy},</if>
@ -69,11 +65,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update id="updateKhKhrwResult" parameterType="KhKhrwResult"> <update id="updateKhKhrwResult" parameterType="KhKhrwResult">
update kh_khrw_result update kh_khrw_result
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="khrwId != null">khrw_id = #{khrwId},</if> <if test="pcId != null">pc_id = #{pcId},</if>
<if test="khrwName != null">khrw_name = #{khrwName},</if> <if test="pcName != null">pc_name = #{pcName},</if>
<if test="tableHeader != null">table_header = #{tableHeader},</if> <if test="tableHeader != null">table_header = #{tableHeader},</if>
<if test="tableData != null">table_data = #{tableData},</if> <if test="tableData != null">table_data = #{tableData},</if>
<if test="endScore != null">end_score = #{endScore},</if>
<if test="createBy != null">create_by = #{createBy},</if> <if test="createBy != null">create_by = #{createBy},</if>
<if test="createTime != null">create_time = #{createTime},</if> <if test="createTime != null">create_time = #{createTime},</if>
<if test="updateBy != null">update_by = #{updateBy},</if> <if test="updateBy != null">update_by = #{updateBy},</if>

@ -1,26 +1,18 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px"> <el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
<el-form-item label="考核任务id" prop="khrwId"> <el-form-item label="考核id" prop="pcId">
<el-input <el-input
v-model="queryParams.khrwId" v-model="queryParams.pcId"
placeholder="请输入考核任务id" placeholder="请输入考核id"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="考核任务名称" prop="khrwName"> <el-form-item label="考核名称" prop="pcName">
<el-input <el-input
v-model="queryParams.khrwName" v-model="queryParams.pcName"
placeholder="请输入考核任务名称" placeholder="请输入考核名称"
clearable
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="得分" prop="endScore">
<el-input
v-model="queryParams.endScore"
placeholder="请输入得分"
clearable clearable
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
@ -80,11 +72,10 @@
<el-table v-loading="loading" :data="kh_resultList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="kh_resultList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="主键" align="center" prop="id" /> <el-table-column label="主键" align="center" prop="id" />
<el-table-column label="考核任务id" align="center" prop="khrwId" /> <el-table-column label="考核id" align="center" prop="pcId" />
<el-table-column label="考核任务名称" align="center" prop="khrwName" /> <el-table-column label="考核名称" align="center" prop="pcName" />
<el-table-column label="表头" align="center" prop="tableHeader" /> <el-table-column label="表头" align="center" prop="tableHeader" />
<el-table-column label="表数据" align="center" prop="tableData" /> <el-table-column label="表数据" align="center" prop="tableData" />
<el-table-column label="得分" align="center" prop="endScore" />
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" />
<el-table-column label="操作" align="center" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope"> <template slot-scope="scope">
@ -117,11 +108,11 @@
<!-- 添加或修改考核结果对话框 --> <!-- 添加或修改考核结果对话框 -->
<el-dialog :title="title" :visible.sync="open" width="500px" append-to-body> <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
<el-form ref="form" :model="form" :rules="rules" label-width="80px"> <el-form ref="form" :model="form" :rules="rules" label-width="80px">
<el-form-item label="考核任务id" prop="khrwId"> <el-form-item label="考核id" prop="pcId">
<el-input v-model="form.khrwId" placeholder="请输入考核任务id" /> <el-input v-model="form.pcId" placeholder="请输入考核id" />
</el-form-item> </el-form-item>
<el-form-item label="考核任务名称" prop="khrwName"> <el-form-item label="考核名称" prop="pcName">
<el-input v-model="form.khrwName" placeholder="请输入考核任务名称" /> <el-input v-model="form.pcName" placeholder="请输入考核名称" />
</el-form-item> </el-form-item>
<el-form-item label="表头" prop="tableHeader"> <el-form-item label="表头" prop="tableHeader">
<el-input v-model="form.tableHeader" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.tableHeader" type="textarea" placeholder="请输入内容" />
@ -129,9 +120,6 @@
<el-form-item label="表数据" prop="tableData"> <el-form-item label="表数据" prop="tableData">
<el-input v-model="form.tableData" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.tableData" type="textarea" placeholder="请输入内容" />
</el-form-item> </el-form-item>
<el-form-item label="得分" prop="endScore">
<el-input v-model="form.endScore" placeholder="请输入得分" />
</el-form-item>
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" /> <el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
</el-form-item> </el-form-item>
@ -173,18 +161,17 @@ export default {
queryParams: { queryParams: {
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
khrwId: null, pcId: null,
khrwName: null, pcName: null,
tableHeader: null, tableHeader: null,
tableData: null, tableData: null,
endScore: null,
}, },
// //
form: {}, form: {},
// //
rules: { rules: {
khrwId: [ pcId: [
{ required: true, message: "考核任务id不能为空", trigger: "blur" } { required: true, message: "考核id不能为空", trigger: "blur" }
], ],
} }
} }
@ -211,11 +198,10 @@ export default {
reset() { reset() {
this.form = { this.form = {
id: null, id: null,
khrwId: null, pcId: null,
khrwName: null, pcName: null,
tableHeader: null, tableHeader: null,
tableData: null, tableData: null,
endScore: null,
createBy: null, createBy: null,
createTime: null, createTime: null,
updateBy: null, updateBy: null,

Loading…
Cancel
Save