Browse Source

[医保代码]

wangzhinan 3 years ago
parent
commit
f9996a96c5

+ 41 - 25
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java

@ -121,6 +121,7 @@ import com.ylzinfo.ehc.trans.TransResponse;
import com.zaxxer.hikari.HikariDataSource;
import com.zaxxer.hikari.HikariPoolMXBean;
import jxl.format.*;
import jxl.format.VerticalAlignment;
import jxl.write.*;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
@ -3885,6 +3886,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        Label label = new Label(column, row, data);
        WritableCellFormat cellFormat = new WritableCellFormat();
        cellFormat.setAlignment(jxl.format.Alignment.CENTRE);
        cellFormat.setVerticalAlignment(VerticalAlignment.CENTRE);
        label.setCellFormat(cellFormat);
        ws.addCell(label);
    }
@ -13792,8 +13794,9 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    price4=m.get("payPrice").toString();
                }
            }
            DecimalFormat df = new DecimalFormat("#.00");
            Double price5 =Double.parseDouble(price2)+Double.parseDouble(price3);
            String[] header2 = {"咨询费",price1,"复诊费",price5+"","处方费",price4};//
            String[] header2 = {"咨询费",df.format(Double.parseDouble(price1)),"复诊费",df.format(price5),"处方费",df.format(Double.parseDouble(price4))};//
            int k2 = 0;
            for (String h : header2) {
                addCell(ws, 2, k2, h);//表名,行,列,header
@ -13875,7 +13878,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                    price1=m.get("payPrice").toString();
                }
            }
            String[] header3 = {"","",price1,price1,""};//
            DecimalFormat df = new DecimalFormat("#.00");
            String[] header3 = {"无","无",df.format(Double.parseDouble(price1)),df.format(Double.parseDouble(price1)),"无"};//
            int k3 = 0;
            for (String h : header3) {
                addCell(ws, 3, k3, h);//表名,行,列,header
@ -13927,7 +13931,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    }
    /**
     * 资金分部报表
     * 资金分部报表导出
     * @param os
     * @param ls
     * @param startTime
@ -13989,7 +13993,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            Double price6 = Double.parseDouble(price1)+Double.parseDouble(price2)+Double.parseDouble(price3);//问诊费
            Double price7 = Double.parseDouble(price4);//处方费
            Double price8 = Double.parseDouble(price5);//就诊卡充值
            String[] header3 = {"",price6+price7+price8+"",price8+"",price7+"",price6+""};//
            DecimalFormat df = new DecimalFormat("#.00");
            String[] header3 = {"无",df.format(price6+price7+price8)+"",df.format(price8)+"",df.format(price7)+"",df.format(price6)+""};//
            int k3 = 0;
            for (String h : header3) {
                addCell(ws, 3, k3, h);//表名,行,列,header
@ -14069,11 +14074,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            int i = 3;
            String n = " ";
            DecimalFormat df = new DecimalFormat("#.00");
            for (Map<String, Object> m : ls) {
                addCell(ws, i, 0,m.get("doctorName")!=null?m.get("doctorName").toString():n);
                addCell(ws, i, 1, "");
                addCell(ws, i, 2, m.get("fee")!=null?m.get("fee").toString():n);
                addCell(ws, i, 1, "无");
                addCell(ws, i, 2, m.get("fee")!=null?df.format(Double.parseDouble(m.get("fee").toString())):n);
                i++;
            }
            ws.mergeCells(0,0,2,0);
@ -14138,7 +14143,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                addCell(ws, 1, k1, h);//表名,行,列,header
                k1++;
            }
            String[] header2 = {"患者名称","订单药品","规格","总量","进价","零售价","进货金额","零售金额","发药时间"};//
            String[] header2 = {"患者名称","订单药品","规格","总量","单位","进价","零售价","进货金额","零售金额","发药时间","审方时间","开方时间"};//
            int k2 = 0;
            for (String h : header2) {
                addCell(ws, 2, k2, h);//表名,行,列,header
@ -14151,30 +14156,41 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            for (Map<String, Object> m : ls) {
                com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(m.get("prescription").toString());
                com.alibaba.fastjson.JSONArray array = jsonObject.getJSONArray("info");
                int j = i;
                addCell(ws, i, 0,jsonObject.get("patientName")!=null?jsonObject.get("patientName").toString():n);
                for (int z=0;z<array.size();z++){
                    com.alibaba.fastjson.JSONObject object = array.getJSONObject(z);
                    addCell(ws, i, 1, object.get("drugName")!=null?object.get("drugName").toString():n);
                    addCell(ws, i, 2, object.get("specification")!=null?object.get("specification").toString():n);
                    addCell(ws, i, 3, object.get("quantity")!=null?object.get("quantity").toString():n);
                    addCell(ws, i, 4, "");
                    addCell(ws, i, 5, object.get("packRetprice")!=null?object.get("packRetprice").toString():n);
                    addCell(ws, i, 6, "");
                    if (object.get("quantity")!=null){
                        Double quantity = Double.parseDouble(object.get("quantity").toString());
                        Double packRetprice = Double.parseDouble(object.get("packRetprice").toString());
                        addCell(ws, i, 7,packRetprice*quantity+"");
                    }else {
                        addCell(ws, i, 7,"");
                DecimalFormat df = new DecimalFormat("#.00");
                if(array!=null&&array.size()!=0){
                    for (int z=0;z<array.size();z++){
                        com.alibaba.fastjson.JSONObject object = array.getJSONObject(z);
                        addCell(ws, i, 1, object.get("drugName")!=null?object.get("drugName").toString():n);
                        addCell(ws, i, 2, object.get("specification")!=null?object.get("specification").toString():n);
                        addCell(ws, i, 3, object.get("quantity")!=null?object.get("quantity").toString():n);
                        addCell(ws, i, 4, object.get("packUnitName")!=null?object.get("packUnitName").toString():n);
                        addCell(ws, i, 5, "无");
                        addCell(ws, i, 6, object.get("packRetprice")!=null?object.get("packRetprice").toString():n);
                        addCell(ws, i, 7, "无");
                        if (object.get("quantity")!=null){
                            Double quantity = Double.parseDouble(object.get("quantity").toString());
                            Double packRetprice = Double.parseDouble(object.get("packRetprice").toString());
                            addCell(ws, i, 8,df.format(packRetprice*quantity));
                        }else {
                            addCell(ws, i, 8,"");
                        }
                        addCell(ws, i, 9,jsonObject.get("dispDate")!=null?DateUtil.stampToString(jsonObject.get("dispDate").toString()):n);
                        addCell(ws, i, 10,jsonObject.get("checkTime")!=null?DateUtil.stampToString(jsonObject.get("checkTime").toString()):n);
                        addCell(ws, i, 11,jsonObject.get("createTime")!=null?DateUtil.stampToString(jsonObject.get("createTime").toString()):n);
                        i++;
                    }
                    addCell(ws, i, 8,jsonObject.get("createTime")!=null?DateUtil.stampToString(jsonObject.get("createTime").toString()):n);
                    ws.mergeCells(0,j,0,i-1);
                }else {
                    i++;
                }
            }
            ws.mergeCells(0,0,8,0);
            ws.mergeCells(0,1,8,1);
            ws.mergeCells(0,0,11,0);
            ws.mergeCells(0,1,11,1);
            wwb.write();
            wwb.close();
        } catch (IOException e) {

+ 3 - 3
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/YkyyPrescriptionService.java

@ -625,16 +625,16 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            JSONObject map = mapList.getJSONObject(i);
            JSONObject object = new JSONObject();
            object.put("charge_code",map.get("ypxh"));
            object.put("drugname",map.get("ypmc"));
            object.put("drugname",map.get("ypmc2"));
            object.put("specification",map.get("yfgg"));
            object.put("pack_unit",map.get("yfdw"));
            object.put("pack_unit_name",map.get("yfdw"));
            object.put("yfdw",map.get("yfdw"));
            if (map.get("yfsb")!=null){
                String yfsb = map.get("yfsb").toString();
                if (yfsb.equalsIgnoreCase("9")){
                if (yfsb.equalsIgnoreCase("3")){
                    object.put("yfsb",3);//药房识别 3思明6五缘
                }else if (yfsb.equalsIgnoreCase("10")){
                }else if (yfsb.equalsIgnoreCase("6")){
                    object.put("yfsb",6);//药房识别 3思明6五缘
                }
            }

+ 26 - 4
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/YkyyEntranceService.java

@ -582,6 +582,28 @@ public class YkyyEntranceService {
        return wlyyOutpatientVOS;
    }
    /**
     * 查找眼科his 已审核已付款的处方
     * @throws Exception
     */
    public JSONArray getHisPrescriptionInfo() throws Exception{
        String sql = "SELECT h.BRID,h.CFSB,to_char(h.FYRQ,'yyyy-mm-dd hh24:mi:ss' ) as \"fyrq\",to_char(h.SPRQ,'yyyy-mm-dd hh24:mi:ss' ) as \"sprq\" from v_ms_dd01 h WHERE h.SPZT = 1 and h.FKZT = 1 order by h.KFRQ desc ";
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        params.put("page","1");
        params.put("size","200");
        HttpResponse response = HttpUtils.doGet(jdbcUrl,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if(status!=null&&status == 200){
            return rs.getJSONArray("detailModelList");
        }
        return new JSONArray();
    }
    /**
     * 查找眼科his 已审核未付款的处方
     * @throws Exception
@ -1502,7 +1524,7 @@ public class YkyyEntranceService {
                "yp.gyffmc as \"gyffmc\"," +
                "yp.pzwh as \"pzwh\","+
                "yp.yfsb as \"yfsb\""+" FROM " +
                "V_hlwyy_MZ_YPXX yp where 1=1 and yp.yfsb in(9,10)  ";
                "V_hlwyy_MZ_YPXX yp where 1=1 and yp.yfsb in(3,6)  ";
        if (StringUtils.isNoneBlank(ypdm)){
            sql+=" and lower(yp.ypdm) like '%"+ypdm.toLowerCase()+"%' ";
        }
@ -1997,12 +2019,12 @@ public class YkyyEntranceService {
                WlyyPrescriptionExpressageDO expressageDO = expressageDOList.get(0);
                if (1==expressageDO.getOneselfPickupFlg()){
                    if (expressageDO.getHospitalCode().equalsIgnoreCase("3")){
                        drug="9";
                        drug="3";
                    }else if (expressageDO.getHospitalCode().equalsIgnoreCase("6")){
                        drug="10";
                        drug="6";
                    }
                }else {
                    drug = "10";
                    drug = "6";
                }
            }
            List<WlyyInspectionDO> inspectionDOS = wlyyInspectionDao.findByPrescriptionId(code,1);

+ 15 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/WlyyPrescriptionDO.java

@ -249,6 +249,12 @@ public class WlyyPrescriptionDO extends UuidIdentityEntity {
     */
    private String checkReason;
    /**
     * 审方时间
     */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
    private Date checkTime;
    /**
     * 处理状态 1处方修改2执行处方
     */
@ -280,6 +286,15 @@ public class WlyyPrescriptionDO extends UuidIdentityEntity {
    private Date disableTime;
    @Column(name = "check_time")
    public Date getCheckTime() {
        return checkTime;
    }
    public void setCheckTime(Date checkTime) {
        this.checkTime = checkTime;
    }
    @Column(name = "disable_time")
    public Date getDisableTime() {
        return disableTime;

+ 31 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/service/channel/UnSettledHISPrescriptionService.java

@ -314,6 +314,37 @@ public class UnSettledHISPrescriptionService {
                    }
                }
            }
            //获取审核成功支付成功发药时间、审核时间
            logger.info("同步开始");
            JSONArray hisArray = ykyyEntranceService.getHisPrescriptionInfo();
            //发送模板
            if(hisArray!=null&&hisArray.size()>0) {
                for (int i = 0; i<hisArray.size(); i++){
                    JSONObject json = hisArray.getJSONObject(i);
                    String brid = json.getString("BRID");
                    String cfsb = json.getString("CFSB");
                    String yfrq = json.getString("fyrq");
                    String sprq = json.getString("sprq");
                    //查找对应的处方
                    String sql = "SELECT w.OUTPATIENT_ID,w.ID,w.DOCTOR_NAME from WLYY_PRESCRIPTION w WHERE REAL_ORDER = '"+cfsb+"' and w.DISP_DATE is NULL  ORDER BY w.CREATE_TIME desc";
                    List<Map<String, Object>> pre = hibenateUtils.createSQLQuery(sql);
                    if(pre!=null && pre.size()>0){
                        String prescriptionId = pre.get(0).get("ID").toString();
                        WlyyPrescriptionDO wlyyPrescriptionDO = prescriptionDao.findOne(prescriptionId);
                        logger.info(sprq+yfrq);
                        if (StringUtils.isNoneBlank(sprq)){
                            logger.info("111111111111");
                            wlyyPrescriptionDO.setCheckTime(DateUtil.strToDateLong(sprq));
                        }
                        if (StringUtils.isNoneBlank(yfrq)){
                            logger.info("222222222222222");
                            wlyyPrescriptionDO.setDispDate(DateUtil.strToDateLong(yfrq));
                        }
                        prescriptionDao.save(wlyyPrescriptionDO);
                    }
                }
            }
        }
    }

