Shi Kejing 4 years ago
parent
commit
7164fbf8e0

+ 1 - 1
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/controller/doctor/DoorOrderController.java

@ -1291,7 +1291,7 @@ public class DoorOrderController extends BaseController {
                for (int i=0;i<list.size();i++){
                    list1.add(list.get(i).get("orderId").toString());
                }
                File file = doorOrderService.writeWordFile(list1,response);
                File file = doorOrderService.writeWordFile(list1,response,doctorCode);
                if (file != null) {
                    response.setCharacterEncoding("utf-8");
                    response.setContentType("multipart/form-data");

+ 3 - 13
svr/svr-door-serivce/src/main/java/com/yihu/jw/door/service/DoorOrderService.java

@ -1456,9 +1456,7 @@ public class DoorOrderService {
     */
    public String handleData(Document doc, String orderId) {
        WlyyDoorServiceOrderDO orderDO = doorServiceOrderDao.findOne(orderId);
        System.out.println("orderDO  value -------------------");
        WlyyDoorConclusionDO conclusionDO = doorConclusionDao.findByOrderId(orderId);//808080f66e5efb24016e62838d77000a
        System.out.println("conclusionDO  value -------------------");
        String html = doc.toString();
        //对各个字段赋值
        html = html.replace("${name}", orderDO.getPatientName());
@ -1485,8 +1483,6 @@ public class DoorOrderService {
        html = html.replace("${examresult}",conclusionDO.getExamResult() == null ? "" : conclusionDO.getExamResult());
        String imgsString = "";
        System.out.println("赋值完成  value -------------------");
        if(StringUtils.isNotBlank(conclusionDO.getImgs())) {
            String imgs = conclusionDO.getImgs();
            String[] imgsArray;
@ -1588,10 +1584,10 @@ public class DoorOrderService {
    }
    public File writeWordFile(List<String> orderId,HttpServletResponse response) throws Exception {
    public File writeWordFile(List<String> orderId,HttpServletResponse response,String doctorCode) throws Exception {
        String zipFileName = "service_summary";
        String exportConclusionList = "exportList";
        String path = System.getProperty("user.dir") +"/" + exportConclusionList;
        String exportConclusionList = doctorCode+"exportList";
        String path = System.getProperty("user.dir") +"/service_summary/" + exportConclusionList;
        System.out.println("path    :"   +path);
@ -1628,23 +1624,17 @@ public class DoorOrderService {
            String html = this.handleData(doc, orderId.get(i));//16
            System.out.println("bw  value -------------------:"+path+"/"+fileName);
            BufferedWriter bw = new BufferedWriter(new FileWriter(path+"/"+fileName));//创建的文件
            System.out.println("创建的文件-----------success");
            bw.write(html);
            bw.close();
            File zipFile = new File(path.replace(exportConclusionList, "") + zipFileName + ".zip");
            if (zipFile.exists()) {
                zipFile.delete();
            }
            System.out.println("-----------------  第"+j+"个服务小结  -------------------");
        }
        // 打包文件夹
        if (fileToZip(path, path.replace(exportConclusionList, ""), zipFileName)) {
            System.out.println("=============   開始打包   =============");
            return new File(path.replace(exportConclusionList, "") + zipFileName + ".zip");
        } else {
            return null;