提交 1b9e7a46 authored 作者: 133's avatar 133

[清退、配置] 添加任务ID查询相关单据接口 以及 文件描述枚举

上级 c3bfdfb0
package com.tykj.dev.config.base;
import lombok.AllArgsConstructor;
@AllArgsConstructor
public enum FileName {
/**
* 申请单
*/
APPLY(1,"申请单"),
/**
* 批复单
*/
REPLY(2,"批复单"),
/**
* 回执单
*/
RECEIPT(3,"回执单"),
/**
* 签收单
*/
SIGN(3,"回执单");
public Integer id;
public String name;
}
......@@ -180,4 +180,11 @@ public class RepelQueryController {
public ResponseEntity provinceDirectlyUnderDevice(@RequestBody List<RepelFieldingVo> repelFieldingVoList){
return ResponseEntity.ok(repelQueryService.judgeFieldingIsNotNormal(repelFieldingVoList));
}
@GetMapping(value ="/repel/fileMap/{taskId}")
@ApiOperation(value = "根据任务ID查询业务相关单据", notes = "根据任务ID查询业务相关单据")
public ResponseEntity repelFileMap( @PathVariable Integer taskId){
return ResponseEntity.ok(repelQueryService.findByTaskIdToFileMapList(taskId));
}
}
package com.tykj.dev.device.sendback.service;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail;
import com.tykj.dev.device.sendback.entity.vo.RepelDetailSelectVo;
......@@ -7,6 +8,7 @@ import org.springframework.data.domain.Page;
import java.util.Date;
import java.util.List;
import java.util.Map;
public interface DeviceRepelDetailService {
/**
......@@ -43,4 +45,7 @@ public interface DeviceRepelDetailService {
Page<DeviceRepelDetail> findPageDeviceRepelDetail(RepelDetailSelectVo repelDetailSelectVo);
Map<String, List<FileRet>> findByIdToFileMapList(Integer id);
}
package com.tykj.dev.device.sendback.service;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepel;
import com.tykj.dev.device.sendback.entity.domain.DeviceRepelDetail;
......@@ -7,6 +8,7 @@ import com.tykj.dev.device.sendback.entity.vo.*;
import org.springframework.data.domain.Page;
import java.util.List;
import java.util.Map;
public interface RepelQueryService {
/**
......@@ -128,4 +130,9 @@ public interface RepelQueryService {
* 判断发起的列装是否需要提示
*/
RepelFieldingPrompt judgeFieldingIsNotNormal(List<RepelFieldingVo> repelFieldingVoList);
/**
* 根据taskId查询相关文件接口(设备日志使用)
*/
Map<String, List<FileRet>> findByTaskIdToFileMapList(Integer taskId);
}
......@@ -3,6 +3,8 @@ package com.tykj.dev.device.sendback.service.impl;
import com.fasterxml.jackson.core.type.TypeReference;
import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.config.base.FileName;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.file.service.FilesUtil;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
......@@ -117,6 +119,23 @@ public class DeviceRepelDetailServiceImpl implements DeviceRepelDetailService {
});
}
@Override
public Map<String, List<FileRet>> findByIdToFileMapList(Integer id) {
Map<String, List<FileRet>> map=new HashMap<>();
Optional<DeviceRepelDetail> optional = deviceRepelDetailDao.findById(id);
if (optional.isPresent()){
DeviceRepelDetail deviceRepelDetail=optional.get();
map.put(FileName.APPLY.name,FilesUtil.stringFileToList(deviceRepelDetail.getApplyFiles()));
map.put(FileName.RECEIPT.name,FilesUtil.stringFileToList(deviceRepelDetail.getApplyFiles()));
map.put(FileName.SIGN.name,FilesUtil.stringFileToList(deviceRepelDetail.getBillFile()));
map.put(FileName.REPLY.name,FilesUtil.stringFileToList(deviceRepelDetail.getReplyFiles()));
return map;
}else {
log.info("[清退] 详情查看错误,id没有找到{}",id);
throw new ApiException(ResponseEntity.status(500).body("清退详情id没有找到:"+id));
}
}
private Specification<DeviceRepelDetail> getFindRetiredSpecification(RepelDetailSelectVo repelDetailSelectVo) {
PredicateBuilder<DeviceRepelDetail> predicateBuilder = Specifications.and();
......
......@@ -4,6 +4,7 @@ import com.fasterxml.jackson.core.type.TypeReference;
import com.github.wenhao.jpa.PredicateBuilder;
import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.config.base.DeviceLifeStatus;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.library.repository.DeviceLibraryDao;
import com.tykj.dev.device.library.subject.domin.DeviceLibrary;
import com.tykj.dev.device.library.subject.vo.ScriptSaveVo;
......@@ -66,7 +67,7 @@ public class RepelQueryServiceImpl implements RepelQueryService {
@Override
public DeviceRepelDetail findDeviceRepelDetail(Integer taskId) {
TaskBto taskBto= taskService.get(taskId);
TaskBto taskBto= taskService.get(taskId);
DeviceRepelDetail deviceRepelDetail= repelDetailService.findDeviceRepelDetail(taskBto.getBillId());
if (deviceRepelDetail.getScriptJson()!=null) {
deviceRepelDetail.setScripts(JacksonUtil.readValue(deviceRepelDetail.getScriptJson(), new TypeReference<List<ScriptSaveVo>>() {
......@@ -616,6 +617,13 @@ public class RepelQueryServiceImpl implements RepelQueryService {
return repelFieldingPrompt;
}
@Override
public Map<String, List<FileRet>> findByTaskIdToFileMapList(Integer taskId) {
Map<String, List<FileRet>> map =new HashMap<>();
TaskBto taskBto= taskService.get(taskId);
return repelDetailService.findByIdToFileMapList(taskBto.getBillId());
}
private Specification<DeviceLibrary> getRepelDeviceSpecificationIn(RepelManagementVo repelManagementVo) {
PredicateBuilder<DeviceLibrary> predicateBuilder = getPredicateBuilder(repelManagementVo);
//unitId为空,默认查询当前单位
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论