Commit d1d93b73 authored by wangxl's avatar wangxl

1

parent 73f4d0b7
...@@ -49,7 +49,7 @@ public class ComEvaluationItemDTO extends BaseDTO { ...@@ -49,7 +49,7 @@ public class ComEvaluationItemDTO extends BaseDTO {
/** 父Id */ /** 父Id */
@ApiModelProperty(value = "父Id", position = 2) @ApiModelProperty(value = "父Id", position = 2)
private String ppId; private String parentId1;
/** 内容 */ /** 内容 */
@ApiModelProperty(value = "内容", position = 2) @ApiModelProperty(value = "内容", position = 2)
@Length(max=200, message = "内容不能大于200") @Length(max=200, message = "内容不能大于200")
...@@ -57,9 +57,21 @@ public class ComEvaluationItemDTO extends BaseDTO { ...@@ -57,9 +57,21 @@ public class ComEvaluationItemDTO extends BaseDTO {
/** 父Id */ /** 父Id */
@ApiModelProperty(value = "父Id", position = 2) @ApiModelProperty(value = "父Id", position = 2)
private String pId; private String parentId2;
/** 内容 */ /** 内容 */
@ApiModelProperty(value = "内容", position = 2) @ApiModelProperty(value = "内容", position = 2)
@Length(max=200, message = "内容不能大于200") @Length(max=200, message = "内容不能大于200")
private String content2; private String content2;
/** 父Id */
@ApiModelProperty(value = "父Id", position = 2)
private String parentId3;
/** 内容 */
@ApiModelProperty(value = "内容", position = 2)
@Length(max=200, message = "内容不能大于200")
private String content3;
/** 备注 */
@ApiModelProperty(value = "备注", position = 2)
@Length(max=200, message = "备注")
private String remark3;
} }
...@@ -58,7 +58,7 @@ public class ComEvaluationValueDTO extends BaseDTO { ...@@ -58,7 +58,7 @@ public class ComEvaluationValueDTO extends BaseDTO {
/** 父Id */ /** 父Id */
@ApiModelProperty(value = "父Id", position = 2) @ApiModelProperty(value = "父Id", position = 2)
private String ppId; private String parentId1;
/** 内容 */ /** 内容 */
@ApiModelProperty(value = "内容", position = 2) @ApiModelProperty(value = "内容", position = 2)
@Length(max=200, message = "内容不能大于200") @Length(max=200, message = "内容不能大于200")
...@@ -66,15 +66,40 @@ public class ComEvaluationValueDTO extends BaseDTO { ...@@ -66,15 +66,40 @@ public class ComEvaluationValueDTO extends BaseDTO {
/** 父Id */ /** 父Id */
@ApiModelProperty(value = "父Id", position = 2) @ApiModelProperty(value = "父Id", position = 2)
private String pId; private String parentId2;
/** 内容 */ /** 内容 */
@ApiModelProperty(value = "内容", position = 2) @ApiModelProperty(value = "内容", position = 2)
@Length(max=200, message = "内容不能大于200") @Length(max=200, message = "内容不能大于200")
private String content2; private String content2;
/** 父Id */
@ApiModelProperty(value = "父Id", position = 2)
private String parentId3;
/** 内容 */
@ApiModelProperty(value = "内容", position = 2)
@Length(max=200, message = "内容不能大于200")
private String content3;
/** 备注 */
@ApiModelProperty(value = "备注", position = 2)
@Length(max=200, message = "备注")
private String remark3;
/** 组名 */
@ApiModelProperty(value = "组名", position = 2)
@Length(max=200, message = "组名")
private String groupName;
/** 组序号 */
@ApiModelProperty(value = "组序号", position = 2)
@Length(max=200, message = "组序号")
private List<Integer> groupItem;
/** 合并单元格字段 */ /** 合并单元格字段 */
private Integer row1; private Integer row1;
/** 合并单元格字段 */ /** 合并单元格字段 */
private Integer row2; private Integer row2;
/** 合并单元格字段 */
private Integer row3;
} }
...@@ -17,7 +17,9 @@ import org.springframework.beans.factory.annotation.Autowired; ...@@ -17,7 +17,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
import java.util.List; import java.util.List;
import java.util.Map;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@Service @Service
...@@ -47,24 +49,40 @@ public class ComEvaluationValueServiceImpl extends BaseServiceImpl<ComEvaluation ...@@ -47,24 +49,40 @@ public class ComEvaluationValueServiceImpl extends BaseServiceImpl<ComEvaluation
list.add(dto); list.add(dto);
}); });
} }
final String[] ppId = {""}; final String[] parentId1 = {""};
final String[] pId = {""}; final String[] parentId2 = {""};
final String[] parentId3 = {""};
final int[] groupIndex = {0};
final int[] groupItem = {0};
final List<Integer>[] itemList = new List[]{new ArrayList<>()};
list.forEach((e) -> { list.forEach((e) -> {
if (!ppId[0].equals(e.getPpId())) { if (!parentId1[0].equals(e.getParentId1())) {
Integer row1 = list.stream().filter(f -> f.getPpId().equals(e.getPpId())).collect(Collectors.toList()).size(); Integer row1 = list.stream().filter(f -> f.getParentId1().equals(e.getParentId1())).collect(Collectors.toList()).size();
e.setRow1(row1); e.setRow1(row1);
ppId[0] = e.getPpId(); parentId1[0] = e.getParentId1();
} else { } else {
e.setRow1(0); e.setRow1(0);
} }
if (!pId[0].equals(e.getPId())) { if (!parentId2[0].equals(e.getParentId2())) {
Integer row2 = list.stream().filter(f -> f.getPId().equals(e.getPId())).collect(Collectors.toList()).size(); Integer row2 = list.stream().filter(f -> f.getParentId2().equals(e.getParentId2())).collect(Collectors.toList()).size();
e.setRow2(row2); e.setRow2(row2);
pId[0] = e.getPId(); parentId2[0] = e.getParentId2();
} else { } else {
e.setRow2(0); e.setRow2(0);
} }
e.setMaxScore(10); if (!parentId3[0].equals(e.getParentId3())) {
Integer row3 = list.stream().filter(f -> f.getParentId3().equals(e.getParentId3())).collect(Collectors.toList()).size();
e.setRow3(row3);
itemList[0] = new ArrayList<>();
groupIndex[0]++;
parentId3[0] = e.getParentId3();
} else {
e.setRow3(0);
}
itemList[0].add(groupItem[0]);
e.setGroupItem(itemList[0]);
e.setGroupName("group" + groupIndex[0]);
groupItem[0]++;
}); });
return list; return list;
} }
......
...@@ -178,9 +178,9 @@ public class ComTalentAssignServiceImpl extends BaseServiceImpl<ComTalentAssignD ...@@ -178,9 +178,9 @@ public class ComTalentAssignServiceImpl extends BaseServiceImpl<ComTalentAssignD
public ComTalentAssignDTO getAssignExpertById(String id) { public ComTalentAssignDTO getAssignExpertById(String id) {
ComTalentAssignDTO dto = comTalentAssignDAO.getAssignExpertById(id); ComTalentAssignDTO dto = comTalentAssignDAO.getAssignExpertById(id);
if (null != dto) { // if (null != dto) {
dto.setSpecList(comExpertSpecService.getListByExpertId(dto.getExpertId())); // dto.setSpecList(comExpertSpecService.getListByExpertId(dto.getExpertId()));
} // }
dto.setScoreList(comEvaluationValueService.getListByAssignId(id)); dto.setScoreList(comEvaluationValueService.getListByAssignId(id));
return dto; return dto;
} }
......
...@@ -20,6 +20,7 @@ import static com.yiboshi.science.utils.ProjectInfoToPDF.getCurrentOperatingSyst ...@@ -20,6 +20,7 @@ import static com.yiboshi.science.utils.ProjectInfoToPDF.getCurrentOperatingSyst
public class TaskInfoToPDFUtil { public class TaskInfoToPDFUtil {
static SimpleDateFormat fd = new SimpleDateFormat("yyyy-MM");
static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); static SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
static SimpleDateFormat sdfM = new SimpleDateFormat("yyyy年MM月"); static SimpleDateFormat sdfM = new SimpleDateFormat("yyyy年MM月");
...@@ -108,11 +109,11 @@ public class TaskInfoToPDFUtil { ...@@ -108,11 +109,11 @@ public class TaskInfoToPDFUtil {
private static void firstPageInfo(Document document, ComProjectTaskDTO dto, BaseFont bfChinese, BaseFont fsChinese) throws DocumentException { private static void firstPageInfo(Document document, ComProjectTaskDTO dto, BaseFont bfChinese, BaseFont fsChinese) throws DocumentException {
Font normalFont = new Font(bfChinese, 16, Font.NORMAL); Font normalFont = new Font(bfChinese, 16, Font.NORMAL);
// 添加附件编号 // // 添加附件编号
Paragraph attachment = new Paragraph("附件4", normalFont); // Paragraph attachment = new Paragraph("附件4", normalFont);
attachment.setAlignment(Element.ALIGN_LEFT); // attachment.setAlignment(Element.ALIGN_LEFT);
document.add(attachment); // document.add(attachment);
document.add(new Paragraph("\n")); // document.add(new Paragraph("\n"));
// 从DTO获取项目编号 // 从DTO获取项目编号
Paragraph projectNoPara = new Paragraph("项目编号:" + dto.getProjNo(), normalFont); Paragraph projectNoPara = new Paragraph("项目编号:" + dto.getProjNo(), normalFont);
...@@ -137,7 +138,7 @@ public class TaskInfoToPDFUtil { ...@@ -137,7 +138,7 @@ public class TaskInfoToPDFUtil {
addTablePageCell(table, "项目下达单位(甲方):", 4, dto.getAppUnitName(), null, labelFont); addTablePageCell(table, "项目下达单位(甲方):", 4, dto.getAppUnitName(), null, labelFont);
addTablePageCell(table, "项目承担单位(乙方):", 4, dto.getAppUnitName(), null, labelFont); addTablePageCell(table, "项目承担单位(乙方):", 4, dto.getAppUnitName(), null, labelFont);
addTablePageCell(table, "项目负责人:", 2, dto.getAppPersonName(), 3, labelFont); addTablePageCell(table, "项目负责人:", 2, dto.getAppPersonName(), 3, labelFont);
addTablePageCell(table, "项目起止年限:", 3, sdf.format(dto.getStartDate()) + " 至 " + sdf.format(dto.getEndDate()), 2, labelFont); addTablePageCell(table, "项目起止年限:", 3, fd.format(dto.getStartDate()) + " 至 " + fd.format(dto.getEndDate()), 2, labelFont);
document.add(table); document.add(table);
} }
......
...@@ -7,11 +7,15 @@ ...@@ -7,11 +7,15 @@
t.user_id as userId, t.role_id as roleId, t.login_time as loginTime, t.login_ip as loginIp, t.remark as remark t.user_id as userId, t.role_id as roleId, t.login_time as loginTime, t.login_ip as loginIp, t.remark as remark
</sql> </sql>
<select id="getListByEvaluationId" parameterType="java.lang.String" resultType="com.yiboshi.science.param.dto.ComEvaluationItemDTO"> <select id="getListByEvaluationId" parameterType="java.lang.String" resultType="com.yiboshi.science.param.dto.ComEvaluationItemDTO">
SELECT a.*,b.content content2, b.id pId,c.content content1, c.id ppId SELECT d.id parentId1,d.content content1,
c.id parentId2,c.content content2,
b.id parentId3,b.content content3,b.remark remark3,
a.*
FROM com_evaluation_item a FROM com_evaluation_item a
left join com_evaluation_item b on a.parent_id=b.id left join com_evaluation_item b on a.parent_id=b.id
left join com_evaluation_item c on b.parent_id=c.id left join com_evaluation_item c on b.parent_id=c.id
where a.evaluation_id=#{evaluationId} and b.id is not null and c.id is not null and a.state=1 and b.state=1 and c.state=1 left join com_evaluation_item d on c.parent_id=d.id
order by a.show_index asc where a.evaluation_id=#{evaluationId} and a.remark='4'
order by d.show_index,c.show_index,b.show_index,a.show_index asc
</select> </select>
</mapper> </mapper>
...@@ -8,12 +8,15 @@ ...@@ -8,12 +8,15 @@
</sql> </sql>
<select id="getListByAssignId" parameterType="java.lang.String" resultType="com.yiboshi.science.param.dto.ComEvaluationValueDTO"> <select id="getListByAssignId" parameterType="java.lang.String" resultType="com.yiboshi.science.param.dto.ComEvaluationValueDTO">
SELECT b.*,a.item_id,a.assign_id,a.detail,a.count,a.score, SELECT b.*,a.item_id,a.assign_id,a.detail,a.count,a.score,
c.content content2, c.id pId,d.content content1, d.id ppId c.id parentId3,c.content content3,c.remark remark3,
b.id parentId2,b.content content2,
e.id parentId1,e.content content1
FROM com_evaluation_value a FROM com_evaluation_value a
left join com_evaluation_item b on a.item_id=b.id left join com_evaluation_item b on a.item_id=b.id
left join com_evaluation_item c on b.parent_id=c.id left join com_evaluation_item c on b.parent_id=c.id
left join com_evaluation_item d on c.parent_id=d.id left join com_evaluation_item d on c.parent_id=d.id
left join com_evaluation_item e on d.parent_id=e.id
where a.assign_id=#{assignId} where a.assign_id=#{assignId}
order by b.show_index asc order by e.show_index,d.show_index,c.show_index,b.show_index asc
</select> </select>
</mapper> </mapper>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment