浏览代码

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

wangjun 3 年之前
父节点
当前提交
35dc2e2968

+ 6 - 6
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/TasyNatService.java

@ -545,9 +545,9 @@ public class TasyNatService {
            key.put("key5",key5);
            key.put("remark",remark);
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("tempateId",wxTemplateConfigDO1.getTemplateId());//
            jsonObject.put("template_id",wxTemplateConfigDO1.getTemplateId());//
            jsonObject.put("data",key);
            jsonObject.put("openId",openId);
            jsonObject.put("touser",openId);
            jsonObject.put("url",url);
            logger.info("核酸检测支付成功模板消息推送param"+jsonObject.toString());
            String tmResilt= tmpPush(jsonObject);
@ -583,9 +583,9 @@ public class TasyNatService {
            key.put("key5",key5);
            key.put("remark",remark);
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("tempateId",wxTemplateConfigDO1.getTemplateId());//
            jsonObject.put("template_id",wxTemplateConfigDO1.getTemplateId());//
            jsonObject.put("data",key);
            jsonObject.put("openId",openId);
            jsonObject.put("touser",openId);
            jsonObject.put("url",url);
            logger.info("核酸检测支付提醒模板消息推送param"+jsonObject.toString());
            String tmResilt= tmpPush(jsonObject);
@ -618,9 +618,9 @@ public class TasyNatService {
            key.put("key4",key4);
            key.put("remark",remark);
            JSONObject jsonObject = new JSONObject();
            jsonObject.put("tempateId",wxTemplateConfigDO1.getTemplateId());//
            jsonObject.put("template_id",wxTemplateConfigDO1.getTemplateId());//
            jsonObject.put("data",key);
            jsonObject.put("openId",openId);
            jsonObject.put("touser",openId);
            jsonObject.put("url",url);
            logger.info("核酸检测预约成功模板消息推送param"+jsonObject.toString());
            String tmResilt= tmpPush(jsonObject);

+ 3 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java

@ -1298,12 +1298,15 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
            BasePatientDO patientDO = oauthWjwConfigService.savePatient(result);
            logger.info("授权进来1");
            if(patientDO == null){
                return ObjEnvelop.getError("授权登录失败!");
            }
            logger.info("授权进来2");
            ClientDetails authenticatedClient = clientDetailsService.loadClientByClientId(client_id);
            logger.info("授权进来3");
            Map<String, String> parameters = new HashedMap();
            parameters.put("username",patientDO.getIdcard());

+ 25 - 1
server/svr-authentication/src/main/java/com/yihu/jw/security/service/OauthWjwConfigService.java

@ -3,9 +3,12 @@ package com.yihu.jw.security.service;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.entity.hospital.family.WlyyPatientFamilyMemberDO;
import com.yihu.jw.security.dao.patient.BasePatientDao;
import com.yihu.jw.security.dao.patient.BasePatientWechatDao;
import com.yihu.jw.security.dao.patient.WlyyPatientFamilyMemberDao;
import com.yihu.jw.security.model.PatientWechat;
import com.yihu.jw.security.utils.AES;
import com.yihu.jw.security.utils.IdCardUtil;
import com.yihu.utils.security.MD5;
@ -20,9 +23,12 @@ import org.springframework.transaction.annotation.Transactional;
import java.net.URLDecoder;
import java.util.Date;
import java.util.List;
import java.util.UUID;
import org.springframework.util.Base64Utils;
import javax.sound.midi.MidiDevice;
/**
 * Created by Trick on 2020/2/24.
 */
@ -36,6 +42,8 @@ public class OauthWjwConfigService {
    private BasePatientDao basePatientDao;
    @Autowired
    private WlyyPatientFamilyMemberDao familyMemberDao;
    @Autowired
    private BasePatientWechatDao basePatientWechatDao;
    public BasePatientDO savePatient(String data)throws Exception{
        logger.info("savePatient :"+data);
@ -52,6 +60,7 @@ public class OauthWjwConfigService {
            String userSex = info.getString("userSex");
            String userIdNo = info.getString("userIdNo");
            String dType = info.getString("dType");
            String openId = info.getString("openid");
            if(StringUtils.isNotBlank(userIdNo)){
@ -84,6 +93,7 @@ public class OauthWjwConfigService {
                String pw = userIdNo.substring(userIdNo.length()-6);
                patient.setIdcard(userIdNo);
                patient.setCardType("01");
                patient.setName(name);
                patient.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
                patient.setSalt(salt);
@ -112,8 +122,22 @@ public class OauthWjwConfigService {
                    basePatientFamilyMemberDO.setFamilyMember(patient.getId());
                    familyMemberDao.save(basePatientFamilyMemberDO);
                }
                List<BasePatientWechatDo> patientWechatDos = basePatientWechatDao.findByWechatIdAndPatientId("xm_tasy_wx",patient.getId());
                if (patientWechatDos!=null&&patientWechatDos.size()!=0){
                    BasePatientWechatDo basePatientWechatDo = patientWechatDos.get(0);
                    basePatientWechatDo.setOpenid(openId);
                }else {
                    BasePatientWechatDo patientWechatDo = new BasePatientWechatDo();
                    patientWechatDo.setOpenid(openId);
                    patientWechatDo.setCreateTime(new Date());
                    patientWechatDo.setPatientId(patient.getId());
                    patientWechatDo.setWechatId("xm_tasy_wx");
                    patientWechatDo.setSaasId("prod");
                    basePatientWechatDao.save(patientWechatDo);
                }
                return basePatientDO;
                return patient;
            }
            return null;