Sfoglia il codice sorgente

Merge branch 'dev' of wangjun/wlyy2.0 into dev

humingfen 4 anni fa
parent
commit
d00bd64a34

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

@ -75,7 +75,7 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
        BasePatientMemberDictDO basePatientMemberDictDO = basePatientMemberDictDao.findOne(dictId);
        BasePatientMemberDictDO basePatientMemberDictDO = basePatientMemberDictDao.findOne(dictId);
        BasePatientDO basePatientDO = basePatientDao.findByIdcard(idCard);
        BasePatientDO basePatientDO = basePatientDao.findByIdcard(idCard);
        List<BasePatientDO> list = basePatientDao.findByMobile(phoneNum);
        List<BasePatientDO> list = basePatientDao.findByMobile(phoneNum);
        if (!"xm_zsyy_wx".equalsIgnoreCase(wxId)){
        if ("xm_xzzx_wx".equalsIgnoreCase(wxId)){
            if (list!=null&&list.size()>0&&basePatientDO!=null){
            if (list!=null&&list.size()>0&&basePatientDO!=null){
                if (basePatientDO.getMobile().equalsIgnoreCase(phoneNum)){
                if (basePatientDO.getMobile().equalsIgnoreCase(phoneNum)){
@ -343,6 +343,8 @@ public class WlyyFamilyMemberService extends BaseJpaService<WlyyPatientFamilyMem
                //patientMedicareCardDO.setType(medicareType);
                //patientMedicareCardDO.setType(medicareType);
                patientMedicareCardDO.setPatientCode(patientNewId);
                patientMedicareCardDO.setPatientCode(patientNewId);
                patientMedicareCardDO.setDel("1");
                patientMedicareCardDO.setDel("1");
                patientMedicareCardDO.setParentType("A");
                patientMedicareCardDO.setType("A_01");
                basePatientMedicareCardDao.save(patientMedicareCardDO);
                basePatientMedicareCardDao.save(patientMedicareCardDO);
            }
            }

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

@ -10465,7 +10465,7 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        return null;
        return null;
    }
    }
    public Map saveNatAppointment(String mediaCard,String patientId,String name,String cardNo,String cardType,String mobile,
    public Map saveNatAppointment(String mediaCard,String patientId,String name,String cardNo,String cardType,String mobile,
                                   String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName,String pm,String pushChannel,String pushFlag,String cardNoType) throws Exception {
                                   String firstJobCode,String firstJobName,String secondJobCode,String secondJobName,String natTime,String address,String provinceName,String cityName,String townName,String streetName,String pm,String pushChannel,String pushFlag,String cardNoType,String consumer) throws Exception {
        Map returnMap = new HashMap();
        Map returnMap = new HashMap();
        if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
        if (wechatId.equalsIgnoreCase("xm_zsyy_wx")){
            net.sf.json.JSONObject jsondate = new JSONObject();
            net.sf.json.JSONObject jsondate = new JSONObject();
@ -10697,11 +10697,14 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            baseNatAppointmentDO.setDeptName("感染疾病科");
            baseNatAppointmentDO.setDeptName("感染疾病科");
            baseNatAppointmentDO.setAmpm(pm);
            baseNatAppointmentDO.setAmpm(pm);
            baseNatAppointmentDO.setHospitalFlag(pushFlag);
            baseNatAppointmentDO.setHospitalFlag(pushFlag);
            baseNatAppointmentDO.setConsumer(consumer);
            BasePatientDO basePatientDO = basePatientDao.findById(consumer);
            baseNatAppointmentDO.setConsumerName(basePatientDO.getName());
            baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
            baseNatAppointmentDO= baseNatAppointmentDao.save(baseNatAppointmentDO);
            //添加订单
            //添加订单
            BusinessOrderDO businessDO = new BusinessOrderDO();
            BusinessOrderDO businessDO = new BusinessOrderDO();
            businessDO.setPatient(patientId);
            businessDO.setPatientName(name);
            businessDO.setPatient(consumer);
            businessDO.setPatientName(basePatientDO.getName());
            businessDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
            businessDO.setOrderNo("HLWYY"+System.currentTimeMillis()+(int)(Math.random()*900)+100);
            businessDO.setCreateTime(new Date());
            businessDO.setCreateTime(new Date());
            businessDO.setStatus(0);
            businessDO.setStatus(0);
@ -10715,6 +10718,9 @@ 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("建档开始");
            com.alibaba.fastjson.JSONObject jdObject = ykyyEntranceService.patientJDKH(patientId, cardNo,name,mobile,mediaCard);
            logger.info("建档结束");
            logger.info("更新建档信息");
            logger.info("更新建档信息");
            BaseJobCategoryDO jobCategoryDO =jobCategoryDao.findByName(firstJobName);
            BaseJobCategoryDO jobCategoryDO =jobCategoryDao.findByName(firstJobName);
            Float zy= 0f;
            Float zy= 0f;
@ -10829,11 +10835,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
        if (patientDO != null) {
        if (patientDO != null) {
            userName = patientDO.getName();
            userName = patientDO.getName();
        }
        }
        if (StringUtils.isNotEmpty(baseNatAppointmentDO.getPatientId())){
            ps = basePatientWechatDao.findByWechatIdAndPatientId(wechatId, baseNatAppointmentDO.getPatientId());
        if (StringUtils.isNotEmpty(baseNatAppointmentDO.getConsumer())){
            ps = basePatientWechatDao.findByWechatIdAndPatientId(wechatId, baseNatAppointmentDO.getConsumer());
        }
        }
        if (ps.isEmpty()) {
        if (ps.isEmpty()) {
            logger.info("该用户没有openid,无法推送模版消息,用户ID:" + baseNatAppointmentDO.getPatientId() + "wechatId:" + wechatId);
            logger.info("该用户没有openid,无法推送模版消息,用户ID:" + baseNatAppointmentDO.getConsumer() + "wechatId:" + wechatId);
        }
        }
        Map<String,Object> map = ykyyEntranceService.findYkDoctor(baseNatAppointmentDO.getHospitalFlag());
        Map<String,Object> map = ykyyEntranceService.findYkDoctor(baseNatAppointmentDO.getHospitalFlag());
        WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
        WxAccessTokenDO wxAccessTokenDO = wxAccessTokenService.getWxAccessTokenById(wechatId);
@ -10924,10 +10930,11 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "t.dept_name as \"deptName\","+
                "t.dept_name as \"deptName\","+
                "t.id as \"id\"," +
                "t.id as \"id\"," +
                "t.card_no_type as \"cardNoType\"," +
                "t.card_no_type as \"cardNoType\"," +
                "t.HOSPITAL_FLAG as \"hospitalFlag\"," +
                "t.appointment_time as \"appointmentTime\" " +
                "t.appointment_time as \"appointmentTime\" " +
                " from base_nat_appointment t where 1=1 ";
                " from base_nat_appointment t where 1=1 ";
        if (StringUtils.isNoneBlank(patientId)){
        if (StringUtils.isNoneBlank(patientId)){
            sql+=" and t.patient_id ='"+patientId+"'";
            sql+=" and t.consumer ='"+patientId+"'";
        }
        }
        if (StringUtils.isNoneBlank(id)){
        if (StringUtils.isNoneBlank(id)){
            sql+=" and t.id ='"+id+"'";
            sql+=" and t.id ='"+id+"'";

+ 8 - 1
business/base-service/src/main/java/com/yihu/jw/order/BusinessOrderService.java

@ -451,6 +451,13 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
    public Map<String,Object> selectOrderByRelationCode(String relationCode,String tradeType,String wechatId,boolean payFlag,String appletCode) throws Exception {
    public Map<String,Object> selectOrderByRelationCode(String relationCode,String tradeType,String wechatId,boolean payFlag,String appletCode) throws Exception {
        WxWechatDO wxWechatDO = wechatDao.findById(wechatId);
        WxWechatDO wxWechatDO = wechatDao.findById(wechatId);
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(relationCode);
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(relationCode);
        BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(Integer.parseInt(relationCode));
        if (baseNatAppointmentDO!=null&&"-1".equalsIgnoreCase(baseNatAppointmentDO.getIsSuccess())){
            throw new Exception("订单已取消");
        }
        if (businessOrderDO!=null&&businessOrderDO.getStatus()==1){
            throw new Exception("订单已支付");
        }
        String body = businessOrderDO.getDescription();
        String body = businessOrderDO.getDescription();
        String totalFee = businessOrderDO.getPayPrice().intValue()+"";
        String totalFee = businessOrderDO.getPayPrice().intValue()+"";
        String patient = businessOrderDO.getPatient();
        String patient = businessOrderDO.getPatient();
@ -916,7 +923,7 @@ public class BusinessOrderService extends BaseJpaService<BusinessOrderDO,Busines
                    }
                    }
                }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("12")){
                }else if (businessOrderDO!=null&&businessOrderDO.getOrderCategory().equalsIgnoreCase("6")){
                    String price = Integer.parseInt(totalFee)/100+"";
                    String price = Integer.parseInt(totalFee)/100+"";
                    BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(Integer.parseInt(businessOrderDO.getRelationCode()));
                    BaseNatAppointmentDO baseNatAppointmentDO = baseNatAppointmentDao.findOne(Integer.parseInt(businessOrderDO.getRelationCode()));
                    baseNatAppointmentDO.setPayStatus("1");
                    baseNatAppointmentDO.setPayStatus("1");

+ 17 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/hospital/prescription/BaseNatAppointmentDO.java

@ -57,7 +57,16 @@ public class BaseNatAppointmentDO extends IntegerIdentityEntity {
    private String ampm;
    private String ampm;
    private String cardNoType;
    private String cardNoType;
    private String hospitalFlag;
    private String hospitalFlag;
    private String consumer;
    private String consumerName;
    public String getConsumer() {
        return consumer;
    }
    public void setConsumer(String consumer) {
        this.consumer = consumer;
    }
    public String getMedicare() {
    public String getMedicare() {
        return medicare;
        return medicare;
@ -427,4 +436,12 @@ public class BaseNatAppointmentDO extends IntegerIdentityEntity {
    public void setHospitalFlag(String hospitalFlag) {
    public void setHospitalFlag(String hospitalFlag) {
        this.hospitalFlag = hospitalFlag;
        this.hospitalFlag = hospitalFlag;
    }
    }
    public String getConsumerName() {
        return consumerName;
    }
    public void setConsumerName(String consumerName) {
        this.consumerName = consumerName;
    }
}
}

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

@ -102,7 +102,7 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
        }*/
        }*/
        net.sf.json.JSONArray jsonArray = new JSONArray();
        net.sf.json.JSONArray jsonArray = new JSONArray();
        if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
        if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
            jsonArray = ykyyEntranceService.findHisPatientBymMedicare(medicare,clinicId,false);
            /*jsonArray = ykyyEntranceService.findHisPatientBymMedicare(medicare,clinicId,false);
            if(jsonArray!=null&&jsonArray.size()>0){
            if(jsonArray!=null&&jsonArray.size()>0){
                net.sf.json.JSONObject jsonObject= net.sf.json.JSONObject.fromObject(jsonArray.get(0).toString());
                net.sf.json.JSONObject jsonObject= net.sf.json.JSONObject.fromObject(jsonArray.get(0).toString());
                if (null!=jsonObject.get("brid")){
                if (null!=jsonObject.get("brid")){
@ -122,7 +122,7 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
                mixEnvelop.setStatus(408);
                mixEnvelop.setStatus(408);
                mixEnvelop.setMessage("您所添加的家属无就诊记录无法添加");
                mixEnvelop.setMessage("您所添加的家属无就诊记录无法添加");
                return mixEnvelop;
                return mixEnvelop;
            }
            }*/
        }else if ("xm_zsyy_wx".equalsIgnoreCase(wxId)){
        }else if ("xm_zsyy_wx".equalsIgnoreCase(wxId)){
            jsonArray = entranceService.BS10008(idCard, "", "", "", "", "", false);
            jsonArray = entranceService.BS10008(idCard, "", "", "", "", "", false);
            if(jsonArray!=null&&jsonArray.size()>0){
            if(jsonArray!=null&&jsonArray.size()>0){
@ -195,20 +195,14 @@ public class WlyyFamilyMemberController extends EnvelopRestEndpoint {
            if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
            if("xm_ykyy_wx".equalsIgnoreCase(wxId)){
                System.out.println("发送眼科验证码开始");
                System.out.println("发送眼科验证码开始");
                ResultMsg result= null;
                ResultMsg result= null;
                if (null!=jsonArray&&jsonArray.size() > 0) {
                    result = ykyySMSService.ykyySendSMS(phoneNum, "您好,您的此次操作的验证码是:" + captcha + ",2分钟内有效。如非本人操作,请忽略");
                    if (result.isSuccess()){
                        this.store(client_id, phoneNum, captcha, 120);
                        mixEnvelop.setMessage("验证码发送成功");
                    } else {
                        mixEnvelop.setMessage("验证码发送失败");
                        mixEnvelop.setStatus(500);
                    }
                }else {
                    mixEnvelop.setStatus(408);
                    mixEnvelop.setMessage("您所添加的家属无就诊记录,无法发送验证码");
                result = ykyySMSService.ykyySendSMS(phoneNum, "您好,您的此次操作的验证码是:" + captcha + ",2分钟内有效。如非本人操作,请忽略");
                if (result.isSuccess()){
                    this.store(client_id, phoneNum, captcha, 120);
                    mixEnvelop.setMessage("验证码发送成功");
                } else {
                    mixEnvelop.setMessage("验证码发送失败");
                    mixEnvelop.setStatus(500);
                }
                }
            }else if("xm_zsyy_wx".equalsIgnoreCase(wxId)){
            }else if("xm_zsyy_wx".equalsIgnoreCase(wxId)){
                System.out.println("发送中山验证码开始");
                System.out.println("发送中山验证码开始");
                int result = 1;
                int result = 1;

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

@ -10,6 +10,7 @@ import com.yihu.jw.entity.base.dict.DictHospitalDeptDO;
import com.yihu.jw.entity.base.dict.DictJobTitleDO;
import com.yihu.jw.entity.base.dict.DictJobTitleDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.base.wx.WxWechatDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleUserDO;
import com.yihu.jw.entity.hospital.article.KnowledgeArticleUserDO;
@ -185,6 +186,8 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
    private BaseNatAppointmentDao baseNatAppointmentDao;
    private BaseNatAppointmentDao baseNatAppointmentDao;
    @Autowired
    @Autowired
    private YkyySMSService ykyySMSService;
    private YkyySMSService ykyySMSService;
    @Autowired
    private BasePatientWechatDao basePatientWechatDao;
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorByHospitalAndDiseaseAndDept)
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.findDoctorByHospitalAndDiseaseAndDept)
    @ApiOperation(value = "根据疾病名称,热门部门查询医生", notes = "根据疾病名称,热门部门查询医生")
    @ApiOperation(value = "根据疾病名称,热门部门查询医生", notes = "根据疾病名称,热门部门查询医生")
@ -405,7 +408,7 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
     */
     */
    @RequestMapping(value = "/getOpenidByCode", method = {RequestMethod.POST, RequestMethod.GET})
    @RequestMapping(value = "/getOpenidByCode", method = {RequestMethod.POST, RequestMethod.GET})
    @ResponseBody
    @ResponseBody
    public Envelop getOpenidByCode(String code) throws Exception {
    public Envelop getOpenidByCode(String code,@RequestParam(value = "patientId", required = false)String patientId) throws Exception {
        //通过redis获取openid, 获取不到,则调用微信接口去取
        //通过redis获取openid, 获取不到,则调用微信接口去取
        String key = wxId+":code";
        String key = wxId+":code";
        String openid = redisTemplate.opsForValue().get(key);
        String openid = redisTemplate.opsForValue().get(key);
@ -413,6 +416,23 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
            return success(PatientRequestMapping.Wechat.api_success,openid);
            return success(PatientRequestMapping.Wechat.api_success,openid);
        }
        }
        openid = wechatInfoService.getOpenidByCode(code, wxId);
        openid = wechatInfoService.getOpenidByCode(code, wxId);
        if (!StringUtils.isEmpty(patientId)){
            List<BasePatientWechatDo> list = basePatientWechatDao.findByWechatIdAndPatientId(wxId,patientId);
            if (list!=null&&list.size()>0){
                for (BasePatientWechatDo basePatientWechatDo:list){
                    basePatientWechatDo.setOpenid(openid);
                    basePatientWechatDao.save(basePatientWechatDo);
                }
            }else {
                BasePatientWechatDo basePatientWechatDo = new BasePatientWechatDo();
                basePatientWechatDo.setPatientId(patientId);
                basePatientWechatDo.setWechatId(wxId);
                basePatientWechatDo.setCreateTime(new Date());
                basePatientWechatDo.setOpenid(openid);
                basePatientWechatDao.save(basePatientWechatDo);
            }
        }
        redisTemplate.opsForValue().set(key,openid);
        redisTemplate.opsForValue().set(key,openid);
        redisTemplate.expire(key,10, TimeUnit.SECONDS);
        redisTemplate.expire(key,10, TimeUnit.SECONDS);
        return success(PatientRequestMapping.Wechat.api_success,openid);
        return success(PatientRequestMapping.Wechat.api_success,openid);

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

@ -2592,7 +2592,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                      @ApiParam(name = "cardNoType", value = "cardNoType")
                                      @ApiParam(name = "cardNoType", value = "cardNoType")
                                          @RequestParam(value = "cardNoType",required = false)String cardNoType){
                                          @RequestParam(value = "cardNoType",required = false)String cardNoType){
        try {
        try {
            return success(prescriptionService.saveNatAppointment(mediaCard,patientId,name,cardNo,cardType,mobile,firstJobCode,firstJobName,secondJobCode,secondJobName,natTime,address,provinceName,cityName,townName,streetName,pm,pushChannel,pushFlag,cardNoType));
            return success(prescriptionService.saveNatAppointment(mediaCard,patientId,name,cardNo,cardType,mobile,firstJobCode,firstJobName,secondJobCode,secondJobName,natTime,address,provinceName,cityName,townName,streetName,pm,pushChannel,pushFlag,cardNoType,getUID()));
        } catch (Exception e) {
        } catch (Exception e) {
            return Envelop.getError(e.getMessage());
            return Envelop.getError(e.getMessage());
        }
        }