瀏覽代碼

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/entrance/XzzxEntranceService.java
wangzhinan 5 年之前
父節點
當前提交
d0933318bc

+ 8 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/ykyy/service/YkyyService.java

@ -222,6 +222,14 @@ public class YkyyService {
    }
    public String getUserId(String tel){
        String response="";
        String url = yktUrl+"doc_jkzl/get_user_id_by_tel?tel="+tel;
        response = httpClientUtil.get(url,"GBK");
        return response;
    }
    /**
     *获取家庭成员信息
     *

+ 8 - 5
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/MultipleCode/MultipleCoderController.java

@ -6,6 +6,7 @@ import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.service.MultipleCode.MultipleCodeService;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
@ -17,6 +18,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
@ -50,18 +52,19 @@ public class MultipleCoderController extends EnvelopRestEndpoint {
    @Autowired
    private BasePatientWechatDao basePatientWechatDao;
    @Value("${wechat.id}")
    private String wechatId;
    /**
     *  多码融合-获取健康卡
     * @param patientId 居民id
     * @param wechatId 微信id
     * @return
     */
    @GetMapping(value = BaseRequestMapping.ThirdInterface.selectHealthIdCard)
    @ApiOperation(value = "多码融合-获取健康卡")
    public MixEnvelop getE_healthCard(@ApiParam(name = "patientId", value = "居民id")
                               @RequestParam(value = "patientId",required = true) String patientId,
                                      @ApiParam(name = "wechatId", value = "微信id")
                               @RequestParam(value = "wechatId",required = true) String wechatId){
                               @RequestParam(value = "patientId",required = true) String patientId){
        try {
@ -103,8 +106,8 @@ public class MultipleCoderController extends EnvelopRestEndpoint {
//                    无openID
                        return  MixEnvelop.getError("获取注册链接失败",-1);
                    }
            } else {
//                注册成功 返回空
                return MixEnvelop.getSuccess("注册成功",null);
            }

+ 39 - 15
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/MultipleCode/MultipleCodeService.java

@ -8,16 +8,19 @@ import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.ylzinfo.OauthYlzConfigDO;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
import com.yihu.jw.hospital.prescription.dao.OauthYlzConfigDao;
import com.yihu.jw.hospital.ykyy.service.YkyyService;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.wechat.WeiXinMessageReplyUtils;
import com.yihu.jw.utils.StringUtil;
import com.yihu.jw.wechat.dao.BasePatientWechatDao;
import com.yihu.jw.wechat.dao.WechatDao;
import com.ylzinfo.ehc.EhcHandler;
import com.ylzinfo.ehc.common.utils.DateUtils;
import com.ylzinfo.ehc.trans.TransRequest;
import com.ylzinfo.ehc.trans.TransResponse;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
@ -42,18 +45,18 @@ public class MultipleCodeService {
    @Autowired
    private BasePatientWechatDao basePatientWechatDao;
    @Value("${wechat.id}")
    private String wxId;
    @Autowired
    private WechatDao wechatDao;
    @Autowired
    private WlyyHttpLogDao wlyyHttpLogDao;
    @Autowired
    private YkyyService ykyyService;
    public MixEnvelop mcfRegister(BasePatientDO patientDO, String wechatId) throws Exception {
        BasePatientWechatDo patientWechatDo = basePatientWechatDao.findByWechatIdAndPatientId(wechatId, patientDO.getId()).get(0);
        WxWechatDO wechatDO = wechatDao.findById(wxId);
        WxWechatDO wechatDO = wechatDao.findById(wechatId);
        OauthYlzConfigDO oauthYlzConfigDO = oauthYlzConfigDao.findOne("mcf_config");
        TransResponse re= new TransResponse();
        try {
@ -97,7 +100,7 @@ public class MultipleCodeService {
    }
//     根据openId、 accountId查询三码融合码信息
    public MixEnvelop mcfOpenquery(String patientId,String wechatId) throws Exception {
        WxWechatDO wechatDO = wechatDao.findByAppId(wxId);
        WxWechatDO wechatDO = wechatDao.findByAppId(wechatId);
        BasePatientDO patientDO = basePatientDao.findById(patientId);
        if (patientDO!=null){
            BasePatientWechatDo patientWechatDo = basePatientWechatDao.findByWechatIdAndPatientId(wechatId, patientDO.getId()).get(0);
@ -118,7 +121,7 @@ public class MultipleCodeService {
                EhcHandler ehcHandler = new EhcHandler(oauthYlzConfigDO.getUrl()+"ehcService/gateway.do", oauthYlzConfigDO.getAppId(), oauthYlzConfigDO.getTermId(), oauthYlzConfigDO.getAppKey());
                TransResponse re = ehcHandler.execute(request);
                JSONObject jsonObject = new JSONObject();
                if ((JSONObject.parseObject(re.getRet_code()).toJSONString()).equalsIgnoreCase("0000")){
                if (re.getRet_code().equalsIgnoreCase("0000")){
                    patientDO.setRegister("1");
                    String idCard = JSONObject.parseObject(re.getBiz_content()).getString("id_no");
                    if (idCard!=null)
@ -223,39 +226,42 @@ public class MultipleCodeService {
        TransResponse re = ehcHandler.execute(request);
        JSONObject jsonObject = new JSONObject();
        if (re.getRet_code().equalsIgnoreCase("0000")){
            JSONObject object = JSONObject.parseObject(re.getBiz_content());
            patientDO.setRegister("1");
            String idCard = JSONObject.parseObject(re.getBiz_content()).getString("id_no");
            String idCard =object.getString("id_no");
            if (idCard!=null)
            {
                patientDO.setIdcard(idCard);
            }
            String userName = JSONObject.parseObject(re.getBiz_content()).getString("user_name");
            String userName = object.getString("user_name");
            if (userName!=null)
            {
                patientDO.setName(userName);
            }
            String userSex = JSONObject.parseObject(re.getBiz_content()).getString("user_sex");
            String userSex = object.getString("user_sex");
            if (userSex!=null){
                patientDO.setSex(Integer.valueOf(userName));
                patientDO.setSex(Integer.valueOf(userSex));
            }
            String mobilePhone = JSONObject.parseObject(re.getBiz_content()).getString("mobile_phone");
            String mobilePhone = object.getString("mobile_phone");
            if (mobilePhone!=null){
                patientDO.setMobile(mobilePhone);
            }
            String birthday = JSONObject.parseObject(re.getBiz_content()).getString("birthday");
            String birthday = object.getString("birthday");
            if (birthday!=null){
                patientDO.setBirthday(DateUtil.strToDate(birthday));
            }
            String telephone = JSONObject.parseObject(re.getBiz_content()).getString("telephone");
            String telephone = object.getString("telephone");
            if (telephone!=null){
                patientDO.setPhone(telephone);
            }
            String address = JSONObject.parseObject(re.getBiz_content()).getString("address");
            String address = object.getString("address");
            if (address!=null){
                patientDO.setAddress(address);
            }
            basePatientDao.save(patientDO);
            jsonObject.put("register","1");
            jsonObject.put("register",patientDO.getRegister());
            String cardType = object.getString("card_type");
            String cardNo =object.getString("card_no");
            String ehealthCardId = JSONObject.parseObject(re.getBiz_content()).getString("ehealth_card_id");
            WlyyHttpLogDO logDO = new WlyyHttpLogDO();
            logDO.setCode("ehc.ehealthcard.getCodeUr");
@ -271,6 +277,24 @@ public class MultipleCodeService {
                jsonObject.put("codeUrl",codeUrl);
                return codeUrl;
            }
            if (cardType.equalsIgnoreCase("01")){
                if (StringUtils.isNoneBlank(patientDO.getUserId())){
                    String patientId = patientDO.getId();
                    String userId = patientDO.getUserId();
                    ykyyService.addYkCard(patientId,cardNo,userId,"0");
                }else {
                    String mobile = patientDO.getMobile();
                    String response = ykyyService.getUserId(mobile);
                    JSONObject jsonObject1 = JSONObject.parseObject(response);
                    String userId = "";
                    String patientId = patientDO.getId();
                    if (jsonObject1.getString("code").equalsIgnoreCase("200")){
                        JSONObject data = jsonObject1.getJSONObject("data");
                        userId = data.getString("USER_ID");
                    }
                    ykyyService.addYkCard(patientId,cardNo,userId,"0");
                }
            }
        }