hill9868 преди 5 години
родител
ревизия
48f654f50b

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

@ -0,0 +1,18 @@
package com.yihu.jw.internet.dao;
import com.yihu.jw.internet.entity.MedicalSkillOrdersDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by cws on 2019/9/10.
 */
public interface MedicalSkillOrdersDao extends PagingAndSortingRepository<MedicalSkillOrdersDO, String>, JpaSpecificationExecutor<MedicalSkillOrdersDO> {
    @Query("from MedicalSkillOrdersDO a where a.appTime >= ?1 and a.appTime < ?2")
    List<MedicalSkillOrdersDO> findMedicalSkillOrdersByAppTime(String startDate, String endDate);
}

+ 142 - 0
business/base-service/src/main/java/com/yihu/jw/internet/entity/MedicalSkillOrdersDO.java

@ -0,0 +1,142 @@
package com.yihu.jw.internet.entity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
import java.io.Serializable;
@Entity
@Table(name = "medical_skill_orders")
public class MedicalSkillOrdersDO  implements Serializable {
    @Column(name = "id")
    private String id;
    @Column(name = "cd_org")
    private String cdOrg;
    @Column(name = "app_time")
    private String appTime;
    @Column(name = "app_dep_code")
    private String appDepCode;
    @Column(name = "app_class_code")
    private String appClassCode;
    @Column(name = "id_doctor")
    private String idDoctor;
    @Column(name = "fg_handle")
    private String fgHandle;
    @Column(name = "handle_time")
    private String handleTime;
    @Column(name = "pt_name")
    private String ptName;
    @Column(name = "ge_code")
    private String geCode;
    @Column(name = "card_type")
    private String cardType;
    @Column(name = "id_no")
    private String idNo;
    @Column(name = "pt_tel")
    private String ptTel;
    public String getId() {
        return id;
    }
    public void setId(String id) {
        this.id = id;
    }
    public String getCdOrg() {
        return cdOrg;
    }
    public void setCdOrg(String cdOrg) {
        this.cdOrg = cdOrg;
    }
    public String getAppTime() {
        return appTime;
    }
    public void setAppTime(String appTime) {
        this.appTime = appTime;
    }
    public String getAppDepCode() {
        return appDepCode;
    }
    public void setAppDepCode(String appDepCode) {
        this.appDepCode = appDepCode;
    }
    public String getAppClassCode() {
        return appClassCode;
    }
    public void setAppClassCode(String appClassCode) {
        this.appClassCode = appClassCode;
    }
    public String getIdDoctor() {
        return idDoctor;
    }
    public void setIdDoctor(String idDoctor) {
        this.idDoctor = idDoctor;
    }
    public String getFgHandle() {
        return fgHandle;
    }
    public void setFgHandle(String fgHandle) {
        this.fgHandle = fgHandle;
    }
    public String getHandleTime() {
        return handleTime;
    }
    public void setHandleTime(String handleTime) {
        this.handleTime = handleTime;
    }
    public String getPtName() {
        return ptName;
    }
    public void setPtName(String ptName) {
        this.ptName = ptName;
    }
    public String getGeCode() {
        return geCode;
    }
    public void setGeCode(String geCode) {
        this.geCode = geCode;
    }
    public String getCardType() {
        return cardType;
    }
    public void setCardType(String cardType) {
        this.cardType = cardType;
    }
    public String getIdNo() {
        return idNo;
    }
    public void setIdNo(String idNo) {
        this.idNo = idNo;
    }
    public String getPtTel() {
        return ptTel;
    }
    public void setPtTel(String ptTel) {
        this.ptTel = ptTel;
    }
}

+ 160 - 28
business/base-service/src/main/java/com/yihu/jw/internet/service/InternetService.java

@ -6,7 +6,9 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.base.message.BaseMessageDO;
import com.yihu.jw.entity.base.org.BaseOrgDO;
import com.yihu.jw.internet.dao.IntUpErrorLogDao;
import com.yihu.jw.internet.dao.MedicalSkillOrdersDao;
import com.yihu.jw.internet.entity.InternetUpErrorLogDO;
import com.yihu.jw.internet.entity.MedicalSkillOrdersDO;
import com.yihu.jw.internet.wsapi.Wsapi;
import com.yihu.jw.internet.wsapi.WsapiProxy;
import com.yihu.jw.message.dao.MessageDao;
@ -31,6 +33,9 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
    @Autowired
    private InternetUpErrorLogService internetUpErrorLogService;
    @Autowired
    private MedicalSkillOrdersDao medicalSkillOrdersDao;
    static String userName = "xmzsyy";
    static String psw = "7j7s9e";
    static String appId = "ws007";
