|
|
@@ -1,12 +1,15 @@
|
|
|
package thyyxxk.webserver.controller.examinations;
|
|
|
|
|
|
+import cn.hutool.core.util.IdUtil;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
+import thyyxxk.webserver.config.envionment.ArchiveConfig;
|
|
|
import thyyxxk.webserver.dao.his.examinations.InspectionsDao;
|
|
|
import thyyxxk.webserver.entity.ResultVo;
|
|
|
+import thyyxxk.webserver.entity.login.UserInfo;
|
|
|
import thyyxxk.webserver.entity.yiji.IndexInquiry;
|
|
|
import thyyxxk.webserver.entity.yiji.YjReqIndex;
|
|
|
import thyyxxk.webserver.service.hutoolcache.UserCache;
|
|
|
@@ -24,13 +27,15 @@ public class YjReqController {
|
|
|
private final ZyYjReqService zyYjReqService;
|
|
|
private final InspectionsDao dao;
|
|
|
private final UserCache userCache;
|
|
|
+ private final ArchiveConfig archiveConfig;
|
|
|
|
|
|
@Autowired
|
|
|
- public YjReqController(MzYjReqService mzYjReqService, ZyYjReqService zyYjReqService, InspectionsDao dao, UserCache userCache) {
|
|
|
+ public YjReqController(MzYjReqService mzYjReqService, ZyYjReqService zyYjReqService, InspectionsDao dao, UserCache userCache, ArchiveConfig archiveConfig) {
|
|
|
this.mzYjReqService = mzYjReqService;
|
|
|
this.zyYjReqService = zyYjReqService;
|
|
|
this.dao = dao;
|
|
|
this.userCache = userCache;
|
|
|
+ this.archiveConfig = archiveConfig;
|
|
|
}
|
|
|
|
|
|
@PostMapping("/queryYjReqIndex")
|
|
|
@@ -43,8 +48,16 @@ public class YjReqController {
|
|
|
|
|
|
@PostMapping("/uploadYjPdf")
|
|
|
public ResultVo<String> uploadYjPdf(YjReqIndex index) {
|
|
|
+ UserInfo user = userCache.getUserInfoByToken();
|
|
|
index.setUid(index.getPatNo() + "_" + index.getReqNo());
|
|
|
- index.setStaffDept(userCache.getUserInfoByToken().getDeptCode());
|
|
|
+ index.setStaffId(user.getCode());
|
|
|
+ index.setStaffDept(user.getDeptCode());
|
|
|
+ String archiveDir = archiveConfig.getPath();
|
|
|
+ String suffixDir = "/archive/emr/" + index.getPatNo() + "/"
|
|
|
+ + index.getTimes() + "/jianCha/" + index.getUid() + ".pdf";
|
|
|
+ index.setArchiveDir(archiveDir + suffixDir);
|
|
|
+ index.setSuffixDir(suffixDir);
|
|
|
+ index.setArchiveId(IdUtil.simpleUUID());
|
|
|
if (null == index.getReqDoctor()) {
|
|
|
index.setReqDoctor("");
|
|
|
}
|