+ 5 - 5
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -869,27 +869,27 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
            if (businessType.equalsIgnoreCase("2")){
                if (type.equalsIgnoreCase("1")){
                    response.setContentType("octets/stream");
                    response.setHeader("Content-Disposition", "attachment; filename=" + new String("pushDataListPriceTotal.xls"));
                    response.setHeader("Content-Disposition", "attachment; filename=" + new String(URLEncoder.encode("互联网医院收入日报表_"+startTime+"_"+endTime)+".xls"));
                    OutputStream os = response.getOutputStream();
                    prescriptionService.pushListWritePriceTotal(os, list,startTime,endTime);
                }else if (type.equalsIgnoreCase("2")){
                    response.setContentType("octets/stream");
                    response.setHeader("Content-Disposition", "attachment; filename=" + new String("pushListCardPriceTotal.xls"));
                    response.setHeader("Content-Disposition", "attachment; filename=" + new String(URLEncoder.encode("互联网医院预缴金日报表_"+startTime+"_"+endTime)+".xls"));
                    OutputStream os = response.getOutputStream();
                    prescriptionService.pushListCardPriceTotal(os, list,startTime,endTime);
                }else if (type.equalsIgnoreCase("3")){
                    response.setContentType("octets/stream");
                    response.setHeader("Content-Disposition", "attachment; filename=" + new String("pushListTotal.xls"));
                    response.setHeader("Content-Disposition", "attachment; filename=" + new String(URLEncoder.encode("互联网医院收款日报表_"+startTime+"_"+endTime)+".xls"));
                    OutputStream os = response.getOutputStream();
                    prescriptionService.pushListTotal(os, list,startTime,endTime);
                }else if (type.equalsIgnoreCase("4")){
                    response.setContentType("octets/stream");
                    response.setHeader("Content-Disposition", "attachment; filename=" + new String("pushListDoctorTotal.xls"));
                    response.setHeader("Content-Disposition", "attachment; filename=" + new String(URLEncoder.encode("互联网医院药品汇总表_"+startTime+"_"+endTime)+".xls"));
                    OutputStream os = response.getOutputStream();
                    prescriptionService.pushListDoctorTotal(os, list,startTime,endTime);
                }else if (type.equalsIgnoreCase("5")){
                    response.setContentType("octets/stream");
                    response.setHeader("Content-Disposition", "attachment; filename=" + new String("pushListDrugTotal.xls"));
                    response.setHeader("Content-Disposition", "attachment; filename=" + new String(URLEncoder.encode("互联网医院药品明细表_"+startTime+"_"+endTime)+".xls"));
                    OutputStream os = response.getOutputStream();
                    prescriptionService.pushListDrugTotal(os, list,startTime,endTime);
                }