Pārlūkot izejas kodu

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

wangjun 4 gadi atpakaļ
vecāks
revīzija
89b80c5858

+ 2 - 0
business/base-service/src/main/java/com/yihu/jw/dict/dao/BaseJobCategoryDao.java

@ -12,4 +12,6 @@ public interface BaseJobCategoryDao extends PagingAndSortingRepository<BaseJobCa
    List<BaseJobCategoryDO> findFirstCategoryList();
    List<BaseJobCategoryDO> findFirstCategoryList();
    @Query("from BaseJobCategoryDO t where t.pid = ?1 and t.del = 1")
    @Query("from BaseJobCategoryDO t where t.pid = ?1 and t.del = 1")
    List<BaseJobCategoryDO> findSecondCategoryList(String pid);
    List<BaseJobCategoryDO> findSecondCategoryList(String pid);
    @Query("from BaseJobCategoryDO t where t.name = ?1 and t.del = 1")
    BaseJobCategoryDO findByName(String name);
}
}

+ 26 - 1
business/base-service/src/main/java/com/yihu/jw/hospital/family/service/WlyyFamilyMemberService.java

@ -1,6 +1,8 @@
package com.yihu.jw.hospital.family.service;
package com.yihu.jw.hospital.family.service;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.dict.dao.BaseJobCategoryDao;
import com.yihu.jw.entity.base.dict.BaseJobCategoryDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.entity.hospital.family.BasePatientMemberDictDO;
import com.yihu.jw.entity.hospital.family.BasePatientMemberDictDO;
@ -62,6 +64,8 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
    private YkyyService ykyyService;
    private YkyyService ykyyService;
    @Value("${wechat.id}")
    @Value("${wechat.id}")
    private String wxId;
    private String wxId;
    @Autowired
    private BaseJobCategoryDao baseJobCategoryDao;
    //添加关联家属
    //添加关联家属
    @Transactional
    @Transactional
@ -586,7 +590,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
        }
        }
    }
    }
    //获取单个亲属详细信息
    //获取单个亲属详细信息
    public List<Map<String,Object>>  findMemberById(String id) throws ParseException {
    public List<Map<String,Object>>  findMemberById(String id) throws Exception {
        String sql="select t.id as \"id\",t.card_type as \"cardType\"," +
        String sql="select t.id as \"id\",t.card_type as \"cardType\"," +
                "t.family_member as \"familyMember\",t.patient as \"patient\"," +
                "t.family_member as \"familyMember\",t.patient as \"patient\"," +
                "b.name as \"name\",b.idcard as \"idcard\",b.mobile as \"mobile\",t.clinicid as \"clinicid\"," +
                "b.name as \"name\",b.idcard as \"idcard\",b.mobile as \"mobile\",t.clinicid as \"clinicid\"," +
@ -610,9 +614,30 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                        List<PatientMedicareCardDO> list1 = basePatientMedicareCardDao.findByPatientCode(map.get("familyMember").toString());
                        List<PatientMedicareCardDO> list1 = basePatientMedicareCardDao.findByPatientCode(map.get("familyMember").toString());
                        if (list1!=null&&list1.size()!=0){
                        if (list1!=null&&list1.size()!=0){
                            map.put("card",list1.get(0));
                            map.put("card",list1.get(0));
                            JSONObject object = ykyyEntranceService.selectByAddress(list1.get(0).getCode());
                            if (object!=null){
                                map.put("address",object.getString("address"));
                                map.put("zydm",object.getString("zydm"));
                                if (StringUtils.isNotBlank(object.getString("zydm"))){
                                    BaseJobCategoryDO jobCategoryDO = baseJobCategoryDao.findOne(Integer.parseInt(object.getString("zydm")));
                                    if (jobCategoryDO!=null){
                                        map.put("zydmName",jobCategoryDO.getName());
                                    }
                                }else {
                                    map.put("zydmName","");
                                }
                                map.put("jtdh",object.getString("jtdh"));
                            }
                        }else {
                        }else {
                            map.put("card","");
                            map.put("card","");
                            map.put("address","");
                            map.put("zydm","");
                            map.put("jtdh","");
                            map.put("zydmName","");
                        }
                        }
                    }
                    }
                }
                }
            }
            }

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

@ -2,12 +2,15 @@ package com.yihu.jw.hospital.prescription.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSON;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.dict.dao.BaseDictJobTitleDao;
import com.yihu.jw.dict.dao.BaseJobCategoryDao;
import com.yihu.jw.dict.dao.DictDeptDescDao;
import com.yihu.jw.dict.dao.DictDeptDescDao;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.doctor.service.BaseDoctorInfoService;
import com.yihu.jw.doctor.service.BaseDoctorInfoService;
import com.yihu.jw.entity.base.area.BaseDrugStoreDO;
import com.yihu.jw.entity.base.area.BaseDrugStoreDO;
import com.yihu.jw.entity.base.dict.BaseJobCategoryDO;
import com.yihu.jw.entity.base.dict.DictDeptDescDO;
import com.yihu.jw.entity.base.dict.DictDeptDescDO;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
@ -127,6 +130,8 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.*;
import static javafx.scene.input.KeyCode.L;
/**
/**
 * Created by Trick on 2019/5/17.
 * Created by Trick on 2019/5/17.
 */
 */
