wangjun 4 سال پیش
والد
کامیت
b4e7d84cc5

+ 63 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PayInfoNoticeService.java

@ -1,14 +1,22 @@
package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import jxl.write.*;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Date;
import java.util.Map;
@Service
public class PayInfoNoticeService {
    @Value("${hospital.url}")
@ -76,6 +84,61 @@ public class PayInfoNoticeService {
        return respCode;
    }
    //导出es查询数据
    public void exportEsPrescription(OutputStream os, com.alibaba.fastjson.JSONObject jsonObject) throws Exception{
        WritableWorkbook wwb = jxl.Workbook.createWorkbook(os);
        //接诊 +开方+物流
        com.alibaba.fastjson.JSONArray totallist = new JSONArray();
        if (null!=jsonObject){
            totallist = jsonObject.getJSONArray("outpatient");
        }
        try {
            WritableSheet ws;
            ws = wwb.createSheet("sheet", 1);
            String[] header = {"医生姓名", "出诊科室", "接诊数量", "开方数量", "物流数量"};
            int k = 0;
            for (String h : header) {
                addCell(ws, 0, k, h);//表名,行,列,header
                k++;
            }
            int i = 1;
            if (null!=totallist&&totallist.size()>0){
                for (int n=0;n<totallist.size();n++) {
                    JSONObject object = totallist.getJSONObject(i);
                    addCell(ws, i, 0, object.get("doctorName").toString(), "");
                    addCell(ws, i, 1, null==object.get("dept")?"":object.get("dept").toString(),"");
                    addCell(ws, i, 1, null==object.get("out")?"":object.get("out").toString(),"");
                    addCell(ws, i, 1, null==object.get("pre")?"":object.get("pre").toString(),"");
                    addCell(ws, i, 1, null==object.get("sf")?"":object.get("sf").toString(),"");
                    i++;
                }
            }
            wwb.write();
            wwb.close();
        } catch (IOException e) {
            e.printStackTrace();
            if (wwb != null) wwb.close();
            throw e;
        }
    }
    //添加单元格内容
    public void addCell(WritableSheet ws, int row, int column, String data) throws WriteException {
        Label label = new Label(column, row, data);
        ws.addCell(label);
    }
    //添加单元格内容
    public void addCell(WritableSheet ws, int row, int column, String data, String memo) throws WriteException {
        Label label = new Label(column, row, data);
        if (!org.springframework.util.StringUtils.isEmpty(memo)) {
            WritableCellFeatures cellFeatures = new WritableCellFeatures();
            cellFeatures.setComment(memo);
            label.setCellFeatures(cellFeatures);
        }
        ws.addCell(label);
    }
}

+ 2 - 2
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/AutoTimeOutRemind.java

@ -32,7 +32,7 @@ import java.util.List;
public class AutoTimeOutRemind implements SchedulingConfigurer {
    private static final Logger logger = LoggerFactory.getLogger(AutoTimeOutRemind.class);
    private static String cron = "0 0/5 * * * ?";
    private static String cron = "0 0/30 * * * ?";
    private static String dictName = "remind_patient_job";
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
@ -45,7 +45,7 @@ public class AutoTimeOutRemind implements SchedulingConfigurer {
    @Value("${wechat.ids}")
    private String wxId;
    public AutoTimeOutRemind() {
      cron = "0 0/5 * * * ?";
      cron = "0 0/30 * * * ?";
        System.out.println("创建时的corn"+cron);
    }
    public String change(String corIn){

+ 2 - 2
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/util/OverdueJob.java

@ -27,9 +27,9 @@ import java.util.List;
@EnableScheduling
public class OverdueJob implements SchedulingConfigurer {
    private static final Logger logger = LoggerFactory.getLogger(OverdueJob.class);
    private static String cron = "0 0 1 * * ?";
    private static String cron = "0 0 0 * * ?";
    public OverdueJob(){
        cron="0 0 1 * * ?";
        cron="0 0 0 * * ?";
        System.out.println("初始化时的corn"+cron);
    }
    @Autowired

+ 29 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/BaseDoctorBGController.java

@ -1,10 +1,14 @@
package com.yihu.jw.hospital.endpoint.hospital;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.doctor.BaseDoctorBackgroundDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorMessageDO;
import com.yihu.jw.es.service.StatisticsEsService;
import com.yihu.jw.hospital.doctor.dao.service.BaseDoctorBGService;
import com.yihu.jw.hospital.prescription.service.PayInfoNoticeService;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
import com.yihu.jw.rm.hospital.BaseHospitalRequestMapping;
import io.swagger.annotations.Api;
@ -13,6 +17,8 @@ import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletResponse;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;
@ -22,6 +28,10 @@ import java.util.Map;
public class BaseDoctorBGController extends EnvelopRestEndpoint {
    @Autowired
    private BaseDoctorBGService baseDoctorBGService;
    @Autowired
    private PayInfoNoticeService payInfoNoticeService;
    @Autowired
    private StatisticsEsService statisticsEsService;
    @ApiOperation("获取背景板")
    @PostMapping(value= BaseHospitalRequestMapping.BaseBackground.getAllBackground)
    public Envelop getAllBG( @ApiParam(name = "page", value = "第几页,从1开始", required = true, defaultValue = "1")
@ -133,4 +143,23 @@ public class BaseDoctorBGController extends EnvelopRestEndpoint {
                                  @RequestParam(value = "id", required = true)String id) throws Exception{
        return success(baseDoctorBGService.delDoctorMessage(id));
    }
    @GetMapping(value = BaseHospitalRequestMapping.Prescription.pushListWrite)
    @ApiOperation(value = "订单导出", notes = "订单导出")
    public void pushListWrite(@ApiParam(name = "status", value = "流程状态,多状态用‘,’分割")
                              @RequestParam(value = "status", required = false)String status,
                              @ApiParam(name = "oneselfPickupFlg", value = "是否自取 1是 0否")
                              @RequestParam(value = "oneselfPickupFlg", required = false)String oneselfPickupFlg,
                              @ApiParam(name = "nameKey", value = "配送员名称")
                              @RequestParam(value = "nameKey", required = false)String nameKey,
                              @ApiParam(name = "startTime", value = "开始时间,yyyy-MM-dd")
                              @RequestParam(value = "startTime", required = false)String startTime,
                              @ApiParam(name = "endTime", value = "结束时间,yyyy-MM-dd")
                              @RequestParam(value = "endTime", required = false)String endTime,
                              HttpServletResponse response) throws Exception{
        JSONObject jsonObject = new JSONObject();
        response.setContentType("octets/stream");
        response.setHeader("Content-Disposition", "attachment; filename="+ new String( "pushDataList.xls"));
        OutputStream os = response.getOutputStream();
        payInfoNoticeService.exportEsPrescription(os,jsonObject);
    }
}