Explorar el Código

Merge branch 'dev' of trick9191/wlyy2.0 into dev

trick9191 hace 5 años
padre
commit
2d0b126682

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

@ -577,6 +577,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        outpatientDO.setOutpatientType("1");
        outpatientDO.setCreateTime(new Date());
        if(outpatientDO.getRegisterDate()==null){
            outpatientDO.setRegisterDate(new Date());
        }
        WlyyOutpatientDO outpatient = outpatientDao.save(outpatientDO);
        WlyyPatientRegisterTimeDO registerTimeDO = null;
@ -3487,6 +3491,10 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        outpatientDO.setOutpatientType("2");
        outpatientDO.setCreateTime(new Date());
        if(outpatientDO.getRegisterDate()==null){
            outpatientDO.setRegisterDate(new Date());
        }
        WlyyOutpatientDO outpatient = outpatientDao.save(outpatientDO);
        WlyyPatientRegisterTimeDO registerTimeDO = null;

+ 11 - 0
business/base-service/src/main/java/com/yihu/jw/internet/dao/HospitalImgDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.internet.dao;
import com.yihu.jw.entity.hospital.jgpt.HospitalImgDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by Trick on 2019/11/28.
 */
public interface HospitalImgDao extends PagingAndSortingRepository<HospitalImgDO, String>, JpaSpecificationExecutor<HospitalImgDO> {
}

+ 40 - 30
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetService.java

@ -3,6 +3,7 @@ package com.yihu.jw.internet.service;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.internet.dao.HospitalImgDao;
import com.yihu.jw.internet.dao.IntUpErrorLogDao;
import com.yihu.jw.internet.dao.InternetUpLogDao;
import com.yihu.jw.internet.dao.MedicalSkillOrdersDao;
@ -12,6 +13,7 @@ import com.yihu.jw.internet.wsapi.Wsapi;
import com.yihu.jw.internet.wsapi.WsapiProxy;
import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.utils.ImageConvertUtil;
import com.yihu.jw.utils.JSONUtils;
import com.yihu.jw.utils.encode.AESUtils;
import com.yihu.mysql.query.BaseJpaService;
@ -38,13 +40,15 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
    @Autowired
    private MedicalSkillOrdersDao medicalSkillOrdersDao;
    @Autowired
    private HospitalImgDao hospitalImgDao;
    static String userName = "xmzsyy";
    static String psw = "7j7s9e";
    static String appId = "ws007";
    static String AesEncodeKey = "98sfkf53sf19609j";
    //static String urlString = "http://10.120.102.202:18081/micc/wsapi/1.0?wsdl";  // 正式线路径
    static String urlString = "http://fjhlw.bsoft.com.cn:18081/micc/wsapi/1.0?wsdl";   // 测试线路径
    static String urlString = "http://10.120.102.202:18081/micc/wsapi/1.0?wsdl";  // 正式线路径
    //static String urlString = "http://fjhlw.bsoft.com.cn:18081/micc/wsapi/1.0?wsdl";   // 测试线路径
    static String method = "execute";
    static String token = "";
    static String orgCode = "123502004266006872";
@ -68,6 +72,7 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
        String deResult = AESUtils.decrypt(result, AesEncodeKey);
        logger.info(JSONUtils.toString(deResult));
        return deResult;
    }
@ -90,7 +95,7 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
        if("200".equals(resJson.get("msg").toString())) {
            token = resJson.get("token").toString();
        }
        logger.info("upNsUserToken : "+token);
        return token;
    }