@ -274,6 +279,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private BaseNatAppointmentDao baseNatAppointmentDao;
    private BaseNatAppointmentDao baseNatAppointmentDao;
    @Autowired
    @Autowired
    private PayInfoNoticeService payInfoNoticeService;
    private PayInfoNoticeService payInfoNoticeService;
    @Autowired
    private BaseJobCategoryDao jobCategoryDao;
@ -10708,9 +10715,17 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            businessDO.setPayType(1);
            businessDO.setPayType(1);
            businessDO.setUpdateTime(new Date());
            businessDO.setUpdateTime(new Date());
            businessOrderDao.save(businessDO);
            businessOrderDao.save(businessDO);
            logger.info("更新建档信息");
            BaseJobCategoryDO jobCategoryDO =jobCategoryDao.findByName(firstJobName);
            Float zy= 0f;
            if (jobCategoryDO!=null){
                zy=Float.parseFloat(jobCategoryDO.getId()+"");
            }
            ykyyEntranceService.updatePatientJd(patientId,address,mobile,zy,demoFlag);
            //同步眼科医院
            //同步眼科医院
            logger.info("开始同步眼科医院");
            logger.info("开始同步眼科医院");
            ykyyEntranceService.saveKsjc(baseNatAppointmentDO,demoFlag);
            ykyyEntranceService.saveKsjc(baseNatAppointmentDO,demoFlag);
            //预约成功后发送支付模板消息
            //预约成功后发送支付模板消息
            sendYktemplateMessage(baseNatAppointmentDO.getId(),false);
            sendYktemplateMessage(baseNatAppointmentDO.getId(),false);
            logger.info("结束同步眼科医院");
            logger.info("结束同步眼科医院");

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

