Browse Source

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

wangjun 4 years ago
parent
commit
ac52289454

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

@ -9457,106 +9457,178 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            for (BaseDoctorDO doctorDO:doctorDOList){
                String yktDoctor = null;
                DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctorDO.getId());
                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 (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);
                    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");
                                }
                            }
                            doctorDO.setTwzxChargeType(chargeDictDO.getChargeType());
                        }
                    }
                    //视频
                    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);
                        //视频
                        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");
                                }
                            }
                            doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
                        }
                    }
                    baseDoctorDao.save(doctorDO);
                }
                baseDoctorDao.save(doctorDO);
            }
            return "ok";
        }else {
            BaseDoctorDO doctorDO = baseDoctorDao.findByIdcardAndId(idcard);
            if (doctorDO!=null){
                if (!StringUtils.isNoneBlank(doctorDO.getYktDoctorId())){
                    String yktDoctor = null;
                    DoctorMappingDO doctorMappingDO = doctorMappingDao.findByDoctor(doctorDO.getId());
                    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 (price==-1){
                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");
                    }
                    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);
            }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);
                        }
                    }
                    doctorDO.setTwzxChargeType(chargeDictDO.getChargeType());
                }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);
                    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");
                        }
                    }
                    doctorDO.setSpzxChargeType(chargeDictDO.getChargeType());
                    baseDoctorDao.save(doctorDO);
                    return "ok";
                }else {
                    return "找不到医生信息!";
                }
                baseDoctorDao.save(doctorDO);
                return "ok";
            }else {
                return "找不到医生信息!";
            }
            return "ok";
        }
    }

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

@ -1130,19 +1130,16 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    @PostMapping(value = BaseHospitalRequestMapping.PatientNoLogin.synYktZxPrice)
    @ApiOperation(value = "同步眼科通医生价格", notes = "同步眼科通医生价格")
    public ObjEnvelop synYktZxPrice(@ApiParam(name = "doctorId", value = "医生id")
                                         @RequestParam(value = "doctorId", required = false)String doctorId,
    public Envelop synYktZxPrice(@ApiParam(name = "idcard", value = "医生身份证")
                                         @RequestParam(value = "idcard", required = false)String idcard,
                                         @ApiParam(name = "price", value = "价格")
                                         @RequestParam(value = "price", required = false)Integer price,
                                    @ApiParam(name = "type", value = "类型")
                                        @RequestParam(value = "type", required = false)Integer type,
                                    @ApiParam(name = "flag", value = "同步所有医生价格")
                                        @RequestParam(value = "flag", required = false)String flag) throws Exception{
        String object = prescriptionService.synYktZxPrice(doctorId,price,type,flag);
        ObjEnvelop objEnvelop = new ObjEnvelop();
        objEnvelop.setMessage(object);
        objEnvelop.setStatus(200);
        return success(objEnvelop);
        String object = prescriptionService.synYktZxPrice(idcard,price,type,flag);
        return success(object);
    }
}