@ -114,11 +119,11 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
        jb.put("hospital_address", "厦门市思明区湖滨南路201-209号");
        jb.put("hospital_phone", "0592-2292201");
        jb.put("hospital_img","");
        jb.put("bus_lic", "");
        jb.put("corp_idcord_head","");
        jb.put("corp_idcord_tail", "");
        jb.put("pra_lic", "");
        jb.put("hospital_img",hospitalImgDao.findOne("hsimg").getImg());
        jb.put("bus_lic", hospitalImgDao.findOne("zyxkz").getImg());
        jb.put("corp_idcord_head",hospitalImgDao.findOne("idcardA").getImg());
        jb.put("corp_idcord_tail", hospitalImgDao.findOne("idcardB").getImg());
        jb.put("pra_lic", hospitalImgDao.findOne("zyxkz").getImg());
        jb.put("net_service", "1,3,4,5,7,9,10");
        jb.put("net_service_ot", "");
@ -258,11 +263,13 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
        //  因为要上传的是医师信息,所以针对到注册用户且无部门信息的用户数据不上传
        String sql = "select a.id,a.name,a.idcard,a.sex,a.birthday, a.cert_no, a.prac_no\n" +
                "      ,a.mobile,b.dept_code,b.dept_name,a.job_title_code\n" +
                "  from base_doctor a\n" +
                "      ,base_doctor_hospital b\n" +
                " where a.id = b.doctor_code\n"  +
                "   and b.dept_code != '' \n" +
                "      ,a.mobile,b.dept_code,b.dept_name,a.job_title_code,i.fzrq,i.zyz,i.zgz,i.cert_no,i.prac_no \n" +
                "  from base_doctor a " +
                "      ,base_doctor_hospital b" +
                "      ,base_doctor_img i " +
                " where a.id = b.doctor_code\n" +
                "   and i.doctor = a.id " +
                "   and b.dept_code != '' " +
                "   and a.job_title_code  not in('4107','054','1313','1413','1415','018','1412','4105','1212','1312','4103','1315','1217','1215','3301','005',\n" +
                "'1213','3501','017','020','058','002','1417','1214','1317','4101','4106') \n" ;
        if(StringUtils.isNotBlank(startDate)){
@ -301,7 +308,7 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
                jb.put("belong_dept",info.get("dept_code") == null ? dept[0].toString():info.get("dept_code"));
                jb.put("belong_dept_name", info.get("dept_name") == null ? dept[1].toString():info.get("dept_name"));
                jb.put("doo_tel", info.get("mobile")== null ? "":info.get("mobile"));
                jb.put("title_rec_date", "1900-01-01");
                jb.put("title_rec_date", info.get("fzrq"));
                jb.put("prac_type", "1");   // 因为上传的是医师的信息,所以该字段全部默认设置为 1 医师
                jb.put("title_code", dutyInfo[0].toString());  // 需要与监管平台的字典进行映射
                jb.put("first_compeny_code", orgCode);
@ -311,15 +318,17 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
                jb.put("net_service", "1,3,4,5,7,9,10");
                jb.put("cert_no",  info.get("cert_no")== null ? "0":info.get("cert_no"));
                jb.put("prac_no",  info.get("prac_no")== null ? "0":info.get("prac_no"));
                jb.put("doc_cert", "");
                jb.put("cert_doc_prac", "");
                //资质证书
                jb.put("doc_cert",info.get("zgz"));
                //执业证书
                jb.put("cert_doc_prac", info.get("zyz"));
                jb.put("txt_introduction", "");
            }catch (Exception e){
                errorFlag = true;
                saveErrorLog(upid,"3",info.get("id").toString(),"数据格式错误",1);
                error++;
                logger.error(e.toString());
//                logger.error(e.toString());
            }
            if(!errorFlag){
                //上传监管平台
@ -358,7 +367,7 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
        if("200".equals(msg)){
            JSONArray reqContent = rs.getJSONArray("reqContent");
            JSONObject req = (JSONObject)reqContent.get(0);
            return req.getString("id");
            return req.getString("miccId");
        }
        return "";
    }
