Forráskód Böngészése

Merge branch 'dev' of http://192.168.1.220:10080/Amoy2/wlyy2.0 into dev

LAPTOP-KB9HII50\70708 1 éve
szülő
commit
f8e0d74498

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

@ -1278,7 +1278,6 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
            if (ylzMedicalRelationDO==null){
                return "已结算";
            }
            BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(ylzMedicalRelationDO.getId());
            boolean flag = true;
            if (ylzMedicalRelationDO.getMedicalState()==null||(ylzMedicalRelationDO.getMedicalState()!=null&&ylzMedicalRelationDO.getMedicalState()==0)){
                flag=true;
@ -1500,7 +1499,7 @@ public class YkyyPrescriptionService extends BaseJpaService<WlyyPrescriptionDO,
     * @throws Exception
     */
    public void getHisDzfpInfo() throws Exception {
        if (!demoFlag){
        if (demoFlag){
            salertaxnum = "110000999999003";
            dzfpAppKey="23760028";
            dzfpAppSecret="45591CA66F8D4589";

+ 16 - 17
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/module/door/service/DoorOrderService.java

@ -12,7 +12,6 @@ import com.yihu.jw.entity.base.system.SystemDictDO;
import com.yihu.jw.entity.base.wx.WxTemplateConfigDO;
import com.yihu.jw.entity.door.*;
import com.yihu.jw.entity.hospital.message.SystemMessageDO;
import com.yihu.jw.entity.wechat.WechatTemplateConfig;
import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.hospital.module.door.dao.*;
import com.yihu.jw.hospital.task.PushMsgTask;
@ -410,7 +409,7 @@ public class DoorOrderService {
        Integer times = wlyyDoorServiceOrderService.countPatientDoorTimes(doorServiceOrder.getPatient());
        //先注释-服务费用20231011
//        List<WlyyDoorDoctorDO> djDetailList = this.djDetailList(id, level, times);
//        doorServiceOrder.setDjDetailList(djDetailList);
//       doorServiceOrder.setDjDetailList(djDetailList);//出诊费
        List<Map<String, Object>> feeDetailDOS = this.getDoorFeeDetailGroupByStatus(id);
        String jsonData = this.serverPackagePriceByOrderId(id);
        if (null != feeDetailDOS && feeDetailDOS.size() > 0) {
@ -434,7 +433,6 @@ public class DoorOrderService {
            doorServiceOrder.setDoctors(doorServiceDoctors);
        }
        //获取咨询
        ConsultDo consult = consultDao.queryByRelationCode(id);
        if (null != consult) {
@ -907,23 +905,24 @@ public class DoorOrderService {
    public JSONObject getDoorOrderList(String orderId, String patientName, String patientPhone, String hospitalCode,
                                       StringBuffer status, String createTimeStart, String createTimeEnd, String serverDoctorName,
                                       String doctorCode, Integer examPaperStatus, Integer page, Integer pageSize, Integer type, String name, String serverType) throws Exception {
        StringBuilder sqlList = new StringBuilder("select DISTINCT o.id as orderId,o.status,f.hospital,f.hospital_name as hospitalName1,o.is_trans_other_org,o.transed_org_code,h.name as hospitalName2,o.patient_name," +
                " o.patient_phone,o.remark,o.serve_desc,dc.service_time,o.patient as patientCode ,o.exam_paper_status as examPaperStatus,o.number as serverCode,o.total_fee,h.hos_level as hosLevel, " +
                "o.doctor, o.doctor_name as doctorName, o.doctor_type as doctorType ,(SELECT group_concat(DISTINCT dsv.type_value) FROM wlyy_door_service_voucher dsv WHERE dsv.patient_code = o.patient and dsv.status=1 ) AS serviceStatus ");
        StringBuilder sqlList = new StringBuilder(
                "select DISTINCT o.id as orderId,o.status,h.org_name AS hospitalName,  h.org_code AS hospital," +
                        "o.is_trans_other_org,o.transed_org_code ,o.patient_name," +
                        " o.patient_phone,o.remark,o.serve_desc,dc.service_time,o.patient as patientCode ," +
                        "o.exam_paper_status as examPaperStatus,o.number as serverCode,o.total_fee, " +
                        " o.doctor, o.doctor_name as doctorName, o.doctor_type as doctorType ," +
                        "(SELECT group_concat(DISTINCT dsv.type_value) " +
                        " FROM wlyy_door_service_voucher dsv WHERE dsv.patient_code = o.patient and dsv.status=1 ) AS serviceStatus ");
        StringBuilder sqlCount = new StringBuilder(" select count(DISTINCT o.id) as total ");
        StringBuilder sql = new StringBuilder(" from wlyy_door_service_order o " +
                " LEFT JOIN wlyy_sign_family f ON f.patient = o.patient AND f.STATUS = 1 AND f.expenses_status = 1 " +
                " LEFT JOIN dm_hospital h on h.code=o.hospital and h.del=1 "
                " LEFT JOIN base_doctor_hospital h ON o.hospital=h.org_code "
                + " LEFT JOIN wlyy_door_doctor d on d.order_id = o.id " +
                " LEFT JOIN wlyy_patient p on p.code = o.patient " +
                " LEFT JOIN base_patient p on p.id = o.patient " +
                " LEFT JOIN wlyy_door_conclusion dc ON dc.order_id = o.id ");
        if (StringUtils.isNotBlank(serverType)) {
            sql.append(" INNER JOIN wlyy_door_service_voucher dsv on dsv.patient_code = o.patient and dsv.type='" + serverType + "' and dsv.status=1 ");
        }
//        if(!StringUtils.isEmpty(serverDoctorName)){
//            sql+=" RIGHT JOIN wlyy_door_doctor d on d.order_id = o.id";
//        }
        sql.append(" where 1=1 ");
        if (!StringUtils.isEmpty(orderId)) {
            sql.append(" and o.number = '" + orderId + "'");
@ -943,9 +942,7 @@ public class DoorOrderService {
        if (status != null) {
            sql.append(" and o.status in (" + status + ")");
        }
        /*else {
            sql += " and o.status != '-1' ";
        }*/
        if (!StringUtils.isEmpty(createTimeStart)) {
            sql.append(" and dc.service_time >='" + createTimeStart + "'");
        }
@ -964,8 +961,10 @@ public class DoorOrderService {
        if (examPaperStatus != null) {
            sql.append(" and o.conclusion_status='" + examPaperStatus + "' ");
        }
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sqlCount.append(sql).toString());
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sqlList.append(sql).append(" order by o.create_time desc LIMIT " + (page - 1) * pageSize + "," + pageSize).toString());
        String sql01 = sqlList.append(sql).append(" order by o.create_time desc LIMIT " + (page - 1) * pageSize + "," + pageSize).toString();
        String sql02 = sqlCount.append(sql).toString();
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql01);
        List<Map<String, Object>> rstotal = jdbcTemplate.queryForList(sql02);
        Long count = 0L;
        if (rstotal != null && rstotal.size() > 0) {
            count = (Long) rstotal.get(0).get("total");

+ 39 - 151
svr/svr-visit-behind/src/main/java/com/yihu/jw/hospital/utils/CommonUtil.java

@ -44,13 +44,8 @@ public class CommonUtil {
    private Logger logger = LoggerFactory.getLogger(CommonUtil.class);
//    @Value("${neiwang.enable}")
    private Boolean isneiwang = false;  //如果不是内网项目要转到到内网wlyy在上传
//    @Value("${fastDFS.fastdfs_file_url}")
    private String fastdfs_file_url;
//    @Value("${neiwang.wlyy}")
    private String neiwangWlyy;  //内网的项目地址
    private String fastdfs_file_url;
    @Autowired
    private HttpClientUtil httpClientUtil;
@ -144,88 +139,26 @@ public class CommonUtil {
    }
    public String copyTempVoice(String voices) throws Exception {
        if (isneiwang) {
            // 文件保存的临时路径
            String serverUrl = fastdfs_file_url;
            FastDFSUtil fastDFSUtil = new FastDFSUtil();
            String fileUrls = "";
            File f = new File(voices);
            if (f.exists()) {
                String fileName = f.getName();
                InputStream in = new FileInputStream(f);
                ObjectNode result = fastDFSUtil.upload(in, fileName.substring(fileName.lastIndexOf(".") + 1), "");
                in.close();
                if (result != null) {
                    fileUrls += (StringUtils.isEmpty(fileUrls) ? "" : ",") + serverUrl
                            + result.get("groupName").toString().replaceAll("\"", "") + "/"
                            + result.get("remoteFileName").toString().replaceAll("\"", "");
                    f.delete();
                }
            }
            return fileUrls;
        } else {
            String fileUrls = toNeiWang(voices, "");
            return fileUrls;
        }
    }
    /**
     * 如果是外网那是发送到内网的服务器
     *
     * @param files
     * @return
     */
    public String toNeiWang(String files, String tempPath) throws FileNotFoundException {
        logger.info(" toNeiWang start files :" + tempPath + files);
        //转发到内网服务器
        String[] fileArray = files.split(",");
        // 文件保存的临时路径
        String serverUrl = fastdfs_file_url;
        FastDFSUtil fastDFSUtil = new FastDFSUtil();
        String fileUrls = "";
        for (String file : fileArray) {
            HttpServletRequest request = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getRequest();
            HttpServletResponse response = ((ServletRequestAttributes) RequestContextHolder.getRequestAttributes()).getResponse();
            File f = new File(tempPath + file);
            logger.info(" toNeiWang File exists :" + f.exists());
            if (f.exists()) {
                String fileName = f.getName();
                InputStream in = new FileInputStream(f);
                String returnStr = request(request, in, fileName);
                logger.info("returnStr :" + returnStr);
                logger.info("fileName :" + fileName);
                logger.info("result :" + returnStr.toString());
                if (returnStr != null) {
                    //1.3.7去掉前缀
                    fileUrls += returnStr+",";
                    f.delete();
                }
            } else {
                String path = tempPath + file;
                String returnStr = request(request, path);
                logger.info("result :" + returnStr.toString());
                if (returnStr != null) {
                    //1.3.7去掉前缀
                    fileUrls += returnStr+",";
                }
        File f = new File(voices);
        if (f.exists()) {
            String fileName = f.getName();
            InputStream in = new FileInputStream(f);
            ObjectNode result = fastDFSUtil.upload(in, fileName.substring(fileName.lastIndexOf(".") + 1), "");
            in.close();
            if (result != null) {
                fileUrls += (StringUtils.isEmpty(fileUrls) ? "" : ",") + serverUrl
                        + result.get("groupName").toString().replaceAll("\"", "") + "/"
                        + result.get("remoteFileName").toString().replaceAll("\"", "");
                f.delete();
            }
        }
        logger.info(" toNeiWang end files :" + fileUrls);
        return fileUrls.substring(0,fileUrls.length()-1);
        return fileUrls;
    }
    private String request(HttpServletRequest request, String path) {
        String url = neiwangWlyy + "/wlyy/upload/commonUpload";//uri请求路径
        String result = "";
        try {
            List<NameValuePair> params = new ArrayList<>();
            params.add(new BasicNameValuePair("filePaths", path));
            // 将响应内容转换为字符串
            result = httpClientUtil.post(url, params, "UTF-8");
        }  catch (Exception e) {
            e.printStackTrace();
        }
        return result;
    }
    public String request(String remote_url, MultipartFile file, String type) {
        CloseableHttpClient httpClient = HttpClientBuilder.create().build();
@ -262,79 +195,34 @@ public class CommonUtil {
        return result;
    }
    public String request(HttpServletRequest request, InputStream in, String fileName) {
        String url = neiwangWlyy + "/wlyy/upload/commonUpload";//uri请求路径
        CloseableHttpClient httpClient = HttpClientBuilder.create().build();
        String result = "";
        try {
            HttpPost httpPost = new HttpPost(url);
            MultipartEntityBuilder builder = MultipartEntityBuilder.create();
            builder.addBinaryBody("file", in, ContentType.MULTIPART_FORM_DATA, fileName);// 文件流
            builder.addTextBody("filename", fileName);// 类似浏览器表单提交,对应input的name和value
            if (!org.springframework.util.StringUtils.isEmpty(request.getParameter("type")) ||
                    !org.springframework.util.StringUtils.isEmpty(request.getAttribute("type"))) {
                builder.addTextBody("type",  null != request.getParameter("type") ? request.getParameter("type") : String.valueOf(request.getAttribute("type"))); //发送类型
            }
            HttpEntity entity = builder.build();
            httpPost.setEntity(entity);
            HttpResponse response = httpClient.execute(httpPost);// 执行提交
            HttpEntity responseEntity = response.getEntity();
            if (responseEntity != null) {
                // 将响应内容转换为字符串
                result = EntityUtils.toString(responseEntity, Charset.forName("UTF-8"));
            }
        } catch (IOException e) {
            e.printStackTrace();
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            try {
                httpClient.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
            try {
                in.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return result;
    }
    public String copyTempImage(String files) throws Exception {
        String tempPath = SystemConfEntity.getInstance().getTempPath() + File.separator;
        if (isneiwang) {
            // 文件保存的临时路径
            String[] fileArray = files.split(",");
            FastDFSUtil fastDFSUtil = new FastDFSUtil();
            String fileUrls = "";
            for (String file : fileArray) {
                File f = new File(tempPath + file);
                File fs = new File(tempPath + file + "_small");
                if (f.exists()) {
                    String fileName = f.getName();
                    InputStream in = new FileInputStream(f);
                    ObjectNode result = fastDFSUtil.upload(in, fileName.substring(fileName.lastIndexOf(".") + 1), "");
                    in.close();
                    if (result != null) {
                        //1.3.7去掉前缀
                        fileUrls += (StringUtils.isEmpty(fileUrls) ? "" : ",")
                                + result.get("groupName").toString().replaceAll("\"", "") + "/"
                                + result.get("remoteFileName").toString().replaceAll("\"", "");
                        f.delete();
                        if (fs.exists()) {
                            fs.delete();
                        }
        // 文件保存的临时路径
        String[] fileArray = files.split(",");
        FastDFSUtil fastDFSUtil = new FastDFSUtil();
        String fileUrls = "";
        for (String file : fileArray) {
            File f = new File(tempPath + file);
            File fs = new File(tempPath + file + "_small");
            if (f.exists()) {
                String fileName = f.getName();
                InputStream in = new FileInputStream(f);
                ObjectNode result = fastDFSUtil.upload(in, fileName.substring(fileName.lastIndexOf(".") + 1), "");
                in.close();
                if (result != null) {
                    //1.3.7去掉前缀
                    fileUrls += (StringUtils.isEmpty(fileUrls) ? "" : ",")
                            + result.get("groupName").toString().replaceAll("\"", "") + "/"
                            + result.get("remoteFileName").toString().replaceAll("\"", "");
                    f.delete();
                    if (fs.exists()) {
                        fs.delete();
                    }
                }
            }
            return fileUrls;
        } else {
            String fileUrls = toNeiWang(files, tempPath);
            return fileUrls;
        }
        return fileUrls;
    }
}