考核得分及汇总得分,修改使用考核任务模板名称展示

main
hshansha 2 months ago
parent a6867c339f
commit 05d511e576

@ -235,14 +235,14 @@ public class KhGatherController extends BaseController {
} else { //引用考核任务
Long pcId = jobj.getLong("id");
String khrwName = jobj.getString("title");
String pykhrwName = PinYinUtil.getPinyinInitials(khrwName);
//根据pcId获取考核任务结果
KhKhrwResult khrwResult = new KhKhrwResult();
khrwResult.setPcId(pcId);
//获取考核任务结果
List<KhKhrwResult> khrw = khKhrwResultService.selectKhKhrwResultList(khrwResult);
String khrwName = jobj.getString("title");
String pykhrwName = PinYinUtil.getPinyinInitials(khrwName);
if (khrw != null && khrw.size() > 0) {
khrwName=khrw.get(0).getTemName();//从这把考核任务名改为对应模板名称
//----------组合表头数据---------
JSONArray tableHeader = new JSONArray(khrw.get(0).getTableHeader());
btKhdx = tableHeader.getJSONObject(0);//下标0 单位/姓名
@ -267,7 +267,9 @@ public class KhGatherController extends BaseController {
for (Object tabledatum : tabledata) {
JSONObject obj = (JSONObject) tabledatum;
JSONObject erji = new JSONObject(true);
//------------------------------------
erji.put(pinyinKhrw, obj.get(pinyinKhrw));
//------------------------------------
erji.put(pinyinKhrw + "_df", obj.get(pinyinKhrw + "_df"));
if (zb != null) { //代表当前引用考核任务有占比
BigDecimal zsfs = zb.multiply((BigDecimal) obj.get(pinyinKhrw + "_df"));

@ -26,6 +26,10 @@ public class KhKhrwResult extends BaseEntity
@Excel(name = "考核名称")
private String pcName;
/** 模板名称 */
@Excel(name = "模板名称")
private String temName;
/** 表头 */
@Excel(name = "表头")
private String tableHeader;
@ -34,6 +38,14 @@ public class KhKhrwResult extends BaseEntity
@Excel(name = "表数据")
private String tableData;
public String getTemName() {
return temName;
}
public void setTemName(String temName) {
this.temName = temName;
}
public void setId(Long id)
{
this.id = id;
@ -90,6 +102,7 @@ public class KhKhrwResult extends BaseEntity
.append("id", getId())
.append("pcId", getPcId())
.append("pcName", getPcName())
.append("temName", getTemName())
.append("tableHeader", getTableHeader())
.append("tableData", getTableData())
.append("createBy", getCreateBy())

@ -122,10 +122,11 @@ public class KhKhrwResultServiceImpl implements IKhKhrwResultService
children.add(tableColumn);
JSONObject tableColumn2 = new JSONObject();
String pyPCtitle = PinYinUtil.getPinyinInitials(pc.getPcTitle());
//String pyPCtitle = PinYinUtil.getPinyinInitials(pc.getPcTitle());
String pyPCtitle = PinYinUtil.getPinyinInitials(pc.getTemplateName()); //表格表头lable改为使用模板名称
tableColumn2.put("name", pyPCtitle);
tableColumn2.put("label", pc.getPcTitle());
//tableColumn2.put("label", pc.getPcTitle());
tableColumn2.put("label", pc.getTemplateName());
//-----------------------------------------------------------------------------------------
JSONArray endData = new JSONArray(); //存放表格数据
@ -250,6 +251,7 @@ public class KhKhrwResultServiceImpl implements IKhKhrwResultService
KhKhrwResult pcResult = new KhKhrwResult();
pcResult.setPcId(pc.getId());
pcResult.setPcName(pc.getPcTitle());
pcResult.setTemName(pc.getTemplateName());
pcResult.setTableHeader(children.toJSONString());
pcResult.setTableData(endData.toJSONString());
if(isUpdate){

@ -8,6 +8,7 @@
<result property="id" column="id" />
<result property="pcId" column="pc_id" />
<result property="pcName" column="pc_name" />
<result property="temName" column="tem_name" />
<result property="tableHeader" column="table_header" />
<result property="tableData" column="table_data" />
<result property="createBy" column="create_by" />
@ -18,7 +19,7 @@
</resultMap>
<sql id="selectKhKhrwResultVo">
select id, pc_id, pc_name, table_header, table_data, create_by, create_time, update_by, update_time, remark from kh_khrw_result
select id, pc_id, pc_name,tem_name, table_header, table_data, create_by, create_time, update_by, update_time, remark from kh_khrw_result
</sql>
<select id="selectKhKhrwResultList" parameterType="KhKhrwResult" resultMap="KhKhrwResultResult">
@ -26,6 +27,7 @@
<where>
<if test="pcId != null "> and pc_id = #{pcId}</if>
<if test="pcName != null and pcName != ''"> and pc_name like concat('%', #{pcName}, '%')</if>
<if test="temName != null and temName != ''"> and tem_name like concat('%', #{temName}, '%')</if>
<if test="tableHeader != null and tableHeader != ''"> and table_header = #{tableHeader}</if>
<if test="tableData != null and tableData != ''"> and table_data = #{tableData}</if>
</where>
@ -41,6 +43,7 @@
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="pcId != null">pc_id,</if>
<if test="pcName != null">pc_name,</if>
<if test="temName != null">tem_name,</if>
<if test="tableHeader != null">table_header,</if>
<if test="tableData != null">table_data,</if>
<if test="createBy != null">create_by,</if>
@ -52,6 +55,7 @@
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="pcId != null">#{pcId},</if>
<if test="pcName != null">#{pcName},</if>
<if test="temName != null">#{temName},</if>
<if test="tableHeader != null">#{tableHeader},</if>
<if test="tableData != null">#{tableData},</if>
<if test="createBy != null">#{createBy},</if>
@ -67,6 +71,7 @@
<trim prefix="SET" suffixOverrides=",">
<if test="pcId != null">pc_id = #{pcId},</if>
<if test="pcName != null">pc_name = #{pcName},</if>
<if test="temName != null">tem_name = #{temName},</if>
<if test="tableHeader != null">table_header = #{tableHeader},</if>
<if test="tableData != null">table_data = #{tableData},</if>
<if test="createBy != null">create_by = #{createBy},</if>

Loading…
Cancel
Save