@ -502,7 +511,7 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
                    jb.put("app_class_code", ins.get("code"));
                    jb.put("id_doctor", docInterId);
                    jb.put("fg_handle", "1");
                    jb.put("handle_time", DateUtil.dateToStr((Date)ins.get("create_time"),"YYYY-MM-DD HH:mm:SS"));
                    jb.put("handle_time", DateUtil.dateToStr((Date)ins.get("create_time"),"yyyy-MM-dd HH:mm:ss"));
                    jb.put("pt_name",ins.get("name").toString());
                    String sex = IdCardUtil.getSexForIdcard_new(ins.get("idcard").toString());
                    jb.put("ge_code", sex=="3"?"9":sex);
@ -591,14 +600,14 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
                    interId = achNsDoctorRecord(idCard);
                }
                String[] dept = depToSubject(info.get("dept_code").toString());
//                String[] dept = depToSubject(info.get("dept_code").toString());
                jb.put("id",orgCode + (String)info.get("id"));
                jb.put("id_doctor",interId == null ? "0":interId);
                jb.put("organ_code",orgCode);
                jb.put("organ_name", orgName);
                jb.put("net_service", dept[0].toString());
                jb.put("net_service_name",dept[1].toString());
                jb.put("net_service", "4");
                jb.put("net_service_name","在线复诊");
                jb.put("val_score",info.get("score") == null ? "0": info.get("score"));
                jb.put("grader",info.get("patient_name") == null ? "0": info.get("patient_name"));
                jb.put("dt_grade",DateUtil.dateToStrLong((Date)info.get("create_time")));
@ -778,6 +787,7 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
                String[] dept = depToSubject(info.get("dept").toString());
                // 获取监管平台唯一标识
                String visitDocCode = achNsDoctorRecord((String)info.get("docIdCard"));
//                String visitDocCode = achNsDoctorRecord("350102198005012428");
                jb.put("id_online_med", orgCode + info.get("register_no"));
                jb.put("net_service_code", "4");
@ -835,7 +845,6 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
                dataError++;
                logger.error(e.toString());
            }
            String jbstr = jb.toJSONString();
            if(!errorFlag){
                JSONArray jsonArray = new JSONArray();
                jsonArray.add(jb);
@ -871,11 +880,12 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
        String sql = "select a.id,a.real_order,a.patient_code,a.outpatient_id,a.patient_name\n" +
                "      ,b.sex,b.birthday,b.idcard,b.mobile,b.city_code,a.hospital\n" +
                "      ,a.hospital_name,a.dept,a.dept_name,a.doctor,a.doctor_name,a.his_register_fee,c.idcard as docIdcard\n" +
                "      ,a.hospital_name,p.dept,p.dept_name,a.doctor,a.doctor_name,a.his_register_fee,c.idcard as docIdcard\n" +
                "  from  wlyy_prescription a\n" +
                "         left JOIN base_patient b on a.patient_code = b.id\n" +
                "         left JOIN base_doctor c on a.doctor = c.id\n" +
                " where  c.idcard is not null  and a.real_order is not null ";
                "         JOIN base_patient b on a.patient_code = b.id\n" +
                "         JOIN base_doctor c on a.doctor = c.id\n" +
                "         JOIN wlyy_outpatient p on p.id = a.outpatient_id\n " +
                "  where  c.idcard is not null  and a.real_order is not null ";
        if(StringUtils.isNotBlank(startDate)){
            sql =  sql + "  and a.create_time >=  '" + startDate + "' ";
@ -895,9 +905,10 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
            LinkedCaseInsensitiveMap info = (LinkedCaseInsensitiveMap) list.get(i);
            JSONObject jb = new JSONObject();
            Boolean errorFlag = false;
            //基于科室转换成国家诊疗科目代码
            String[] dept = depToSubject(info.get("dept_code").toString());
            try {
                //基于科室转换成国家诊疗科目代码
                String[] dept = depToSubject(info.get("dept").toString());
                // 获取监管平台唯一标识
                String visitDocCode = achNsDoctorRecord(info.get("docIdcard").toString());
@ -1480,5 +1491,4 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
        }
        return  res;
    }
}

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 80 - 0
business/base-service/src/main/java/com/yihu/jw/internet/wsapi/UpNsDoctorRecord.java