@ -237,7 +242,7 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
        return res;
    }
    // 3 医师基本信息	micc.upNsDoctorRecord   --- 条件付完成  差医师的职务信息的适配未处理
    // 3 医师基本信息	micc.upNsDoctorRecord   --- 完成
    public String upNsDoctorRecord(String startDate, String endDate) throws Exception {
        String api = "micc.upNsDoctorRecord";
        String res = "";
@ -253,7 +258,9 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
                "  from base_doctor a\n" +
                "      ,base_doctor_hospital b\n" +
                " where a.id = b.doctor_code\n"  +
                "   and b.dept_code != '' \n" ;
                "   and b.dept_code != '' \n" +
                "   and b.doctor_duty_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(startDate.length() > 0){
            sql =  sql + "  and a.update_time >=  '" + startDate + "' ";
        }
@ -269,6 +276,8 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
            LinkedCaseInsensitiveMap info = (LinkedCaseInsensitiveMap)list.get(i);
            String[] dept = depToSubject(info.get("dept_code").toString());
            // 中山医院 监管平台  职务字典强转
            String[] dutyInfo = classToduty(info.get("doctor_duty_code").toString());
            JSONObject jb = new JSONObject();
            jb.put("organ_code", orgCode);
@ -285,7 +294,7 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
            jb.put("doo_tel", info.get("mobile")== null ? "":info.get("mobile"));
            jb.put("title_rec_date", "1900-01-01");
            jb.put("prac_type", "1");   // 因为上传的是医师的信息,所以该字段全部默认设置为 1 医师
            jb.put("title_code", "231");  // 需要与监管平台的字典进行映射
            jb.put("title_code", dutyInfo[0].toString());  // 需要与监管平台的字典进行映射
            jb.put("first_compeny_code", orgCode);
            jb.put("first_compeny_name", orgName);
            jb.put("secd_compeny_code", "");
