add:政策课题修改

This commit is contained in:
wxyclub
2023-10-20 17:47:24 +08:00
parent dc12095999
commit a0118d1bae
4 changed files with 100 additions and 5 deletions
@@ -31,11 +31,11 @@ public class SarLawsTopicController extends BaseController<SarLawsTopicVO> {
@ApiOperation(value = "根据政策课题ID查询会议信息")
@GetMapping("/getLawsTopicInfo")
public ResponseMessage<SarLawsTopic> getLawsTopicInfo(String lawsTopicId){
if (StringUtils.isBlank(lawsTopicId)) {
public ResponseMessage<SarLawsTopic> getLawsTopicInfo(String id) throws Exception{
if (StringUtils.isBlank(id)) {
return Result.error("会议ID为空!");
}
SarLawsTopic sarLawsTopic = lawsTopicService.getLawsTopicInfo(lawsTopicId);
SarLawsTopic sarLawsTopic = lawsTopicService.getLawsTopicInfo(id);
return Result.success(sarLawsTopic);
}
@@ -80,6 +80,12 @@ public class SarLawsTopic implements Serializable {
@TableField(value = "AGREEMENT")
private String agreement;
/**
* 协议真实文件名
*/
@TableField(exist = false)
private String agreementRealName;
/**
* 课题组会议列表
*/
@@ -92,24 +98,48 @@ public class SarLawsTopic implements Serializable {
@TableField(value = "RESEARCH_PLAN")
private String researchPlan;
/**
* 课题组研究方案真实文件名
*/
@TableField(exist = false)
private String researchPlanRealName;
/**
* 课题组研究成果
*/
@TableField(value = "RESEARCH_FINDINGS")
private String researchFindings;
/**
* 课题组研究成果真实文件名
*/
@TableField(exist = false)
private String researchFindingsRealName;
/**
* 课题组其他
*/
@TableField(value = "RESEARCH_GROUP_OTHER")
private String researchGroupOther;
/**
* 课题组其他真实文件名
*/
@TableField(exist = false)
private String researchGroupOtherRealName;
/**
* 课题组会议资料
*/
@TableField(value = "CONFERENCE_MATERIALS")
private String conferenceMaterials;
/**
* 课题组会议资料真实文件名
*/
@TableField(exist = false)
private String conferenceMaterialsRealName;
/**
* 课题组联系方式
*/
@@ -122,30 +152,60 @@ public class SarLawsTopic implements Serializable {
@TableField(value = "INSIDE_PROJECT_PROPOSAL_REPORT")
private String insideProjectProposalRepost;
/**
* 内部资料立项报告真实文件名
*/
@TableField(exist = false)
private String insideProjectProposalRepostRealName;
/**
* 内部资料研究方案
*/
@TableField(value = "INSIDE_RESEARCH_PLAN")
private String insideResearchPlan;
/**
* 内部资料研究方案真实文件名
*/
@TableField(exist = false)
private String insideResearchPlanRealName;
/**
* 内部资料会议资料
*/
@TableField(value = "INSIDE_CONFERENCE_MATERIALS")
private String insideConferenceMaterials;
/**
* 内部资料会议资料真实文件名
*/
@TableField(exist = false)
private String insideConferenceMaterialsRealName;
/**
* 内部会议研究成果
*/
@TableField(value = "INSIDE_RESEARCH_FINDINGS")
private String insideResearchFindings;
/**
* 内部会议研究成果真实文件名
*/
@TableField(exist = false)
private String insideResearchFindingsRealName;
/**
* 内部会议其他
*/
@TableField(value = "INSIDE_OTHER")
private String insideOther;
/**
* 内部会议其他真实文件名
*/
@TableField(exist = false)
private String insideOtherRealName;
/**
* 内部联系方式
*/
@@ -13,7 +13,7 @@ import java.util.List;
*/
public interface SarLawsTopicService extends IService<SarLawsTopic> {
SarLawsTopic getLawsTopicInfo(String lawsTopicId);
SarLawsTopic getLawsTopicInfo(String lawsTopicId) throws Exception;
Integer addLawsTopicInfo(SarLawsTopic lawsTopic);
@@ -1,5 +1,7 @@
package com.adc.da.slrs.sarLawsTopic.service.impl;
import com.adc.da.att.entity.AttFileEO;
import com.adc.da.att.service.impl.AttFileEOServiceImpl;
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsContactInformation;
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicMeeting;
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicVO;
@@ -16,6 +18,8 @@ import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@@ -31,13 +35,44 @@ public class SarLawsTopicServiceImpl extends ServiceImpl<SarLawsTopicMapper, Sar
@Resource
private SarLawsTopicMeetingService meetingService;
@Resource
private AttFileEOServiceImpl attFileEOService;
@Resource
private SarLawsContactInformationService contactInformationService;
@Override
public SarLawsTopic getLawsTopicInfo(String lawsTopicId) {
public SarLawsTopic getLawsTopicInfo(String lawsTopicId) throws Exception {
String[] fileFieldArray = {"agreement","researchPlan","researchFindings","researchGroupOther","conferenceMaterials",
"insideProjectProposalRepost","insideResearchPlan","insideConferenceMaterials","insideResearchFindings","insideOther"};
SarLawsTopic sarLawsTopic = this.baseMapper.selectById(lawsTopicId);
Class<? extends SarLawsTopic> aClass = sarLawsTopic.getClass();
for (String fileField : fileFieldArray) {
fileField = fileField.substring(0,1).toUpperCase() + fileField.substring(1);
Method getMethod = aClass.getMethod("get" + fileField);
String attIds = (String) getMethod.invoke(sarLawsTopic, null);
if (StringUtils.isNotBlank(attIds)) {
String[] split = attIds.split(",");
List<String> tempList = new ArrayList<>();
for (String attId : split) {
AttFileEO fileInfo = attFileEOService.getFileInfo(attId);
tempList.add(fileInfo.getOldFileName());
}
Method setMethod = aClass.getMethod("set" + fileField + "RealName", String.class);
String join = String.join(",", tempList);
System.out.println(fileField+""+join);
setMethod.invoke(sarLawsTopic,join);
}
}
if (StringUtils.isNotBlank(sarLawsTopic.getAgreement())) {
String[] split = sarLawsTopic.getAgreement().split(",");
List<String> tempList = new ArrayList<>();
for (String attId : split) {
AttFileEO fileInfo = attFileEOService.getFileInfo(attId);
tempList.add(fileInfo.getOldFileName());
}
sarLawsTopic.setAgreementRealName(StringUtils.join(tempList));
}
if (sarLawsTopic != null) {
// 查询课题组会议
LambdaQueryWrapper<SarLawsTopicMeeting> meetingWrapper = new LambdaQueryWrapper<>();