+ 74 - 0
business/base-service/src/main/java/com/yihu/jw/utils/ImageConvertUtil.java

@ -0,0 +1,74 @@
package com.yihu.jw.utils;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import javax.imageio.ImageIO;
import java.awt.image.BufferedImage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
/**
 * @ClassName ImageConvertUtil
 * @Description TODO
 * @Author heqian
 * @Date 2019/5/16 17:05
 * @Version 1.0
 */
public class ImageConvertUtil {
    static BASE64Encoder encoder = new BASE64Encoder();
    static BASE64Decoder decoder = new BASE64Decoder();
    static String upload_home = System.getProperty("catalina.home")+"resources/repository/";
    public static void main(String[] args) {
        String str = getImageBinary("C://Users//Administrator//Desktop//医生信息//陈兰//资格证.jpg");
        System.out.println(str);
    }
    public static String getImageBinary(){
        File f = new File("d://123.jpg");
        BufferedImage bi;
        try {
            bi = ImageIO.read(f);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            ImageIO.write(bi, "jpg", baos);
            byte[] bytes = baos.toByteArray();
            return encoder.encodeBuffer(bytes).trim();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }
    public static String getImageBinary(String path){
        File f = new File(path);
        BufferedImage bi;
        try {
            bi = ImageIO.read(f);
            ByteArrayOutputStream baos = new ByteArrayOutputStream();
            ImageIO.write(bi, "jpg", baos);
            byte[] bytes = baos.toByteArray();
            return encoder.encodeBuffer(bytes).trim();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }
    public static void base64StringToImage(String base64String, String fileName){
        try {
            byte[] bytes1 = decoder.decodeBuffer(base64String);
            ByteArrayInputStream bais = new ByteArrayInputStream(bytes1);
            BufferedImage bi1 =ImageIO.read(bais);
            File w2 = new File(upload_home + fileName);//鍙互鏄痡pg,png,gif鏍煎紡
            ImageIO.write(bi1, "jpg", w2);//涓嶇杈撳嚭浠�涔堟牸寮忓浘鐗囷紝姝ゅ涓嶉渶鏀瑰姩
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}

+ 33 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/jgpt/HospitalImgDO.java

@ -0,0 +1,33 @@
package com.yihu.jw.entity.hospital.jgpt;
import com.yihu.jw.entity.UuidIdentityEntity;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by Trick on 2019/11/28.
 */
@Entity
@Table(name = "hospital_img")
public class HospitalImgDO extends UuidIdentityEntity {
    private String name;
    private String img;
    public String getName() {
        return name;
    }
    public void setName(String name) {
        this.name = name;
    }
    public String getImg() {
        return img;
    }
    public void setImg(String img) {
        this.img = img;
    }
}

+ 8 - 8
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/DataUploadJob.java

@ -39,14 +39,14 @@ public class DataUploadJob implements Job {
//            logger.info("START========2.6 网上医技预约上传开始========");
//            try {
//                res = internetService.upMedicalOnline(startDate,endDate,null);
//            }catch (Exception e){
//                e.printStackTrace();
//                logger.error(e.toString());
//            }
//            logger.info("END==========2.6 网上医技预约上传结束========" + res);
            logger.info("START========2.6 网上医技预约上传开始========");
            try {
                res = internetService.upMedicalOnline(startDate,endDate,null);
            }catch (Exception e){
                e.printStackTrace();
                logger.error(e.toString());
            }
            logger.info("END==========2.6 网上医技预约上传结束========" + res);

+ 1 - 1
svr/svr-internet-hospital-job/src/main/resources/bootstrap.yml

@ -1,6 +1,6 @@
spring:
  application:
    name: svr-internet-hospital-job-yx
    name: svr-internet-hospital-job
  cloud:
    config:
      failFast: true