@ -8,6 +8,7 @@ import com.yihu.jw.dict.dao.DictHospitalDeptDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.doctor.dao.BaseDoctorRoleDao;
import com.yihu.jw.doctor.dao.BaseDoctorRoleDao;
import com.yihu.jw.entity.base.dict.BaseJobCategoryDO;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.dict.DictIcd10DO;
import com.yihu.jw.entity.base.dict.DictIcd10DO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
@ -79,6 +80,8 @@ public class YkyyEntranceService {
    private final static String jdbcUrl="http://192.168.33.197:10023/ykyy/jdbcSQLQuery";
    private final static String jdbcUrl="http://192.168.33.197:10023/ykyy/jdbcSQLQuery";
    private final static String updateJdxx="http://192.168.33.197:10023/ykyy/updateJdxx";
    private final static String orgCode ="350211A5004";
    private final static String orgCode ="350211A5004";
    private final static String orgName ="厦门大学附属厦门眼科中心";
    private final static String orgName ="厦门大学附属厦门眼科中心";
@ -133,8 +136,6 @@ public class YkyyEntranceService {
    @Autowired
    @Autowired
    private JdbcTemplate jdbcTemplate;
    private JdbcTemplate jdbcTemplate;
    @Autowired
    @Autowired
    private DictDoctorDutyDao dictDoctorDutyDao;
    @Autowired
    private BasePatientMedicareCardDao patientMedicareCardDao;
    private BasePatientMedicareCardDao patientMedicareCardDao;
    @Autowired
    @Autowired
    private WlyyInspectionDao wlyyInspectionDao;
    private WlyyInspectionDao wlyyInspectionDao;
@ -2130,6 +2131,7 @@ public class YkyyEntranceService {
            JSONObject object = array.getJSONObject(0);
            JSONObject object = array.getJSONObject(0);
            String yjxh = object.getString("yjxh");
            String yjxh = object.getString("yjxh");
            natAppointmentDO.setRealOrder(yjxh);
            natAppointmentDO.setRealOrder(yjxh);
            natAppointmentDO.setIsSuccess("1");
            baseNatAppointmentDao.save(natAppointmentDO);
            baseNatAppointmentDao.save(natAppointmentDO);
        }else {
        }else {
        }
        }
@ -3029,6 +3031,63 @@ public class YkyyEntranceService {
    public JSONObject selectByAddress(String cardNo) throws Exception {
        JSONObject jsonObject = new JSONObject();
        String address = null;
        String zydm = null;
        String jtdh = null;
        JSONArray array = new JSONArray();
        String sql = "SELECT brid as \"brid\",hkdz as \"hkdz\",zydm as \"zydm\",jtdh as \"jtdh\" from portal_his.V_ZKSG_BRCX@xec_link where jzkh = '"+cardNo+"'";
        Map<String,Object> params = new HashedMap();
        params.put("sql",sql);
        HttpResponse response = HttpUtils.doGet(url,params);
        String content = response.getContent();
        logger.info("response:"+content);
        JSONObject rs = JSON.parseObject(content);
        Integer status = rs.getInteger("status");
        if (status==200){
            array = rs.getJSONArray("detailModelList");
            if (array!=null&&array.size()!=0){
                JSONObject object = array.getJSONObject(0);
                address=object.getString("hkdz");
                zydm = object.getString("zydm");
                jtdh = object.getString("jtdh");
                jsonObject.put("address",address);
                jsonObject.put("zydm",zydm);
                jsonObject.put("jtdh",jtdh);
            }
        }
        return  jsonObject;
    }
    /**
     * 通过卡号更新患者信息
     */
    public void updatePatientJd(String patient,String address,String phone,Float zy, boolean demoFlag) throws Exception {
        BasePatientDO basePatientDO = basePatientDao.findById(patient);
        PatientMedicareCardDO patientMedicareCardDO = patientMedicareCardDao.findByTypeAndPatientCodeAndDel("A_01",patient,"1");
        JSONArray jsonArray = findHisPatient(patientMedicareCardDO.getCode(),demoFlag);
        if(jsonArray!=null&&jsonArray.size()>0){
            //获取居民信息
            JSONObject json = jsonArray.getJSONObject(0);
            String brid = json.getString("brid");
            Float id = Float.parseFloat(brid);
            Map<String,Object> params = new HashedMap();
            params.put("brid",id);
            params.put("sfzh",basePatientDO.getIdcard());
            params.put("lxdh",phone);
            params.put("lxdz",address);
            params.put("zy",zy);
            HttpResponse response = HttpUtils.doGet(updateJdxx,params);
            logger.info("更新患者信息"+response);
        }
    }
    public String saveJdxx(String brxm,String csny,Float brxb,String czgh,String sfzh,Float sjhm,String ybkh,String lxdz,Float zy){
    public String saveJdxx(String brxm,String csny,Float brxb,String czgh,String sfzh,Float sjhm,String ybkh,String lxdz,Float zy){
        return  hibenateUtils.saveJdxx(brxm,DateUtil.strToDateShort(csny),brxb,czgh,sfzh,sjhm,ybkh,lxdz,zy);
        return  hibenateUtils.saveJdxx(brxm,DateUtil.strToDateShort(csny),brxb,czgh,sfzh,sjhm,ybkh,lxdz,zy);

+ 1 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/hospital/WlyyFamilyMemberController.java

@ -399,7 +399,7 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
    @ApiOperation("获取单个亲属信息")
    @ApiOperation("获取单个亲属信息")
    @PostMapping(value = BaseHospitalRequestMapping.WlyyFamilyMember.findSingleMember)
    @PostMapping(value = BaseHospitalRequestMapping.WlyyFamilyMember.findSingleMember)
    public Envelop findSingleMember(@ApiParam(name = "id", value = "id", required = false)
    public Envelop findSingleMember(@ApiParam(name = "id", value = "id", required = false)
                                    @RequestParam(value = "id", required = false) String id) throws ParseException {
                                    @RequestParam(value = "id", required = false) String id) throws Exception {
        return success(wlyyFamilyMemberService.findMemberById(id));
        return success(wlyyFamilyMemberService.findMemberById(id));
    }
    }
    public boolean verifyCaptcha(String key,String text){
    public boolean verifyCaptcha(String key,String text){

+ 3 - 2
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -1500,8 +1500,9 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                    @RequestParam(value = "page", required = false)Integer page,
                                    @RequestParam(value = "page", required = false)Integer page,
                                    @ApiParam(name = "pageSize", value = "每页大小")
                                    @ApiParam(name = "pageSize", value = "每页大小")
                                        @RequestParam(value = "pageSize", required = false)Integer pageSize) throws Exception {
                                        @RequestParam(value = "pageSize", required = false)Integer pageSize) throws Exception {
        prescriptionService.savePayStatusByHis(patientId);
        if (wxId.equalsIgnoreCase("xm_zsyy_wx")){
            prescriptionService.savePayStatusByHis(patientId);
        }
        logger.info("同步数据成功");
        logger.info("同步数据成功");
        return  prescriptionService.getNatRecords(patientId,id,payStatus,appointmentTime,isSuccess,page,pageSize);
        return  prescriptionService.getNatRecords(patientId,id,payStatus,appointmentTime,isSuccess,page,pageSize);
    }
    }