提交 4bc7780c authored 作者: zhoushaopan's avatar zhoushaopan

feat(自查模块): 新增根据任务id查看单据图片

新增根据任务id查看单据图片
上级 dd798345
......@@ -34,7 +34,12 @@ public enum FileName {
/**
* 丢失单
*/
LOSS(7,"丢失单");
LOSS(7,"丢失单"),
/**
* 丢失单
*/
SelfCheck(8,"自查单");
public Integer id;
......
......@@ -136,7 +136,6 @@ public class SelfCheckController {
public ResponseEntity setCycle(@PathVariable("type") int type){
if (selfCheckSchedulerTask!=null) {
String corn = "0 0 0 1 1/"+type+" ? ";
// String corn = "10-20 * * * * ?";
ScheduledFuture scheduledFuture = selfCheckSchedulerTask.getScheduledFuture();
scheduledFuture.cancel(true);
selfCheckSchedulerTask.setCron(corn);
......@@ -519,7 +518,9 @@ public class SelfCheckController {
String user3 = userPublicService.getOne(s.getCreateUserId()).getName();
s.setCreateUser(user3);
}
s.setTaskId(taskService.get(s.getId(),4).getId());
if (s.getId()!=null){
s.setTaskId(taskService.get(s.getId(),4).getId());
}
}
return ResultUtil.success(page);
}
......@@ -733,6 +734,13 @@ public class SelfCheckController {
}
/**
* 查看维修退回单据
*/
@GetMapping("getSelfCheckFileList")
@ApiOperation("通过任务id查询自查中文件")
public ResponseEntity getBackFileList(Integer taskId){
return ResponseEntity.ok(selfCheckBillService.getFileList(taskId));
}
}
package com.tykj.dev.device.selfcheck.service;
import com.tykj.dev.device.file.entity.FileRet;
import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill;
import com.tykj.dev.device.selfcheck.subject.vo.SelfCheckSelectVo;
import org.springframework.data.domain.Page;
......@@ -8,6 +9,7 @@ import org.springframework.data.domain.Pageable;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
* @author dengdiyi
......@@ -35,4 +37,11 @@ public interface SelfCheckBillService {
List<SelfCheckBill> findByDate(Date date,String unitName);
List<SelfCheckBill> findBySystem(String unitName);
/**
* 根据taskId查询单据
* @param taskId
* @return
*/
Map<String,List<FileRet>> getFileList(Integer taskId);
}
......@@ -5,10 +5,14 @@ import com.github.wenhao.jpa.Specifications;
import com.tykj.dev.blockcha.subject.entity.BcHash;
import com.tykj.dev.blockcha.subject.service.BlockChainUtil;
import com.tykj.dev.config.TaskBeanConfig;
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.selfcheck.repository.SelfCheckBillDao;
import com.tykj.dev.device.selfcheck.service.SelfCheckBillService;
import com.tykj.dev.device.selfcheck.subject.domin.SelfCheckBill;
import com.tykj.dev.device.selfcheck.subject.vo.SelfCheckSelectVo;
import com.tykj.dev.device.task.service.TaskService;
import com.tykj.dev.device.user.util.UserUtils;
import com.tykj.dev.misc.exception.ApiException;
import com.tykj.dev.misc.utils.JacksonUtil;
......@@ -22,9 +26,7 @@ import org.springframework.stereotype.Service;
import javax.persistence.Transient;
import java.lang.reflect.Field;
import java.util.Date;
import java.util.List;
import java.util.Optional;
import java.util.*;
import java.util.concurrent.CompletableFuture;
/**
......@@ -42,6 +44,9 @@ public class SelfCheckBillServiceImpl implements SelfCheckBillService {
@Autowired
private BlockChainUtil blockChainUtil;
@Autowired
private TaskService taskService;
@Override
public SelfCheckBill addEntity(SelfCheckBill selfExaminationBillEntity) {
SelfCheckBill selfCheckBill = selfExaminationBillDao.save(selfExaminationBillEntity);
......@@ -158,4 +163,14 @@ public class SelfCheckBillServiceImpl implements SelfCheckBillService {
}
return predicateBuilder.build();
}
@Override
public Map<String, List<FileRet>> getFileList(Integer taskId) {
Map<String, List<FileRet>> map = new HashMap<>();
Integer billId = taskService.get(taskId).getBillId();
SelfCheckBill selfCheckBill = getOne(billId);
//自查单集合
map.put(FileName.SelfCheck.name, FilesUtil.stringFileToList(selfCheckBill.getCheckFiles()));
return map;
}
}
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论