Merge remote-tracking branch 'origin/main'

main
wanglei 2 months ago
commit 7f33ddb920

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

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

@ -122,10 +122,11 @@ public class KhKhrwResultServiceImpl implements IKhKhrwResultService
children.add(tableColumn); children.add(tableColumn);
JSONObject tableColumn2 = new JSONObject(); 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("name", pyPCtitle);
tableColumn2.put("label", pc.getPcTitle()); //tableColumn2.put("label", pc.getPcTitle());
tableColumn2.put("label", pc.getTemplateName());
//----------------------------------------------------------------------------------------- //-----------------------------------------------------------------------------------------
JSONArray endData = new JSONArray(); //存放表格数据 JSONArray endData = new JSONArray(); //存放表格数据
@ -250,6 +251,7 @@ public class KhKhrwResultServiceImpl implements IKhKhrwResultService
KhKhrwResult pcResult = new KhKhrwResult(); KhKhrwResult pcResult = new KhKhrwResult();
pcResult.setPcId(pc.getId()); pcResult.setPcId(pc.getId());
pcResult.setPcName(pc.getPcTitle()); pcResult.setPcName(pc.getPcTitle());
pcResult.setTemName(pc.getTemplateName());
pcResult.setTableHeader(children.toJSONString()); pcResult.setTableHeader(children.toJSONString());
pcResult.setTableData(endData.toJSONString()); pcResult.setTableData(endData.toJSONString());
if(isUpdate){ if(isUpdate){

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

Loading…
Cancel
Save