资料维护

This commit is contained in:
zhangqinlin
2021-09-08 13:41:37 +08:00
parent faa7c3af56
commit 7f3736d2ef
18 changed files with 200 additions and 136 deletions
@@ -30,6 +30,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import javax.annotation.Resource;
import javax.validation.Valid;
/**
@@ -141,7 +142,7 @@ public class PayCaseCommitteeSubitemController extends JeroController<PayCaseCom
@AutoLog(value = "分标委成员表-添加")
@ApiOperation(value="分标委成员表-添加", notes="分标委成员表-添加")
@PostMapping(value = "/add")
public Result<?> add(@RequestBody PayCaseCommitteeSubitemDTO payCaseCommitteeSubitemDTO) {
public Result<?> add(@Valid @RequestBody PayCaseCommitteeSubitemDTO payCaseCommitteeSubitemDTO) {
PayCaseCommitteeSubitem payCaseCommitteeSubitem = new PayCaseCommitteeSubitem();
BeanUtils.copyProperties(payCaseCommitteeSubitemDTO,payCaseCommitteeSubitem);
payCaseCommitteeSubitemService.save(payCaseCommitteeSubitem);
@@ -14,6 +14,7 @@ import com.jero.common.api.vo.Result;
import com.jero.common.aspect.annotation.AutoLog;
import com.jero.common.system.base.controller.JeroController;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.ValidUtil;
import com.jero.data.entity.DTO.PayDataDirectoryDTO;
import com.jero.data.entity.PayDataDirectory;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@@ -71,6 +72,29 @@ public class PayDataDirectoryController extends JeroController<PayDataDirectory,
.collect(Collectors.toList());
return Result.OK(collect);
}
/**
* 资料会议树
*
* @return
*/
@AutoLog(value = "资料目录会议-树")
@ApiOperation(value = "资料目录会议-树", notes = "资料目录会议-树")
@GetMapping(value = "/meetingTree")
public Result<?> meetingTree() {
LoginUser sysUser =(LoginUser) SecurityUtils.getSubject().getPrincipal();
QueryWrapper<PayDataDirectory> queryWrapper = new QueryWrapper();
queryWrapper.eq("type",2);
queryWrapper.eq("create_by",sysUser.getUsername());
List<PayDataDirectory> list = payDataDirectoryService.list(queryWrapper);
List<DirectoryToTree> collect = list.stream()
.filter(payDataDirectory -> "0".equals(payDataDirectory.getParentId()))
.map(payDataDirectory -> {
DirectoryToTree directoryToTree = transtoTree(payDataDirectory, list);
return directoryToTree;
}).sorted(Comparator.comparing(DirectoryToTree::getSort))
.collect(Collectors.toList());
return Result.OK(collect);
}
/**
* 转换为树
@@ -36,6 +36,7 @@ import lombok.extern.slf4j.Slf4j;
import org.apache.commons.collections.CollectionUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.ObjectUtils;
import org.springframework.web.bind.annotation.*;
@@ -68,6 +69,9 @@ public class PayDataFileController extends JeroController<PayDataFile, IPayDataF
@Resource
private IPayMeetingSituationService payMeetingSituationService;
@Value("${jero.path.upload}")
public static String upLoadPath;
//拼接目录结构
StringBuffer stringBuffer;
@@ -403,9 +407,10 @@ public class PayDataFileController extends JeroController<PayDataFile, IPayDataF
*/
@AutoLog(value = "导出下载")
@ApiOperation(value="导出下载", notes="导出下载")
@ApiImplicitParam(name = "fileNames", value = "文件名称,多个以逗号隔开")
@GetMapping(value = "/importFile")
public void importFile(@RequestParam(name="fileName") String fileName) {
ArrayList<String> fileIdList = new ArrayList<>(Arrays.asList(fileName.split(",")));
public void importFile(@RequestParam(name="fileNames") String fileNames) {
ArrayList<String> fileIdList = new ArrayList<>(Arrays.asList(fileNames.split(",")));
zipFileDownload(fileIdList);
}
@@ -444,7 +449,7 @@ public class PayDataFileController extends JeroController<PayDataFile, IPayDataF
zipos = new ZipOutputStream(new BufferedOutputStream(response.getOutputStream()));
zipos.setMethod(ZipOutputStream.DEFLATED); //设置压缩方法
for (String path : paths){
File file = new File("D:\\opt\\upFiles" + "\\" + path + ".pdf");
File file = new File(upLoadPath + "\\" + path + ".pdf");
if(file.exists()){
try {
//添加ZipEntry,并ZipEntry中写入文件流
@@ -45,7 +45,7 @@ import io.swagger.annotations.ApiOperation;
@Slf4j
public class PayFileDownloadRecordController extends JeroController<PayFileDownloadRecord, IPayFileDownloadRecordService> {
@Value("${jero.path.upload}")
private String upLoadPath;
public static String upLoadPath;
@Autowired
private IPayFileDownloadRecordService payFileDownloadRecordService;
@@ -98,7 +98,7 @@ public class PayFileDownloadRecordController extends JeroController<PayFileDownl
byte[] buff = new byte[1024];
BufferedInputStream bis = null;
// 读取filename
bis = new BufferedInputStream(new FileInputStream(new File("D:\\opt\\upFiles\\"+filename +".pdf")));
bis = new BufferedInputStream(new FileInputStream(new File(upLoadPath+"\\"+filename +".pdf")));
int i = bis.read(buff);
while (i != -1) {
outputStream.write(buff, 0, buff.length);
@@ -24,6 +24,6 @@ public class PayDataDirectoryDTO {
@ApiModelProperty(value = "备注")
private java.lang.String remarks;
@ApiModelProperty(value = "类型(1:分标委,2:会议)")
@ApiModelProperty(value = "类型(1:资料,2:会议)")
private java.lang.Integer type;
}
@@ -5,9 +5,6 @@ import lombok.Data;
@Data
public class queryPeopleByCompanyIdAndMeetingId {
@ApiModelProperty(value = "id")
private String id;
@ApiModelProperty(value = "联系人id")
private String contactId;
@@ -19,7 +19,7 @@
pf.file_id as dataId,
pf.file_path as filePath,
of.file_name as fileName,
pd.meetingId,
pd.meeting_id as meetingId,
pm.meeting_name as meetingName,
pm.start_time as meetingTime,
dt.downLodeTime,
@@ -33,11 +33,10 @@
<select id="queryPeopleByCompanyIdAndMeetingId" resultType="com.jero.data.entity.queryPeopleByCompanyIdAndMeetingId">
SELECT
ps.user_id as id,
pm.id as contactId,
ps.user_name as userName,
pm.email as email
FROM pay_meeting_situation as ps left join pay_contacts_management as pm on(ps.user_id=pm.id)
ps.company_contact_id as contactId,
ps.company_contact_name as userName,
ps.email as email
FROM pay_meeting_situation as ps
${ew.customSqlSegment}
</select>
</mapper>