Explorar o código

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

# Conflicts:
#	business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
wangzhinan %!s(int64=4) %!d(string=hai) anos
pai
achega
0c867f9c40

+ 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();
    @Query("from BaseJobCategoryDO t where t.pid = ?1 and t.del = 1")
    List<BaseJobCategoryDO> findSecondCategoryList(String pid);
    @Query("from BaseJobCategoryDO t where t.name = ?1 and t.del = 1")
    BaseJobCategoryDO findByName(String name);
}

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

@ -586,7 +586,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\"," +
                "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\"," +
@ -610,9 +610,13 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                        List<PatientMedicareCardDO> list1 = basePatientMedicareCardDao.findByPatientCode(map.get("familyMember").toString());
                        if (list1!=null&&list1.size()!=0){
                            map.put("card",list1.get(0));
                            String address = ykyyEntranceService.selectByAddress(list1.get(0).getCode());
                            map.put("address",address);
                        }else {
                            map.put("card","");
                            map.put("address","");
                        }
                    }
                }
            }

+ 14 - 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.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.DictHospitalDeptDao;
import com.yihu.jw.doctor.dao.BaseDoctorDao;
import com.yihu.jw.doctor.dao.BaseDoctorHospitalDao;
import com.yihu.jw.doctor.service.BaseDoctorInfoService;
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.DictHospitalDeptDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
@ -127,6 +130,8 @@ import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;
import static javafx.scene.input.KeyCode.L;
/**
 * Created by Trick on 2019/5/17.
 */
@ -274,6 +279,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
    private BaseNatAppointmentDao baseNatAppointmentDao;
    @Autowired
    private PayInfoNoticeService payInfoNoticeService;
    @Autowired
    private BaseJobCategoryDao jobCategoryDao;
@ -10708,6 +10715,13 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            businessDO.setPayType(1);
            businessDO.setUpdateTime(new Date());
            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("开始同步眼科医院");
            ykyyEntranceService.saveKsjc(baseNatAppointmentDO,demoFlag);

+ 52 - 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.BaseDoctorHospitalDao;
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.DictIcd10DO;
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 updateJdxx="http://192.168.33.197:10023/ykyy/updateJdxx";
    private final static String orgCode ="350211A5004";
    private final static String orgName ="厦门大学附属厦门眼科中心";
@ -131,8 +134,6 @@ public class YkyyEntranceService {
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private DictDoctorDutyDao dictDoctorDutyDao;
    @Autowired
    private BasePatientMedicareCardDao patientMedicareCardDao;
    @Autowired
    private WlyyInspectionDao wlyyInspectionDao;
@ -3027,6 +3028,55 @@ public class YkyyEntranceService {
    public String selectByAddress(String cardNo) throws Exception {
        String address = null;
        JSONArray array = new JSONArray();
        String sql = "SELECT brid as \"brid\",lxdz as \"lxdz\" 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("lxdz");
            }
        }
        return  address;
    }
    /**
     * 通过卡号更新患者信息
     */
    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){
        return  hibenateUtils.saveJdxx(brxm,DateUtil.strToDateShort(csny),brxb,czgh,sfzh,sjhm,ybkh,lxdz,zy);