Browse Source

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

Conflicts:
	patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/WechatController.java
8 years ago
parent
commit
54fad72d1c

+ 10 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/education/HealthEduArticle.java

@ -28,6 +28,8 @@ public class HealthEduArticle extends IdEntity {
	private String title;
	// 文章链接
	private String url;
	// 简介
	private String summary;
	// 文章内容
	private String content;
	// 发布时间
@ -67,6 +69,14 @@ public class HealthEduArticle extends IdEntity {
		this.url = url;
	}
	public String getSummary() {
		return summary;
	}
	public void setSummary(String summary) {
		this.summary = summary;
	}
	public String getContent() {
		return content;
	}

+ 10 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/entity/education/HealthEduArticlePatient.java

@ -45,6 +45,8 @@ public class HealthEduArticlePatient extends IdEntity {
	private Integer signType;
	// 行政团队
	private Long adminTeamCode;
	// 简介
	private String summary;
	public String getPatient() {
		return patient;
@ -135,4 +137,12 @@ public class HealthEduArticlePatient extends IdEntity {
	public void setAdminTeamCode(Long adminTeamCode) {
		this.adminTeamCode = adminTeamCode;
	}
	public String getSummary() {
		return summary;
	}
	public void setSummary(String summary) {
		this.summary = summary;
	}
}

+ 1 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientHealthGuidanceDao.java

@ -55,6 +55,6 @@ public interface PatientHealthGuidanceDao extends PagingAndSortingRepository<Pat
	@Query("SELECT count(a) from PatientHealthGuidance a WHERE  a.patient=?2 and a.doctor=?1 ")
	Integer findbydoctorAndPatient(String doctor, String patientCode);
	@Query("select b.name, b.photo, a.id, a.content, a.czrq,b.level,b.code,a.adminTeamCode from PatientHealthGuidance a, Doctor b where a.doctor = b.code and a.patient = ?1 and a.adminTeamCode = ?2 and a.del = '1'")
	@Query("select b.name, b.photo, a.id, substring(a.content, 1, 50) as content, a.czrq,b.level,b.code,a.adminTeamCode from PatientHealthGuidance a, Doctor b where a.doctor = b.code and a.patient = ?1 and a.adminTeamCode = ?2 and a.del = '1'")
	Page<Object> findByPatientAndTeamCode(String patient, Long teamCode, Pageable pageable);
}

+ 3 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientReservationDao.java

@ -34,4 +34,7 @@ public interface PatientReservationDao extends PagingAndSortingRepository<Patien
	@Query(value = "select a.* from wlyy_patient_reservation a where a.patient = ?1 and a.canceler=?2 and a.canceler_time>?3 and a.status ='0' order by a.canceler_time DESC limit 1",nativeQuery = true)
	PatientReservation findByPatientAndCancelerAndCancelTime(String patient,String canceler,String cancelerTime);
	//根据患者医获取近三个月的已取消的预约记录
	@Query("select a from PatientReservation a where a.patient = ?1 and a.startTime between ?2 and ?3 and a.status = 0 order by a.czrq desc")
	List<PatientReservation> findByPatientAndStartTime(String patientCode, String strStart, String strEnd);
}

+ 1 - 1
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticleDoctorService.java

@ -101,7 +101,7 @@ public class HealthEduArticleDoctorService extends BaseService {
		}
		List<Object> params = new ArrayList<Object>();
		StringBuffer sql = new StringBuffer();
		sql.append("select a.id,a.article,a.doctor,a.title,a.url,a.czrq,b.content,b.keyword");
		sql.append("select a.id,a.article,a.doctor,a.title,a.url,a.czrq,b.summary content,b.keyword");
		sql.append(",(select count(1) from wlyy_health_edu_article_op_history c where c.code = a.article and c.status = 1) as readAmount");
		sql.append(",(select count(1) from wlyy_health_edu_article_op_history c where c.code = a.article and c.status = 2) as collectionAmount");
		sql.append(",(select count(1) from wlyy_health_edu_article_op_history c where c.code = a.article and c.status = 3) as repeatAmount");

+ 19 - 14
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticleService.java

@ -42,12 +42,13 @@ public class HealthEduArticleService extends BaseService {
    /**
     * 保存福州健康教育文章
     *
     * @param result xml格式
     * @return
     * @throws Exception
     */
    public int saveHealthEduArticles(String result) throws Exception {
        List<Map<String,String>> listmap= Xml2ListMap.xml2List(result);
        List<Map<String, String>> listmap = Xml2ListMap.xml2List(result);
        String code = null;
        String title = null;
        String imgUrl = null;
@ -55,13 +56,13 @@ public class HealthEduArticleService extends BaseService {
        String keyWord = null;
        String type = null;
        int rows = 0;
        for(Map<String,String> temp : listmap){
        for (Map<String, String> temp : listmap) {
            code = temp.get("xml.Result.MessageId");
            title = temp.get("xml.Result.MessageTitle");
            imgUrl = temp.get("xml.Result.ImageUrlSmall");
            content = temp.get("xml.Result.MessageContent");
            keyWord = temp.get("xml.Result.MessageType");
            switch (keyWord){
            switch (keyWord) {
                case "1":
                    keyWord = "高血压";
                    type = "2";
@ -101,15 +102,19 @@ public class HealthEduArticleService extends BaseService {
            }
            String sql = "INSERT INTO wlyy_health_edu_article  " +
                    "VALUES(NULL,?,?,?,?,NULL,?,?)";
            rows = jdbcTemplate.update(sql,code,title,imgUrl,content,keyWord,type);
            rows+=rows;
                    "VALUES(NULL,?,?,?,?,?,NULL,?,?)";
            String summary = content.replaceAll("</?[^>]+>", "")
                    .replaceAll("<a>\\s*|\t|\r|\n</a>", "")
                    .replaceAll("&nbsp;", "").replaceAll(" ", "");
            rows = jdbcTemplate.update(sql, code, title, summary, imgUrl, content, keyWord, type);
            rows += rows;
        }
        return rows;
    }
    /**
     * 由请求参数获取福州健康教育文章
     *
     * @param params
     * @return
     * @throws Exception
@ -120,19 +125,19 @@ public class HealthEduArticleService extends BaseService {
//      获取远程地址url 、App Key 和 App secret  
        String prixUrl = SystemConf.getInstance().getYihuOpenPlatformUrl();
//        String prixUrl ="http://apitest.yihu.com.cn/OpenPlatform/cgiBin/1.0/";
        String appId =SystemConf.getInstance().getYihuOpenPlatformAppId();
        String appId = SystemConf.getInstance().getYihuOpenPlatformAppId();
//        String appId = "9000276";
        String secret = SystemConf.getInstance().getYihuOpenPlatformSecret();
//        String secret = "OKC8BS1KGXTDE9GPP1EO4VYLUXF8DJ7QUP72H613ZXA";
//      请求参数(i健康接口说明文档)正式接口 由prixUrl获取apixUrl
        String apiUrl = prixUrl+"jkjy/JkjyImpl/queryHealtheducationForIHealth";
        String apiUrl = prixUrl + "jkjy/JkjyImpl/queryHealtheducationForIHealth";
//      获取加密后参数集合
        Map<String,String> param = httpClientUtil.getSecretParams(params,appId,secret);
        Map<String, String> param = httpClientUtil.getSecretParams(params, appId, secret);
//      拼接请求URL (加密签名+apiUrl)
//      获取返回数据( HTTP post请求,参数需要utf-8编码)
        String  results = httpClientUtil.httpPost(apiUrl,param);
        String results = httpClientUtil.httpPost(apiUrl, param);
        return results;
@ -164,7 +169,7 @@ public class HealthEduArticleService extends BaseService {
        }
        List<Object> params = new ArrayList<Object>();
        StringBuffer sql = new StringBuffer();
        sql.append("select a.id,a.code,a.title,a.url,a.czrq,a.content,a.keyword");
        sql.append("select a.id,a.code,a.title,a.url,a.czrq,a.summary content,a.keyword");
        sql.append(",(select count(1) from wlyy_health_edu_article_op_history c where c.code = a.code and c.status = 1) as readAmount");
        sql.append(",(select count(1) from wlyy_health_edu_article_op_history c where c.code = a.code and c.status = 2) as collectionAmount");
        sql.append(",(select count(1) from wlyy_health_edu_article_op_history c where c.code = a.code and c.status = 3) as repeatAmount");
@ -212,7 +217,7 @@ public class HealthEduArticleService extends BaseService {
                "    ,a.title" +
                "    ,a.url" +
                "    ,a.czrq" +
                "    ,a.content" +
                "    ,a.summary content" +
                "    ,d.code" +
                "    ,d.name" +
                "    ,d.photo" +
@ -224,9 +229,9 @@ public class HealthEduArticleService extends BaseService {
                "    a.doctor = d.code " +
                "    and a.patient = ?" +
                "    and a.admin_team_code = ?" +
                "  order by a.czrq desc limit " + page*pageSize + "," + pageSize;
                "  order by a.czrq desc limit " + page * pageSize + "," + pageSize;
        List<Map<String,Object>> result = jdbcTemplate.queryForList(sql,new Object[]{patient,teamCode});
        List<Map<String, Object>> result = jdbcTemplate.queryForList(sql, new Object[]{patient, teamCode});
        return result;
    }

+ 7 - 5
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/reservation/PatientReservationService.java

@ -107,11 +107,13 @@ public class PatientReservationService extends BaseService {
            obj.setStatus(0);
            String patient = obj.getPatient();
            SignFamily signFamily = signFamilyDao.findByPatient(patient);//得到患者的签约信息
            DoctorTeamMember doctorTeamMember = doctorTeamDoctor.findMemberByTeamAndCode(signFamily.getTeamCode(), doctor);//得到服务团队的医生信息
            obj.setCanceler(doctorTeamMember.getMemberCode());
            obj.setCancelerName(doctorTeamMember.getName());
            obj.setCancelerType(doctorTeamMember.getType());
            obj.setCancelerTime(DateUtil.dateToStrLong(new Date()));
            DoctorTeamMember doctorTeamMember = doctorTeamDoctor.findMemberCodeAndTeam(signFamily.getTeamCode(), doctor);//得到服务团队的医生信息
            if(doctorTeamMember!=null){
                obj.setCancelerName(doctorTeamMember.getName());
                obj.setCancelerType(doctorTeamMember.getType());
                obj.setCancelerTime(DateUtil.dateToStrLong(new Date()));
            }
            obj.setCanceler(doctor);
            patientReservationDao.save(obj);
        }
    }

+ 31 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/util/ManageUtilService.java

@ -4,10 +4,14 @@ import com.yihu.wlyy.entity.doctor.team.sign.DoctorPatientGroupInfo;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeam;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeamInfo;
import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeamMember;
import com.yihu.wlyy.entity.education.HealthEduArticle;
import com.yihu.wlyy.entity.education.HealthEduArticlePatient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.doctor.DoctorPatientGroupInfoDao;
import com.yihu.wlyy.repository.doctor.DoctorTeamDao;
import com.yihu.wlyy.repository.doctor.DoctorTeamMemberDao;
import com.yihu.wlyy.repository.education.HealthEduArticleDao;
import com.yihu.wlyy.repository.education.HealthEduArticlePatientDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.util.IdCardUtil;
@ -44,6 +48,10 @@ public class ManageUtilService extends BaseService {
    DoctorTeamMemberDao teamMemberDao;
    @Autowired
    JpaTransactionManager transactionManager;
    @Autowired
    HealthEduArticleDao healthEduArticleDao;
    @Autowired
    HealthEduArticlePatientDao healthEduArticlePatientDao;
    public static int page = 0;
    public static List<Integer> errorPages = new ArrayList<>();
@ -516,4 +524,27 @@ public class ManageUtilService extends BaseService {
            throw new Exception(e.getMessage());
        }
    }
    @Transactional
    public void transformEduArticle() {
        Iterable<HealthEduArticle> articles = healthEduArticleDao.findAll();
        for (HealthEduArticle article : articles) {
            String content = article.getContent();
            content = content.replaceAll("</?[^>]+>", "")
                    .replaceAll("<a>\\s*|\t|\r|\n</a>", "")
                    .replaceAll("&nbsp;", "").replaceAll(" ",""); //剔出<html>的标签
            article.setSummary(content.length() > 50 ? content.substring(0, 49) : content);
        }
        Iterable<HealthEduArticlePatient> articlesPatient = healthEduArticlePatientDao.findAll();
        for (HealthEduArticlePatient article : articlesPatient) {
            String content = article.getContent();
            content = content.replaceAll("</?[^>]+>", "")
                    .replaceAll("<a>\\s*|\t|\r|\n</a>", "")
                    .replaceAll("&nbsp;", "").replaceAll(" ",""); //剔出<html>的标签
            article.setSummary(content.length() > 50 ? content.substring(0, 49) : content);
        }
    }
}

+ 6 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/guahao/GuahaoXMService.java

@ -978,6 +978,12 @@ public class GuahaoXMService implements IGuahaoService {
            }
        }
        //根据患者医保卡获取近三个月的已取消的预约记录
        List<PatientReservation> list = patientReservationDao.findByPatientAndStartTime(patientCode,strStart,strEnd);
        if(list.size()>0){
            patientRegList.addAll(list);
        }
        //保存http日志
        logService.saveHttpLog(true,REG_LIST,content,method,null,msgBody,res,null,"2");

+ 67 - 88
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/account/WechatController.java

@ -67,11 +67,14 @@ public class WechatController extends WeixinBaseController {
    @ResponseBody
    public String checkmobile(String phone) {
        try {
            /**modify by linz 2017年2月28日10:11:49 校验手机号码的时候返回使用此号码的所有人员**/
            List<Patient> temp = patientService.findByMobile(phone);
            if (temp != null&&temp.size()>0) {
            Patient temp = patientService.findByMobile(phone);
            if (temp != null) {
                JSONObject json = new JSONObject();
                // 设置患者标识
                json.put("code", temp.getCode());
                // 设置身份证号
                return write(200, "患者信息查询成功!", "data", temp);
                json.put("idcard", temp.getIdcard());
                return write(200, "患者信息查询成功!", "data", json);
            }
            return error(1, "该手机号未被注册");
        } catch (Exception e) {
@ -150,9 +153,6 @@ public class WechatController extends WeixinBaseController {
            if (StringUtils.isEmpty(mobile)) {
                return error(-1, "手机号不允许为空");
            }
            if (patientService.findByMobile(mobile) != null) {
                return error(-1, "该手机号已被注册");
            }
            // 解密身份证号
            idcard = RSAUtils.getInstance(patientService).decryptString(idcard);
            idcard = URLDecoder.decode(idcard, "UTF-8");
@ -187,7 +187,7 @@ public class WechatController extends WeixinBaseController {
            if (patient != null) {
                if (!StringUtils.isEmpty(patient.getMobile())) {
                    return error(-1, "该身份证已被注册");
                    return error(-2, "该身份证已被注册");
                }
            }
@ -227,9 +227,6 @@ public class WechatController extends WeixinBaseController {
            if (StringUtils.isEmpty(mobile)) {
                return error(-1, "手机号不允许为空!");
            }
            //if (patientService.findByMobile(mobile) != null) {
            //    return error(-1, "该手机号已被注册!");
            //}
            // 对验证码进行校验
            int res = smsService.check(mobile, 1, captcha);
            switch (res) {
@ -284,7 +281,7 @@ public class WechatController extends WeixinBaseController {
                patient = new Patient();
            } else {
                if (!StringUtils.isEmpty(patient.getMobile())) {
                    return error(-1, "该身份证已被注册!");
                    return error(-2, "该身份证已被注册!");
                }
            }
            patient.setName(name);
@ -348,21 +345,12 @@ public class WechatController extends WeixinBaseController {
        try {
            //账号登录 mobile可能是电话号也可能是身份证
            if (StringUtils.isNoneEmpty(mobile) && StringUtils.isNoneEmpty(password) && !org.springframework.util.StringUtils.isEmpty(mobile)) {
                List<Patient> patients = patientService.findByMobile(mobile);
                Patient p =null;
                if (patients == null||patients.size()==0) {
                    p = patientService.findByIdcard(mobile);
                }else if(patients.size()==1){
                    p = patients.get(0);//只存在一个用户
                }else if(patients.size()>1&&StringUtils.isBlank(patient)){
                    //多个用户返回用户让患者选择
                    return write(1, "存在多个用户", "data", patients);
                }else if(patients.size()>1&&StringUtils.isNotBlank(patient)){
                    //传入登入者,一般只有多用户才有此操作
                    p = patientService.findByCode(patient);
                Patient patient = patientService.findByMobile(mobile);
                if (patient == null) {
                    patient = patientService.findByIdcard(mobile);
                }
                loginLog.setLoginType("2");
                if (p == null) {
                if (patient == null) {
                    if (mobile.length() == 11) {
                        errorMessage = "该手机号暂未注册账号,请确认后重新输入!";
                    } else {
@ -371,7 +359,7 @@ public class WechatController extends WeixinBaseController {
                    loginLog.setErrorMessage(errorMessage);
                    loginLogService.saveLog(loginLog);
                    return error(-1, errorMessage);
                } else if (p.getStatus() == 0) {
                } else if (patient.getStatus() == 0) {
                    if (mobile.length() == 11) {
                        errorMessage = "该手机号已被禁止使用!";
                    } else {
@ -380,7 +368,7 @@ public class WechatController extends WeixinBaseController {
                    loginLog.setErrorMessage(errorMessage);
                    loginLogService.saveLog(loginLog);
                    return error(-1, errorMessage);
                } else if (p.getStatus() == 2) {
                } else if (patient.getStatus() == 2) {
                    errorMessage = "该账号正在审核中,请确认审核通过后再登录,“如有疑问,拨打400-6677-400转2人工客服”";
                    loginLog.setErrorMessage(errorMessage);
                    loginLogService.saveLog(loginLog);
@ -391,31 +379,31 @@ public class WechatController extends WeixinBaseController {
                    loginLogService.saveLog(loginLog);
                    return error(-1, errorMessage);
                }
                loginLog.setUserCode(p.getCode());
                loginLog.setUserCode(patient.getCode());
                //解密
                password = RSAUtils.getInstance(patientService).decryptString(password);
                password = StringUtils.reverse(password);
                //生成MD5
                String loginPassword = MD5.GetMD5Code(password + p.getSalt());
                String loginPassword = MD5.GetMD5Code(password + patient.getSalt());
                //判断d登录密码是否正确
                if (loginPassword.equals(p.getPassword())) {
                if (loginPassword.equals(patient.getPassword())) {
                    // 绑定用户手机号和openid
                    if (!StringUtils.equals(p.getOpenid(), openid)) {
                    if (!StringUtils.equals(patient.getOpenid(), openid)) {
                        //patient.setOpenid(openid);
                        patientService.updatePatient(p, openid);
                        patientService.updatePatient(patient, openid);
                    }
                    // 用户校验通过,生成token
                    Token token = tokenService.newTxToken(p.getCode(), openid);
                    Token token = tokenService.newTxToken(patient.getCode(), openid);
                    Map<Object, Object> map = new HashMap<Object, Object>();
                    map.put("id", p.getId());
                    map.put("uid", p.getCode());
                    map.put("name", p.getName());
                    map.put("id", patient.getId());
                    map.put("uid", patient.getCode());
                    map.put("name", patient.getName());
                    map.put("token", token.getToken());
                    map.put("photo", p.getPhoto());
                    map.put("photo", patient.getPhoto());
                    if (StringUtils.isNoneEmpty(openid)) {
                        //发送微信模板
                        familyService.sendWXMessage(p);
                        familyService.sendWXMessage(patient);
                    }
                    loginLog.setLoginType("1");
@ -452,9 +440,9 @@ public class WechatController extends WeixinBaseController {
                        return error(-1, errorMessage);
                    }
                }
                List<Patient> patients = patientService.findByMobile(mobile);
                Patient patient = patientService.findByMobile(mobile);
                loginLog.setLoginType("1");
                if (patient == null||patients.size()==0) {
                if (patient == null) {
                    if (mobile.length() == 11) {
                        errorMessage = "该手机号暂未注册账号,请确认后重新输入!";
                    } else {
@ -463,57 +451,48 @@ public class WechatController extends WeixinBaseController {
                    loginLog.setErrorMessage(errorMessage);
                    loginLogService.saveLog(loginLog);
                    return error(-1, errorMessage);
                }else if(patients.size()>1&&StringUtils.isBlank(patient)) {
                    return write(1, "存在多个用户", "data", patients);
                }else if(patients.size()>1&&StringUtils.isNotBlank(patient)){
                    Patient p = null;
                    if(patients.size()==1){
                         p  = patients.get(0);
                    }else if(StringUtils.isNotBlank(patient)){
                        p = patientService.findByCode(patient);
                    }
                    if (p.getStatus() == 0) {
                        if (mobile.length() == 11) {
                            errorMessage = "该手机号已被禁止使用!";
                        } else {
                            errorMessage = "该身份证号已被禁止使用!";
                        }
                        loginLog.setErrorMessage(errorMessage);
                        loginLogService.saveLog(loginLog);
                        return error(-1, errorMessage);
                    } else if (p.getStatus() == 2) {
                        errorMessage = "该账号正在审核中,请确认审核通过后再登录,“如有疑问,拨打400-6677-400转2人工客服”";
                        loginLog.setErrorMessage(errorMessage);
                        loginLogService.saveLog(loginLog);
                        return error(-1, errorMessage);
                    } else if (StringUtils.isEmpty(openid)) {
                        errorMessage = "无效的OpenID!";
                        loginLog.setErrorMessage(errorMessage);
                        loginLogService.saveLog(loginLog);
                        return error(-1, errorMessage);
                    }
                    loginLog.setUserCode(p.getCode());
                    // 绑定用户手机号和openid
                    if (!StringUtils.equals(p.getOpenid(), openid)) {
                        //patient.setOpenid(openid);
                        patientService.updatePatient(p, openid);
                    }
                    // 用户校验通过,生成token
                    Token token = tokenService.newTxToken(p.getCode(), openid);
                    Map<Object, Object> map = new HashMap<Object, Object>();
                    map.put("id", p.getId());
                    map.put("uid", p.getCode());
                    map.put("name", p.getName());
                    map.put("token", token.getToken());
                    map.put("photo", p.getPhoto());
                    if (StringUtils.isNoneEmpty(openid)) {
                        //发送微信模板
                        familyService.sendWXMessage(p);
                } else if (patient.getStatus() == 0) {
                    if (mobile.length() == 11) {
                        errorMessage = "该手机号已被禁止使用!";
                    } else {
                        errorMessage = "该身份证号已被禁止使用!";
                    }
                    loginLog.setType("1");
                    loginLog.setErrorMessage(errorMessage);
                    loginLogService.saveLog(loginLog);
                    return write(200, "登录成功", "data", map);
                    return error(-1, errorMessage);
                } else if (patient.getStatus() == 2) {
                    errorMessage = "该账号正在审核中,请确认审核通过后再登录,“如有疑问,拨打400-6677-400转2人工客服”";
                    loginLog.setErrorMessage(errorMessage);
                    loginLogService.saveLog(loginLog);
                    return error(-1, errorMessage);
                } else if (StringUtils.isEmpty(openid)) {
                    errorMessage = "无效的OpenID!";
                    loginLog.setErrorMessage(errorMessage);
                    loginLogService.saveLog(loginLog);
                    return error(-1, errorMessage);
                }
                loginLog.setUserCode(patient.getCode());
                // 绑定用户手机号和openid
                if (!StringUtils.equals(patient.getOpenid(), openid)) {
                    //patient.setOpenid(openid);
                    patientService.updatePatient(patient, openid);
                }
                // 用户校验通过,生成token
                Token token = tokenService.newTxToken(patient.getCode(), openid);
                Map<Object, Object> map = new HashMap<Object, Object>();
                map.put("id", patient.getId());
                map.put("uid", patient.getCode());
                map.put("name", patient.getName());
                map.put("token", token.getToken());
                map.put("photo", patient.getPhoto());
                if (StringUtils.isNoneEmpty(openid)) {
                    //发送微信模板
                    familyService.sendWXMessage(patient);
                }
                loginLog.setType("1");
                loginLogService.saveLog(loginLog);
                return write(200, "登录成功", "data", map);
            }
            return error(-1, "登录失败");
        } catch (Exception e) {

+ 15 - 0
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/util/ManagerUtilController.java

@ -219,4 +219,19 @@ public class ManagerUtilController extends BaseController {
        }
    }
    /**
     * 健康教育数据清洗
     *
     * @return
     */
    @RequestMapping(value = "/tranform_edu_article")
    public String tranformEduArticle(){
        try {
            manageUtilService.transformEduArticle();
            return write(200,"启动成功");
        } catch (Exception e) {
            return error(-1, "启动失败");
        }
    }
}

+ 3 - 3
patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthEduArticleController.java

@ -101,7 +101,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
                    json.put("url", map.get("url"));
                    // 文章简介
                    json.put("content", parsrHtml(map.get("content").toString()));
                    json.put("content", map.get("content").toString());
                    // 添加日期
                    json.put("czrq", DateUtil.dateToStrLong((Date) map.get("czrq")));
@ -165,7 +165,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
                    // 文章查看URL
                    json.put("url", map.get("url"));
                    // 文章简介
                    json.put("content", parsrHtml(map.get("content").toString()));
                    json.put("content", map.get("content").toString());
                    // 发送日期
                    json.put("czrq", DateUtil.dateToStrLong((Date) map.get("czrq")));
                    // 发送团队
@ -203,7 +203,7 @@ public class DoctorHealthEduArticleController extends WeixinBaseController {
                json.put("url", map.get("url"));
                // 文章简介
                json.put("content", parsrHtml(map.get("content").toString()));
                json.put("content", map.get("content").toString());
                // 添加日期
                json.put("czrq", DateUtil.dateToStrLong((Date) map.get("czrq")));