|
@ -868,11 +868,39 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
WlyyOutpatientDO outpatient = outpatientDao.save(outpatientDO);
|
|
|
WlyyHospitalSysDictDO hospitalSysDictDO = hospitalSysDictDao.findById("WX_MONEY");
|
|
|
Double price = 0.0;
|
|
|
if (doctorDO != null && StringUtils.isNoneBlank(doctorDO.getFee())) {
|
|
|
price = Double.parseDouble(doctorDO.getFee());
|
|
|
String chargeType1 = null;
|
|
|
if (outpatient.getOutpatientType().equalsIgnoreCase("1")){
|
|
|
if(outpatientDO.getType().equalsIgnoreCase("1")){
|
|
|
chargeType1 = doctorDO.getTwfzChargeType();
|
|
|
}else if(outpatientDO.getType().equalsIgnoreCase("2")){
|
|
|
chargeType1 = doctorDO.getSpfzChargeType();
|
|
|
}
|
|
|
}else if (outpatient.getOutpatientType().equalsIgnoreCase("3")){
|
|
|
if(outpatientDO.getType().equalsIgnoreCase("1")){
|
|
|
chargeType1 = doctorDO.getTwzxChargeType();
|
|
|
}else if(outpatientDO.getType().equalsIgnoreCase("2")){
|
|
|
chargeType1 = doctorDO.getSpzxChargeType();
|
|
|
}
|
|
|
}else if (outpatient.getOutpatientType().equalsIgnoreCase("2")){
|
|
|
chargeType1 = doctorDO.getXtfzChargeType();
|
|
|
}
|
|
|
if(doctorDO!=null){
|
|
|
if (StringUtils.isNoneBlank(chargeType1)){
|
|
|
WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByChargeType(chargeType1);
|
|
|
if (chargeDictDO!=null){
|
|
|
price = chargeDictDO.getReqFee();
|
|
|
}else {
|
|
|
price = Double.parseDouble(hospitalSysDictDO.getDictValue());
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
price = Double.parseDouble(hospitalSysDictDO.getDictValue());
|
|
|
}
|
|
|
/*if (doctorDO != null && StringUtils.isNoneBlank(doctorDO.getFee())) {
|
|
|
price = Double.parseDouble(doctorDO.getFee());
|
|
|
}else {
|
|
|
price = Double.parseDouble(hospitalSysDictDO.getDictValue());
|
|
|
}*/
|
|
|
if (price == 0.0) {
|
|
|
outpatientDO.setPayStatus(1);
|
|
|
} else {
|
|
@ -1460,7 +1488,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
" h.dept_code AS \"deptCode\"," +
|
|
|
" h.dept_Name AS \"deptName\"," +
|
|
|
" d.outpatient_type AS \"outpatientType\"," +
|
|
|
" d.consult_status AS \"consultStatus\"" +
|
|
|
" d.consult_status AS \"consultStatus\"," +
|
|
|
" d.twfz_charge_type AS \"twfzConsultStatus\"," +
|
|
|
" d.spfz_charge_type AS \"spfzConsultStatus\"," +
|
|
|
" d.twzx_charge_type AS \"twzxConsultStatus\"," +
|
|
|
" d.spzx_charge_type AS \"spzxConsultStatus\"," +
|
|
|
" d.xtfz_charge_type AS \"xtfzConsultStatus\" " +
|
|
|
" FROM " +
|
|
|
" base_doctor d " +
|
|
|
" JOIN base_doctor_hospital h ON h.doctor_code = d.id " +
|
|
@ -1546,7 +1579,22 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
}
|
|
|
List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
|
|
|
if (null!=doctor.get("chargeType")){
|
|
|
String sqlCharge = "SELECT\n" +
|
|
|
"\tm.req_fee as \"twfzFee\",\n" +
|
|
|
"\ta.req_fee as \"spfzFee\",\n" +
|
|
|
"\tb.req_fee as \"spzxFee\",\n" +
|
|
|
"\tv.req_fee as \"twzxFee\",\n" +
|
|
|
"\td.req_fee as \"xtzxFee\"\n" +
|
|
|
"FROM\n" +
|
|
|
"\tbase_doctor t\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
|
|
|
"WHERE t.id = '"+doctor.get("id")+"' ";
|
|
|
chargeDictDOLists = hibenateUtils.createSQLQuery(sqlCharge);
|
|
|
/*if (null!=doctor.get("chargeType")){
|
|
|
String chargeTypeList = doctor.get("chargeType").toString();
|
|
|
if (chargeType.contains(",")){
|
|
|
chargeTypeList = chargeType.replace(",","','");
|
|
@ -1555,11 +1603,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
"req_fee as \"reqFee\",dept_type_code as \"deptTypeCode\" " +
|
|
|
" from wlyy_charge_dict where 1=1";
|
|
|
sqlCharge+=" and charge_type in ( '"+chargeTypeList+"')";
|
|
|
|
|
|
if (StringUtils.isNoneBlank(deptTyepCode)){
|
|
|
sqlCharge+=" and dept_type_code in ( '"+deptTyepCode+"')";
|
|
|
}
|
|
|
chargeDictDOLists = hibenateUtils.createSQLQuery(sqlCharge);
|
|
|
}
|
|
|
}*/
|
|
|
doctor.put("chargeTypeList",chargeDictDOLists);
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(doctorCode)) {
|
|
@ -2828,7 +2877,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
*/
|
|
|
public MixEnvelop findExpressageList(String status, String oneselfPickupFlg, String nameKey, String startTime, String endTime, Integer page, Integer size, String wxId) {
|
|
|
String totalSql = "SELECT " +
|
|
|
" COUNT(1) AS total " +
|
|
|
" COUNT(1) AS \"total\" " +
|
|
|
" FROM " +
|
|
|
" wlyy_outpatient o " +
|
|
|
" JOIN wlyy_prescription p ON p.outpatient_id = o.id " +
|
|
@ -3462,7 +3511,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
}
|
|
|
List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
|
|
|
String chargeType = doctorDO.getChargeType();
|
|
|
/*String chargeType = doctorDO.getChargeType();
|
|
|
if (StringUtils.isNotBlank(chargeType)){
|
|
|
if (chargeType.contains(",")){
|
|
|
chargeType = chargeType.replace(",","','");
|
|
@ -3475,7 +3524,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
sqlCharge+=" and dept_type_code in ( '"+deptTyepCode+"')";
|
|
|
}
|
|
|
chargeDictDOLists = hibenateUtils.createSQLQuery(sqlCharge);
|
|
|
}
|
|
|
}*/
|
|
|
rs.put("chargeTypeList",chargeDictDOLists);
|
|
|
//机构科室信息
|
|
|
List<BaseDoctorHospitalDO> hospitalDOs = baseDoctorHospitalDao.findByDoctorCode(doctorDO.getId());
|
|
@ -3728,7 +3777,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
}
|
|
|
}
|
|
|
List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
|
|
|
/*List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
|
|
|
String chargeType = doctorDO.getChargeType();
|
|
|
if (StringUtils.isNotBlank(chargeType)){
|
|
|
if (chargeType.contains(",")){
|
|
@ -3743,7 +3792,23 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
chargeDictDOLists = hibenateUtils.createSQLQuery(sqlCharge);
|
|
|
}
|
|
|
rs.put("chargeTypeList",chargeDictDOLists);
|
|
|
rs.put("chargeTypeList",chargeDictDOLists);*/
|
|
|
List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
|
|
|
String sqlCharge = "SELECT\n" +
|
|
|
"\tm.req_fee as \"twfzFee\",\n" +
|
|
|
"\ta.req_fee as \"spfzFee\",\n" +
|
|
|
"\tb.req_fee as \"spzxFee\",\n" +
|
|
|
"\tv.req_fee as \"twzxFee\",\n" +
|
|
|
"\td.req_fee as \"xtzxFee\"\n" +
|
|
|
"FROM\n" +
|
|
|
"\tbase_doctor t\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
|
|
|
"WHERE t.id = '"+doctorDO.getId()+"' ";
|
|
|
chargeDictDOLists = hibenateUtils.createSQLQuery(sqlCharge);
|
|
|
//机构科室信息
|
|
|
List<BaseDoctorHospitalDO> hospitalDOs = baseDoctorHospitalDao.findByDoctorCode(doctorDO.getId());
|
|
|
List<BaseDoctorHospitalDO> hospitalDOList = new ArrayList<>();
|
|
@ -5212,7 +5277,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
|
|
|
}
|
|
|
}
|
|
|
List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
|
|
|
/*List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
|
|
|
if(null!=map.get("chargeType")){
|
|
|
String chargeType = map.get("chargeType").toString();
|
|
|
if (chargeType.contains(",")){
|
|
@ -5227,7 +5292,23 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
chargeDictDOLists = hibenateUtils.createSQLQuery(sqlCharge);
|
|
|
}
|
|
|
map.put("chargeTypeList",chargeDictDOLists);
|
|
|
map.put("chargeTypeList",chargeDictDOLists);*/
|
|
|
List<Map<String,Object>> chargeDictDOLists = new ArrayList<>();
|
|
|
String sqlCharge = "SELECT\n" +
|
|
|
"\tm.req_fee as \"twfzFee\",\n" +
|
|
|
"\ta.req_fee as \"spfzFee\",\n" +
|
|
|
"\tb.req_fee as \"spzxFee\",\n" +
|
|
|
"\tv.req_fee as \"twzxFee\",\n" +
|
|
|
"\td.req_fee as \"xtzxFee\"\n" +
|
|
|
"FROM\n" +
|
|
|
"\tbase_doctor t\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict m ON t.twfz_charge_type = m.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict a ON t.spfz_charge_type = a.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict b ON t.spzx_charge_type = b.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict v ON t.twzx_charge_type = v.charge_type\n" +
|
|
|
"LEFT JOIN wlyy_charge_dict d ON t.xtfz_charge_type = d.charge_type\n" +
|
|
|
"WHERE t.id = '"+map.get("id")+"' ";
|
|
|
chargeDictDOLists = hibenateUtils.createSQLQuery(sqlCharge);
|
|
|
//查询医生各项评价平均分
|
|
|
String sqlscore = "SELECT " +
|
|
|
"AVG(a.score) AS \"score\"," +
|
|
@ -8718,7 +8799,8 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
if (prescriptionDO == null) {
|
|
|
throw new Exception("处方不存在!");
|
|
|
}
|
|
|
List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wxId, prescriptionDO.getPatientCode());
|
|
|
WlyyOutpatientDO outpatientDO = outpatientDao.findById(oupatientId);
|
|
|
List<BasePatientWechatDo> patientWechatDos = patientWechatDao.findByWechatIdAndPatientId(wxId, outpatientDO.getConsumer());
|
|
|
if (patientWechatDos == null || patientWechatDos.size() == 0) {
|
|
|
throw new Exception("openid不存在!");
|
|
|
}
|
|
@ -9105,4 +9187,252 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public com.alibaba.fastjson.JSONObject selectHospitalInfo(String doctorId,String orgCode){
|
|
|
/**
|
|
|
* 1、今日待就诊:今日当前家庭医生在当前医院的未完成的协同门诊书
|
|
|
|
|
|
2、下一次就诊时间:当前家庭医生在当前医院下一次未接诊的就诊时间。
|
|
|
|
|
|
3、服务评分:当前医院的综合服务评分
|
|
|
|
|
|
4、在线医生:当前医院在班的专科医生数
|
|
|
|
|
|
5、可预约医生:当前医院有开通协同门诊业务的医生数(包含当前在线)
|
|
|
|
|
|
6、累计就诊:当前医院累计协同门诊的已接诊数量
|
|
|
*/
|
|
|
Date startTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 00:00:00");
|
|
|
Date endTime = DateUtil.strToDateLong(DateUtil.getStringDateShort()+" 23:59:59");
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = new com.alibaba.fastjson.JSONObject();
|
|
|
// 1、今日待就诊:今日当前家庭医生在当前医院的未完成的协同门诊书
|
|
|
List<WlyyOutpatientDO> outpatientDOS = outpatientDao.findByGeneralDoctorAndStatusAndDate(doctorId,startTime,endTime,"0,1,2");
|
|
|
jsonObject.put("NowWaitTotal",outpatientDOS.size());
|
|
|
//2、下一次就诊时间:当前家庭医生在当前医院下一次未接诊的就诊时间。
|
|
|
List<WlyyOutpatientDO> outpatientDOList = outpatientDao.findByGeneralDoctorAndStatus(doctorId,"0");
|
|
|
if (outpatientDOList!=null&&outpatientDOList.size()!=0){
|
|
|
jsonObject.put("nextTime",DateUtil.dateToStrLong(outpatientDOList.get(0).getRegisterDate()));
|
|
|
}else {
|
|
|
jsonObject.put("nextTime",null);
|
|
|
}
|
|
|
//3、服务评分:当前医院的综合服务评分
|
|
|
|
|
|
//在线医生:当前医院在班的专科医生数
|
|
|
String sql ="SELECT d.id as \"id\",d.name as \"name\" FROM base_doctor d WHERE (EXISTS (SELECT 1 FROM wlyy_doctor_work_time t WHERE t.doctor = d.id AND t.start_time >=:startTime AND t.end_time <=:endTime ) OR d.consult_status = '1')";
|
|
|
Map<String, Object> params = new HashedMap();
|
|
|
params.put("startTime",startTime);
|
|
|
params.put("endTime",endTime);
|
|
|
List<Map<String, Object>> list = hibenateUtils.createSQLQuery(sql, params);
|
|
|
jsonObject.put("onlineDoctors",list.size());
|
|
|
|
|
|
//可预约医生:当前医院有开通协同门诊业务的医生数(包含当前在线)
|
|
|
sql += " AND outpatient_type IN('xt') ";
|
|
|
List<Map<String, Object>> specialist = hibenateUtils.createSQLQuery(sql, params);
|
|
|
jsonObject.put("xtOnlineDoctors",specialist.size());
|
|
|
//累计就诊:当前医院累计协同门诊的已接诊数量
|
|
|
List<WlyyOutpatientDO> wlyyOutpatientDOList = outpatientDao.findOutpatientListByOutpatientType("xt",new Date());
|
|
|
jsonObject.put("xtOupatients",wlyyOutpatientDOList.size());
|
|
|
BaseOrgDO orgDO = baseOrgDao.findByCode(orgCode);
|
|
|
jsonObject.put("orgName",orgDO.getName());
|
|
|
jsonObject.put("orgPhoto",orgDO.getPhoto());
|
|
|
jsonObject.put("description",orgDO.getIntro());
|
|
|
return jsonObject;
|
|
|
}
|
|
|
|
|
|
|
|
|
/**
|
|
|
*
|
|
|
* @param price
|
|
|
* @param type
|
|
|
* @param flag
|
|
|
* @return
|
|
|
*/
|
|
|
public String synYktZxPrice(String idcard,Integer price,Integer type,String flag) throws Exception {
|
|
|
if (StringUtils.isNoneBlank(flag)){
|
|
|
List<BaseDoctorDO> doctorDOList = baseDoctorDao.findByDel();
|
|
|
for (BaseDoctorDO doctorDO:doctorDOList){
|
|
|
String yktDoctor = null;
|
|
|
DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctorDO.getId());
|
|
|
if (doctorMappingDO!=null){
|
|
|
String doctorResponse = ykyyService.getYktDoctor(doctorMappingDO.getMappingCode());
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(doctorResponse);
|
|
|
if (jsonObject.getInteger("code")==200){
|
|
|
com.alibaba.fastjson.JSONArray array1 = jsonObject.getJSONArray("data");
|
|
|
if (array1!=null&&array1.size()!=0){
|
|
|
yktDoctor=array1.getJSONObject(0).getString("DOCTORUSERID");
|
|
|
}
|
|
|
}
|
|
|
if (StringUtils.isNoneBlank(yktDoctor)){
|
|
|
doctorDO.setYktDoctorId(yktDoctor);
|
|
|
//图文
|
|
|
String twResponse =ykyyService.GetVasPriceByTypeForJkzl(yktDoctor,1);
|
|
|
com.alibaba.fastjson.JSONObject object = com.alibaba.fastjson.JSONObject.parseObject(twResponse);
|
|
|
if (object.getInteger("code")==10000){
|
|
|
if (object.containsKey("value")){
|
|
|
com.alibaba.fastjson.JSONObject object1 = object.getJSONObject("value");
|
|
|
Integer twPrcie=object1.getInteger("price");
|
|
|
Double twPrcie1 = Double.parseDouble(twPrcie+"");
|
|
|
WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByReqFee(twPrcie1);
|
|
|
if (chargeDictDO==null){
|
|
|
chargeDictDO = new WlyyChargeDictDO();
|
|
|
chargeDictDO.setCreateTime(new Date());
|
|
|
chargeDictDO.setReqFee(twPrcie1);
|
|
|
chargeDictDO.setChargeType(twPrcie+"");
|
|
|
chargeDictDO.setChargeName(twPrcie+"");
|
|
|
chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
|
|
|
}
|
|
|
doctorDO.setTwzxChargeType(chargeDictDO.getChargeType());
|
|
|
if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
|
|
|
if (!doctorDO.getOutpatientType().contains("zj")){
|
|
|
doctorDO.setOutpatientType(doctorDO.getOutpatientType()+",zj");
|
|
|
}
|
|
|
}else {
|
|
|
doctorDO.setOutpatientType("zj");
|
|
|
}
|
|
|
|
|
|
}else {
|
|
|
if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
|
|
|
if (doctorDO.getOutpatientType().contains("zj")){
|
|
|
doctorDO.getOutpatientType().replace(",zj","");
|
|
|
}
|
|
|
}else {
|
|
|
doctorDO.setOutpatientType("zj");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
//视频
|
|
|
String spResponse =ykyyService.GetVasPriceByTypeForJkzl(yktDoctor,3);
|
|
|
com.alibaba.fastjson.JSONObject jsonObject1 = com.alibaba.fastjson.JSONObject.parseObject(spResponse);
|
|
|
if (jsonObject1.getInteger("code")==10000){
|
|
|
if (jsonObject1.containsKey("value")){
|
|
|
com.alibaba.fastjson.JSONObject object1 = jsonObject1.getJSONObject("value");
|
|
|
Integer spPrcie=object1.getInteger("price");
|
|
|
Double spPrcie1 = Double.parseDouble(spPrcie+"");
|
|
|
WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByReqFee(spPrcie1);
|
|
|
if (chargeDictDO==null){
|
|
|
chargeDictDO = new WlyyChargeDictDO();
|
|
|
chargeDictDO.setCreateTime(new Date());
|
|
|
chargeDictDO.setReqFee(spPrcie1);
|
|
|
chargeDictDO.setChargeType(spPrcie+"");
|
|
|
chargeDictDO.setChargeName(spPrcie+"");
|
|
|
chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
|
|
|
}
|
|
|
doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
|
|
|
if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
|
|
|
if (!doctorDO.getOutpatientType().contains("zj")){
|
|
|
doctorDO.setOutpatientType(doctorDO.getOutpatientType()+",zj");
|
|
|
}
|
|
|
}else {
|
|
|
doctorDO.setOutpatientType("zj");
|
|
|
}
|
|
|
}else {
|
|
|
if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())){
|
|
|
if (doctorDO.getOutpatientType().contains("zj")){
|
|
|
doctorDO.getOutpatientType().replace(",zj","");
|
|
|
}
|
|
|
}else{
|
|
|
doctorDO.setOutpatientType("zj");
|
|
|
}
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
baseDoctorDao.save(doctorDO);
|
|
|
}
|
|
|
}
|
|
|
return "ok";
|
|
|
}else {
|
|
|
BaseDoctorDO doctorDO = baseDoctorDao.findByIdcardAndId(idcard);
|
|
|
if (price==-1){
|
|
|
if (doctorDO!=null){
|
|
|
if (type==1){
|
|
|
if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())) {
|
|
|
if (doctorDO.getOutpatientType().contains("zj")) {
|
|
|
doctorDO.getOutpatientType().replace(",zj", "");
|
|
|
}
|
|
|
}else {
|
|
|
doctorDO.setOutpatientType("zj");
|
|
|
}
|
|
|
}else if (type==3){
|
|
|
if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())) {
|
|
|
if (doctorDO.getOutpatientType().contains("zj")) {
|
|
|
doctorDO.getOutpatientType().replace(",zj", "");
|
|
|
}
|
|
|
}else {
|
|
|
doctorDO.setOutpatientType("zj");
|
|
|
}
|
|
|
}
|
|
|
}else {
|
|
|
if (doctorDO==null){
|
|
|
return "找不到医生信息!";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}else {
|
|
|
if (doctorDO!=null){
|
|
|
if (!StringUtils.isNoneBlank(doctorDO.getYktDoctorId())){
|
|
|
String yktDoctor = null;
|
|
|
DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctorDO.getId());
|
|
|
if (doctorMappingDO!=null){
|
|
|
String doctorResponse = ykyyService.getYktDoctor(doctorMappingDO.getMappingCode());
|
|
|
com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(doctorResponse);
|
|
|
if (jsonObject.getInteger("code")==200){
|
|
|
com.alibaba.fastjson.JSONArray array1 = jsonObject.getJSONArray("data");
|
|
|
if (array1!=null&&array1.size()!=0){
|
|
|
yktDoctor=array1.getJSONObject(0).getString("DOCTORUSERID");
|
|
|
}
|
|
|
}
|
|
|
doctorDO.setYktDoctorId(yktDoctor);
|
|
|
}
|
|
|
}
|
|
|
if (type!=null&&type==1) {
|
|
|
Double price1 = Double.parseDouble(price + "");
|
|
|
WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByReqFee(price1);
|
|
|
if (chargeDictDO == null) {
|
|
|
chargeDictDO = new WlyyChargeDictDO();
|
|
|
chargeDictDO.setCreateTime(new Date());
|
|
|
chargeDictDO.setReqFee(price1);
|
|
|
chargeDictDO.setChargeType(price + "");
|
|
|
chargeDictDO.setChargeName(price + "");
|
|
|
chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
|
|
|
}
|
|
|
doctorDO.setTwzxChargeType(chargeDictDO.getChargeType());
|
|
|
if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())) {
|
|
|
if (!doctorDO.getOutpatientType().contains("zj")) {
|
|
|
doctorDO.setOutpatientType(doctorDO.getOutpatientType() + ",zj");
|
|
|
}
|
|
|
}else {
|
|
|
doctorDO.setOutpatientType("zj");
|
|
|
}
|
|
|
}else if (type!=null&&type==3) {
|
|
|
Double price1 = Double.parseDouble(price + "");
|
|
|
WlyyChargeDictDO chargeDictDO = wlyyChargeDictDao.findByReqFee(price1);
|
|
|
if (chargeDictDO == null) {
|
|
|
chargeDictDO = new WlyyChargeDictDO();
|
|
|
chargeDictDO.setCreateTime(new Date());
|
|
|
chargeDictDO.setReqFee(price1);
|
|
|
chargeDictDO.setChargeType(price + "");
|
|
|
chargeDictDO.setChargeName(price + "");
|
|
|
chargeDictDO = wlyyChargeDictDao.save(chargeDictDO);
|
|
|
}
|
|
|
doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
|
|
|
if (StringUtils.isNoneBlank(doctorDO.getOutpatientType())) {
|
|
|
if (!doctorDO.getOutpatientType().contains("zj")) {
|
|
|
doctorDO.setOutpatientType(doctorDO.getOutpatientType() + ",zj");
|
|
|
}
|
|
|
}else {
|
|
|
doctorDO.setOutpatientType("zj");
|
|
|
}
|
|
|
}
|
|
|
baseDoctorDao.save(doctorDO);
|
|
|
return "ok";
|
|
|
}else {
|
|
|
return "找不到医生信息!";
|
|
|
}
|
|
|
}
|
|
|
return "ok";
|
|
|
}
|
|
|
}
|
|
|
|
|
|
}
|