@ -399,35 +408,58 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
        return resInfo;
    }
    // 6 在线医技预约 	micc.upMedicalOnline --- 无该业务,不对应
    public String upMedicalOnline() throws Exception {
    // 6 在线医技预约 	micc.upMedicalOnline --- 完成
    public String upMedicalOnline(String startDate, String endDate) throws Exception {
        String api = "micc.upMedicalOnline";
        String token = upNsUserToken();
        String res = "";
        int total = 0;
        int success = 0;
        int error = 0;
        JSONObject jb = new JSONObject();
        jb.put("id", "");
        jb.put("cd_org", "");
        jb.put("cd_area", "");
        jb.put("cd_orgSub", "");
        jb.put("app_time", "");
        jb.put("app_dep_code", "");
        jb.put("app_class_code", "");
        jb.put("id_doctor", "");
        jb.put("fg_handle", "");
        jb.put("handle_time", "");
        jb.put("pt_name", "");
        jb.put("ge_code", "");
        jb.put("card_type", "");
        jb.put("id_no", "");
        jb.put("pt_tel", "");
        jb.put("crt_date", "");
        JSONArray jsonArray = new JSONArray();
        jsonArray.add(jb);
        String res = postToInter(token,api, jsonArray);
        List<MedicalSkillOrdersDO> medicalSkillOrdersDOs= medicalSkillOrdersDao.findMedicalSkillOrdersByAppTime(startDate,endDate);
        if(medicalSkillOrdersDOs != null && medicalSkillOrdersDOs.size() > 0){
            total = medicalSkillOrdersDOs.size();
            for(MedicalSkillOrdersDO medicalSkillOrdersDO :medicalSkillOrdersDOs ){
                String[] dept = depToSubject(medicalSkillOrdersDO.getAppDepCode().toString());
                String docInterId = achNsDoctorRecord(medicalSkillOrdersDO.getIdDoctor());
                JSONObject jb = new JSONObject();
                jb.put("id",orgCode + medicalSkillOrdersDO.getId());
                jb.put("cd_org", orgCode);
                jb.put("cd_area", orgArea);
                jb.put("cd_orgSub", orgSub);
                jb.put("app_time",medicalSkillOrdersDO.getAppTime().toString());
                jb.put("app_dep_code", dept[0].toString());
                jb.put("app_class_code", medicalSkillOrdersDO.getAppClassCode());
                jb.put("id_doctor", docInterId);
                jb.put("fg_handle", medicalSkillOrdersDO.getFgHandle());
                jb.put("handle_time", medicalSkillOrdersDO.getHandleTime());
                jb.put("pt_name", medicalSkillOrdersDO.getPtName());
                jb.put("ge_code", medicalSkillOrdersDO.getGeCode());
                jb.put("card_type", "1");
                jb.put("id_no", medicalSkillOrdersDO.getIdNo());
                jb.put("pt_tel", medicalSkillOrdersDO.getPtTel());
                jb.put("crt_date",DateUtil.dateToStrLong(DateUtil.getNow()));
                JSONArray jsonArray = new JSONArray();
                jsonArray.add(jb);
                res = postToInter(token,api, jsonArray);
                JSONObject resJson = (JSONObject) JSONObject.parse(res);
                if("200".equals(resJson.get("msg").toString())){
                    success++;
                }else{
                    saveErrorLog("6",medicalSkillOrdersDO.getId().toString(),res);
                    error++;
                }
            }
        }
        return res;
        String resInfo = "此次共上传:" + total + "条数据,其中成功 :" + success + "条,失败 : " + error + "条。";
        return resInfo;
    }
    // 7 医生评价信息	micc.upNsDoctorScore  --- 完成
@ -1061,5 +1093,105 @@ public class InternetService extends BaseJpaService<InternetUpErrorLogDO, IntUpE
        internetUpErrorLogService.save(internetUpErrorLogDO);
    }
    // 基于中山医院的职务字典,强转为监管平台的字典(该部分过滤掉字典与监管理无法匹配的部分)
    public static  String[]  classToduty(String duty){
        String[] res = new String[2];
        switch (duty) {
            case "1303":
                res[0] = "243";
                res[1] = "主管药师";
            case "1304":
                res[0] = "243";
                res[1] = "主管药师";
            case "1101":
                res[0] = "231";
                res[1] = "主任医师";
            case "065":
                res[0] = "231";
                res[1] = "主任医师";
            case "1201":
                res[0] = "232";
                res[1] = "副主任医师";
            case "067":
                res[0] = "232";
                res[1] = "副主任医师";
            case "1301":
                res[0] = "233";
                res[1] = "主治医师";
            case "066":
                res[0] = "233";
                res[1] = "主治医师";
            case "1310":
                res[0] = "233";
                res[1] = "主治医师";
            case "1401":
                res[0] = "234";
                res[1] = "医师";
            case "061":
                res[0] = "234";
                res[1] = "医师";
            case "1501":
                res[0] = "235";
                res[1] = "医士";
            case "1103":
                res[0] = "241";
                res[1] = "主任药师";
            case "1104":
                res[0] = "241";
                res[1] = "主任药师";
            case "1203":
                res[0] = "242";
                res[1] = "副主任药师";
            case "1403":
                res[0] = "244";
                res[1] = "药师";
            case "1404":
                res[0] = "244";
                res[1] = "药师";
            case "1503":
                res[0] = "245";
                res[1] = "药士";
            case "1102":
                res[0] = "251";
                res[1] = "主任护师";
            case "1204":
                res[0] = "252";
                res[1] = "副主护师";
            case "1302":
                res[0] = "253";
                res[1] = "主管护师";
            case "1402":
                res[0] = "254";
                res[1] = "护师";
            case "1502":
                res[0] = "255";
                res[1] = "护士";
            case "1107":
                res[0] = "261";
                res[1] = "主任技师";
            case "1207":
                res[0] = "262";
                res[1] = "副主任技师";
            case "1307":
                res[0] = "263";
                res[1] = "主管技师";
            case "056":
                res[0] = "263";
                res[1] = "主管技师";
            case "1407":
                res[0] = "264";
                res[1] = "技师";
            case "006":
                res[0] = "264";
                res[1] = "技师";
            case "053":
                res[0] = "264";
                res[1] = "技师";
            case "1202":
                res[0] = "252";
                res[1] = "副主护师";
        }
        return  res;
    }
}

+ 4 - 0
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/job/InternetUpdateJob.java

@ -36,6 +36,10 @@ public class InternetUpdateJob implements Job {
            res = internetService.upAppointmentOnline(startDate,endDate);
            logger.info("END==========2.5 网上预约挂号上传结束========" + res);
            logger.info("START========2.6 网上医技预约上传开始========");
            res = internetService.upMedicalOnline(startDate,endDate);
            logger.info("END==========2.5 网上医技预约上传结束========" + res);
            logger.info("START========2.7 医生评价信息开始========");
            res = internetService.upNsDoctorScore(startDate,endDate);
            logger.info("END==========2.7 医生评价信息结束========" + res);