浏览代码

居民登录与注册

Trick 5 年之前
父节点
当前提交
deb6fa0015
共有 33 个文件被更改,包括 1598 次插入54 次删除
  1. 12 12
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/PrescriptionService.java
  2. 71 0
      business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java
  3. 49 13
      business/base-service/src/main/java/com/yihu/jw/internet/service/ykyy/YkyyInternetService.java
  4. 2 5
      business/base-service/src/main/java/com/yihu/jw/utils/ImgUtils.java
  5. 29 0
      business/sms-service/src/main/java/com/yihu/jw/sms/service/YkyySMSService.java
  6. 378 0
      business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/client/SmsClient.java
  7. 53 0
      business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/demo/GetMo.java
  8. 45 0
      business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/demo/GetReport.java
  9. 41 0
      business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/demo/QueryAccount.java
  10. 96 0
      business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/demo/SendSms.java
  11. 109 0
      business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/demo/SendVariantSms.java
  12. 57 0
      business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/util/HttpClient.java
  13. 29 0
      business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/util/MD5.java
  14. 30 0
      business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/vo/GetTokenResp.java
  15. 44 0
      business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/vo/QueryReq.java
  16. 64 0
      business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/vo/ResultMsg.java
  17. 66 0
      business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/vo/SmsReq.java
  18. 25 0
      business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/vo/VariantParams.java
  19. 78 0
      business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/vo/VariantSmsReq.java
  20. 4 4
      common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java
  21. 4 3
      common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/BasePatientWechatDo.java
  22. 44 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/dao/patient/BasePatientMedicareCardDao.java
  23. 17 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/dao/patient/BasePatientWechatDao.java
  24. 111 1
      server/svr-authentication/src/main/java/com/yihu/jw/security/oauth2/provider/endpoint/WlyyLoginEndpoint.java
  25. 14 3
      server/svr-authentication/src/main/java/com/yihu/jw/security/service/OauthSsoService.java
  26. 81 0
      server/svr-authentication/src/main/java/com/yihu/jw/security/service/RegisterService.java
  27. 7 0
      svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/XzzxCotroller.java
  28. 4 4
      svr/svr-internet-hospital-job/pom.xml
  29. 5 1
      svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java
  30. 22 3
      svr/svr-internet-hospital-job/src/main/resources/application.yml
  31. 1 1
      svr/svr-internet-hospital-job/src/main/resources/bootstrap.yml
  32. 2 1
      svr/svr-internet-hospital-job/src/main/resources/quartz.properties
  33. 4 3
      svr/svr-internet-hospital/src/main/resources/application.yml

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

@ -2438,21 +2438,21 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                rs.put("registerCount",0);
                rs.put("registerCount",0);
            }
            }
            //医生问诊量
            //医生问诊量
            List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByDoctorAndStatus(doctor,"2");
            if(wlyyOutpatientDOs!=null&&wlyyOutpatientDOs.size()>0){
                rs.put("outpatientCount",wlyyOutpatientDOs.size());
            }else{
                rs.put("outpatientCount",0);
            }
//            List<WlyyOutpatientDO> wlyyOutpatientDOs = outpatientDao.findByDoctorAndStatus(doctor,"2");
//            if(wlyyOutpatientDOs!=null&&wlyyOutpatientDOs.size()>0){
//                rs.put("outpatientCount",wlyyOutpatientDOs.size());
//            }else{
//                rs.put("outpatientCount",0);
//            }
            //协同门诊量
            //协同门诊量
            Integer coordinationCout = outpatientDao.countByDoctorAndStatusAndOutpatientType(doctor,"2","2");
            rs.put("coordinationCout",coordinationCout);
//            Integer coordinationCout = outpatientDao.countByDoctorAndStatusAndOutpatientType(doctor,"2","2");
//            rs.put("coordinationCout",coordinationCout);
            if(StringUtils.isNotBlank(withWork)&&"1".equals(withWork)){
                List<WlyyDoctorWorkTimeVO> times = findDoctorWorkTime(doctor);
                rs.put("workTime",times);
            }
//            if(StringUtils.isNotBlank(withWork)&&"1".equals(withWork)){
//                List<WlyyDoctorWorkTimeVO> times = findDoctorWorkTime(doctor);
//                rs.put("workTime",times);
//            }
    
    
            //专家咨询
            //专家咨询
            String zjCountsql = "SELECT id FROM wlyy_consult_team WHERE doctor='"+doctor+"' AND (type=1 OR type=15)";
            String zjCountsql = "SELECT id FROM wlyy_consult_team WHERE doctor='"+doctor+"' AND (type=1 OR type=15)";

+ 71 - 0
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/XzzxEntranceService.java

@ -0,0 +1,71 @@
package com.yihu.jw.hospital.prescription.service.entrance;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.utils.WebserviceUtil;
import org.apache.commons.collections.map.HashedMap;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import java.util.List;
import java.util.Map;
/**
 * 心脏中心内网his对接服务
 * Created by Trick on 2020/3/18.
 */
@Service
@Transactional
public class XzzxEntranceService {
    private static Logger logger = LoggerFactory.getLogger(XzzxEntranceService.class);
    @Autowired
    private WlyyHospitalSysDictDao wlyyHospitalSysDictDao;
    public String getXzzxWebServiceInfo(String api, Map<String,String> params)throws Exception{
        List<WlyyHospitalSysDictDO> list =  wlyyHospitalSysDictDao.findByDictName("xzzxWebService");
        String url = list.get(0).getDictCode();
        logger.info("url"+url);
        List<WlyyHospitalSysDictDO> xzzxNamespaces =  wlyyHospitalSysDictDao.findByDictName("xzzxNamespace");
        String xzzxNamespace = xzzxNamespaces.get(0).getDictCode();
        logger.info("xzzxNamespace",xzzxNamespace);
        return WebserviceUtil.post(url,xzzxNamespace,api,params);
    }
    /**
     * 获取部门信息
     * @return
     */
    public String getDeptInfo()throws Exception{
        String api = "GetDeptInfo";
        String key ="bvvsf3JA0mUXMU+mVnMaOQ==";
        String msgHeader ="<?xml version=\"1.0\" encoding=\"utf-8\"?> " +
                "<root> " +
                "   <serverName>"+api+"</serverName>  " +
                "   <format>xml</format>" +
                "   <callOperator></callOperator> " +
                "   <certificate>"+key+"</certificate> " +
                "</root>";
        String msgBody ="<?xml version=\"1.0\" encoding=\"utf-8\"?>" +
                "<root></root>";
        Map<String,String> params = new HashedMap();
        params.put("msgHeader",msgHeader);
        params.put("msgBody",msgBody);
        logger.info("getDeptInfo params:"+params.toString());
        return getXzzxWebServiceInfo("CallInterface",params);
    }
}

+ 49 - 13
business/base-service/src/main/java/com/yihu/jw/internet/service/ykyy/YkyyInternetService.java

@ -63,7 +63,6 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
    static String psw = "7j39c7";
    static String psw = "7j39c7";
    static String appId = "ws022";
    static String appId = "ws022";
    static String AesEncodeKey = "834irjf3jd39rh2m";
    static String AesEncodeKey = "834irjf3jd39rh2m";
    //http://fjhlw.bsoft.com.cn:18081/micc/wsapi/1.0?
    static String urlString = "http://10.120.102.202:18081/micc/wsapi/1.0?wsdl";  // 正式线路径
    static String urlString = "http://10.120.102.202:18081/micc/wsapi/1.0?wsdl";  // 正式线路径
 //   static String urlString = "http://fjhlw.bsoft.com.cn:18081/micc/wsapi/1.0?wsdl";   // 测试线路径
 //   static String urlString = "http://fjhlw.bsoft.com.cn:18081/micc/wsapi/1.0?wsdl";   // 测试线路径
    static String method = "execute";
    static String method = "execute";
@ -91,13 +90,13 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
        proxy.setEndpoint(url);
        proxy.setEndpoint(url);
        Wsapi wsapi = proxy.getWsapi();
        Wsapi wsapi = proxy.getWsapi();
        //logger.info(JSONUtils.toString(new String[] {token, params.toString()}));
//        logger.info("postToInter:"+JSONUtils.toString(new String[] {token, params.toString()}));
        String encryptParams = AESUtils.encrypt(JSONUtils.toString(new String[] {token, params.toString()}), AesEncodeKey);
        String encryptParams = AESUtils.encrypt(JSONUtils.toString(new String[] {token, params.toString()}), AesEncodeKey);
        String result = wsapi.invoke(appId, "", api, method, encryptParams);
        String result = wsapi.invoke(appId, "", api, method, encryptParams);
        String deResult = AESUtils.decrypt(result, AesEncodeKey);
        String deResult = AESUtils.decrypt(result, AesEncodeKey);
        logger.info(JSONUtils.toString(deResult));
        logger.info("postToInter:"+JSONUtils.toString(deResult));
        return deResult;
        return deResult;
    }
    }
@ -113,9 +112,18 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
        jb.put("cd_user", userName);
        jb.put("cd_user", userName);
        jb.put("pwd_user", psw);
        jb.put("pwd_user", psw);
        logger.info("url :"+url);
        logger.info("jb :"+jb.toString());
        String encryptParams = AESUtils.encrypt(JSONUtils.toString(new String[] { jb.toString() }), AesEncodeKey);
        String encryptParams = AESUtils.encrypt(JSONUtils.toString(new String[] { jb.toString() }), AesEncodeKey);
        String res = wsapi.invoke(appId, "", api, method, encryptParams);
        String res = wsapi.invoke(appId, "", api, method, encryptParams);
        logger.info("appId :"+appId);
        logger.info("method :"+method);
        logger.info("encryptParams :"+encryptParams);
        String deResult = AESUtils.decrypt(res, AesEncodeKey);
        String deResult = AESUtils.decrypt(res, AesEncodeKey);
        logger.info("AesEncodeKey :"+AesEncodeKey);
        JSONObject resJson = (JSONObject) JSONObject.parse(deResult);
        JSONObject resJson = (JSONObject) JSONObject.parse(deResult);
        if("200".equals(resJson.get("msg").toString())) {
        if("200".equals(resJson.get("msg").toString())) {
@ -147,10 +155,15 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
        jb.put("hospital_phone", "0592-2112111");
        jb.put("hospital_phone", "0592-2112111");
        jb.put("hospital_img","");
        jb.put("hospital_img","");
        jb.put("bus_lic", ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"yyzz.jpg"));
        jb.put("corp_idcord_head", ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"a.jpg"));
        jb.put("corp_idcord_tail", ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"b.jpg"));
        jb.put("pra_lic", ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"zyxkz.jpg"));
//        jb.put("bus_lic", ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"yyzz.jpg"));
//        jb.put("corp_idcord_head", ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"a.jpg"));
//        jb.put("corp_idcord_tail", ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"b.jpg"));
//        jb.put("pra_lic", ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"zyxkz.jpg"));
        jb.put("bus_lic", null);
        jb.put("corp_idcord_head", null);
        jb.put("corp_idcord_tail", null);
        jb.put("pra_lic", null);
        jb.put("secu_level","3");
        jb.put("secu_level","3");
        jb.put("secu_level_cert",ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"dbtp.jpg"));
        jb.put("secu_level_cert",ImgUtils.getImageStr(imgPath+"hospital"+File.separator+"dbtp.jpg"));
@ -309,7 +322,11 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
                "  from base_doctor a " +
                "  from base_doctor a " +
                "      ,base_doctor_hospital b" +
                "      ,base_doctor_hospital b" +
                " where a.id = b.doctor_code" +
                " where a.id = b.doctor_code" +
                "   and b.dept_code is NOT NULL ";
                "   AND b.dept_code is NOT NULL " +
                "   AND a.job_title_code is NOT NULL " +
                "   AND a.fzrq IS NOT NULL " +
                "   AND a.cert_no IS NOT NULL " +
                "   AND a.prac_no IS NOT NULL ";
        if(StringUtils.isNotBlank(keyId)){
        if(StringUtils.isNotBlank(keyId)){
            sql =  sql +  "  and a.id = '" + keyId + "' ";
            sql =  sql +  "  and a.id = '" + keyId + "' ";
@ -325,7 +342,7 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
            Boolean errorFlag = false;
            Boolean errorFlag = false;
            JSONObject jb = new JSONObject();
            JSONObject jb = new JSONObject();
            try {
            try {
                String[] dept = depToSubject(jb.getString("dept_code"));
                String[] dept = depToSubject(info.get("dept_code").toString());
                // 中山医院 监管平台  职务字典强转
                // 中山医院 监管平台  职务字典强转
                String[] dutyInfo = classToduty(info.get("job_title_code").toString());
                String[] dutyInfo = classToduty(info.get("job_title_code").toString());
@ -341,7 +358,7 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
                jb.put("belong_dept",jb.getString("dept_code"));
                jb.put("belong_dept",jb.getString("dept_code"));
                jb.put("belong_dept_name", jb.getString("dept_name"));
                jb.put("belong_dept_name", jb.getString("dept_name"));
                jb.put("doo_tel", info.get("mobile")== null ? "":info.get("mobile"));
                jb.put("doo_tel", info.get("mobile")== null ? "":info.get("mobile"));
                jb.put("title_rec_date", info.get("fzrq"));
                jb.put("title_rec_date", getDateString(info.get("fzrq").toString()));
                jb.put("prac_type", "1");   // 因为上传的是医师的信息,所以该字段全部默认设置为 1 医师
                jb.put("prac_type", "1");   // 因为上传的是医师的信息,所以该字段全部默认设置为 1 医师
                jb.put("title_code", dutyInfo[0].toString());  // 需要与监管平台的字典进行映射
                jb.put("title_code", dutyInfo[0].toString());  // 需要与监管平台的字典进行映射
                jb.put("first_compeny_code", orgCode);
                jb.put("first_compeny_code", orgCode);
@ -361,7 +378,7 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
                errorFlag = true;
                errorFlag = true;
                saveErrorLog(upid,"3",info.get("id").toString(),"数据格式错误",1);
                saveErrorLog(upid,"3",info.get("id").toString(),"数据格式错误",1);
                error++;
                error++;
//                logger.error(e.toString());
                logger.error(e.toString());
            }
            }
            if(!errorFlag){
            if(!errorFlag){
                //上传监管平台
                //上传监管平台
@ -1746,8 +1763,8 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
                res[1] = "主治医师";
                res[1] = "主治医师";
                break;
                break;
            default:
            default:
                res[0] = "0";
                res[1] = "未知";
                res[0] = "234";
                res[1] = "医师";
        }
        }
        return  res;
        return  res;
    }
    }
@ -1774,6 +1791,21 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
        return "";
        return "";
    }
    }
    public String getDateString(String date){
        String dates[] = date.split("-");
        if(dates!=null&&dates.length>0){
            if(dates[1].length()<2){
                dates[1] = "0"+dates[1];
            }
            if(dates[2].length()<2){
                dates[2] = "0"+dates[2];
            }
            return dates[0]+"-"+dates[1]+"-"+dates[2];
        }
        return date;
    }
    private String getBase64FromInputStream(InputStream is) throws Exception {
    private String getBase64FromInputStream(InputStream is) throws Exception {
        // 将图片文件转化为字节数组字符串,并对其进行Base64编码处理
        // 将图片文件转化为字节数组字符串,并对其进行Base64编码处理
        byte[] data = null;
        byte[] data = null;
@ -1803,4 +1835,8 @@ public class YkyyInternetService extends BaseJpaService<InternetUpErrorLogDO, In
        //转化方法2
        //转化方法2
//        return new String(Base64.encodeBase64(data));
//        return new String(Base64.encodeBase64(data));
    }
    }
    public String testImg(String path){
        return ImgUtils.getImageStr(path);
    }
}
}

+ 2 - 5
business/base-service/src/main/java/com/yihu/jw/utils/ImgUtils.java

@ -65,15 +65,12 @@ public class ImgUtils {
        InputStream in = null;
        InputStream in = null;
        byte[] data = null;
        byte[] data = null;
        //读取图片字节数组
        //读取图片字节数组
        try
        {
        try {
            in = new FileInputStream(imgFile);
            in = new FileInputStream(imgFile);
            data = new byte[in.available()];
            data = new byte[in.available()];
            in.read(data);
            in.read(data);
            in.close();
            in.close();
        }
        catch (IOException e)
        {
        } catch (IOException e) {
            e.printStackTrace();
            e.printStackTrace();
        }
        }
        //对字节数组Base64编码
        //对字节数组Base64编码

+ 29 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/service/YkyySMSService.java

@ -0,0 +1,29 @@
package com.yihu.jw.sms.service;
import com.yihu.jw.sms.util.ykyy.client.SmsClient;
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
import org.springframework.stereotype.Service;
/**
 * Created by Trick on 2020/3/19.
 */
@Service
public class YkyySMSService {
    private final String usrCode ="300643";
    private final String pw ="T9IHN69DDF";
    private final String url ="https://smsapp.wlwx.com";
    /**
     * 发送短信验证码
     * @param mobile
     * @param content
     * @return
     */
    public ResultMsg ykyySendSMS(String mobile, String content){
        SmsClient smsClient = new SmsClient();
        return smsClient.sendSms("ykyy",usrCode, content,mobile,"yes","","8",url,pw);
    }
}

+ 378 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/client/SmsClient.java

@ -0,0 +1,378 @@
package com.yihu.jw.sms.util.ykyy.client;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.sms.util.ykyy.util.HttpClient;
import com.yihu.jw.sms.util.ykyy.util.MD5;
import com.yihu.jw.sms.util.ykyy.vo.*;
/**
 * 短信服务相关方法
 */
public class SmsClient {
	
	/**
	 * 获取token信息
	 * @param custCode 客户账号
	 * @param serviceBaseUrl http://ip:port
	 * @return ResultMsg
	 */
	private ResultMsg getToken(String custCode, String serviceBaseUrl){
		ResultMsg resultMsg = new ResultMsg();
		try {
			//发送token请求
			QueryReq getTokenReq = new QueryReq();
			
			getTokenReq.setCust_code(custCode);
			
			String postData = JSON.toJSONString(getTokenReq);
			String getTokenResp = HttpClient.post(serviceBaseUrl + "/getToken", postData,
					"application/json", "utf-8");
			
			JSONObject jsonObject = JSON.parseObject(getTokenResp);
			
			if (!"failed".equals(jsonObject.getString("status"))) {//判断是否获取token信息成功
				resultMsg.setSuccess(true);
				resultMsg.setData(getTokenResp);
			} else {
				resultMsg.setSuccess(false);
				resultMsg.setCode(jsonObject.getString("respCode"));
				resultMsg.setMsg(jsonObject.getString("respMsg"));
			}
		} catch (Exception e) {
			e.printStackTrace();
			resultMsg.setSuccess(false);
			resultMsg.setCode("1000");
			resultMsg.setMsg("服务器出现未知异常");
		}
		return resultMsg;
	}
	
	/**
	 * 发送短信
	 * @param smsReq SmsReq实体类
	 * @param password 客户密码
	 * @param serviceBaseUrl http://ip:port
	 * @return ResultMsg
	 */
	public ResultMsg sendSms(SmsReq smsReq, String password, String serviceBaseUrl){
		SmsClient smsClient = new SmsClient();
		ResultMsg resultMsg = smsClient.getToken(smsReq.getCust_code(), serviceBaseUrl);
		
		try {
			String sign = MD5.getMD5((smsReq.getContent() + password).getBytes("utf-8"));
			smsReq.setSign(sign);
			String postData = JSON.toJSONString(smsReq);
			String sendSmsResp = HttpClient.post(serviceBaseUrl + "/sendSms", postData, "application/json", "utf-8");
			
			JSONObject jsonObject = JSON.parseObject(sendSmsResp);
			if (!"failed".equals(jsonObject.getString("status"))) {//判断是否获取token信息成功
				resultMsg.setSuccess(true);
				resultMsg.setData(sendSmsResp);
			} else {
				resultMsg.setSuccess(false);
				resultMsg.setCode(jsonObject.getString("respCode"));
				resultMsg.setMsg(jsonObject.getString("respMsg"));
			}
		} catch (Exception e) {
			e.printStackTrace();
			resultMsg.setSuccess(false);
			resultMsg.setCode("1000");
			resultMsg.setMsg("服务器出现未知异常");
		}
		return resultMsg;
	}
	
	/**
	 * 发送短信
	 * @param uid 			[选填] 业务标识,由贵司自定义32为数字透传至我司
	 * @param custCode 		[必填] 用户账号
	 * @param content 		[必填] 短信内容
	 * @param destMobiles 	[必填] 接收号码,同时发送给多个号码时,号码之间用英文半角逗号分隔(,)
	 * @param needReport 	[选填] 状态报告需求与否,是 yes 否 no 默认yes
	 * @param spCode 		[选填] 长号码
	 * @param msgFmt 		[选填] 信息格式,0:ASCII串;3:短信写卡操作;4:二进制信息;8:UCS2编码;默认8
	 * @param serviceBaseUrl 			[必填] http://ip:port
	 * @param password 		[必填] 账号密码
	 * @return ResultMsg
	 */
	public ResultMsg sendSms(String uid, String custCode, String content, String destMobiles,
			String needReport, String spCode, String msgFmt, String serviceBaseUrl,String password){
		SmsClient smsClient = new SmsClient();
		ResultMsg resultMsg = smsClient.getToken(custCode, serviceBaseUrl);
		try {
			SmsReq req = new SmsReq();
			req.setUid(uid);
			req.setCust_code(custCode);
			req.setContent(content);
			req.setDestMobiles(destMobiles);
			req.setNeed_report(needReport);
			req.setSp_code(spCode);
			req.setMsgFmt(msgFmt);
			
			String sign = MD5.getMD5((req.getContent() + password).getBytes("utf-8"));
			req.setSign(sign);
			String postData = JSON.toJSONString(req);
			String sendSmsResp = HttpClient.post(serviceBaseUrl + "/sendSms", postData, "application/json", "utf-8");
			
			JSONObject jsonObject = JSON.parseObject(sendSmsResp);
			if (!"failed".equals(jsonObject.getString("status"))) {//判断是否获取token信息成功
				resultMsg.setSuccess(true);
				resultMsg.setData(sendSmsResp);
			} else {
				resultMsg.setSuccess(false);
				resultMsg.setCode(jsonObject.getString("respCode"));
				resultMsg.setMsg(jsonObject.getString("respMsg"));
			}
		} catch (Exception e) {
			e.printStackTrace();
			resultMsg.setSuccess(false);
			resultMsg.setCode("1000");
			resultMsg.setMsg("服务器出现未知异常");
		}
		return resultMsg;
	}
	
	
	/**
	 * 发送变量短信
	 * @param variantSmsReq VariantSmsReq实体类
	 * @param password 客户密码
	 * @param serviceBaseUrl http://ip:port
	 * @return ResultMsg
	 */
	public ResultMsg sendVariantSms(VariantSmsReq variantSmsReq, String serviceBaseUrl, String password){
		SmsClient smsClient = new SmsClient();
		ResultMsg resultMsg = smsClient.getToken(variantSmsReq.getCust_code(), serviceBaseUrl);
		try {
			String sign = MD5.getMD5((variantSmsReq.getContent() + password).getBytes("utf-8"));
			variantSmsReq.setSign(sign);
			String postData = JSON.toJSONString(variantSmsReq);
			String sendSmsResp = HttpClient.post(serviceBaseUrl + "/sendVariantSms", postData, "application/json", "utf-8");
			
			JSONObject jsonObject = JSON.parseObject(sendSmsResp);
			if (!"failed".equals(jsonObject.getString("status"))) {//判断是否获取token信息成功
				resultMsg.setSuccess(true);
				resultMsg.setData(sendSmsResp);
			} else {
				resultMsg.setSuccess(false);
				resultMsg.setCode(jsonObject.getString("respCode"));
				resultMsg.setMsg(jsonObject.getString("respMsg"));
			}
		} catch (Exception e) {
			e.printStackTrace();
			resultMsg.setSuccess(false);
			resultMsg.setCode("1000");
			resultMsg.setMsg("服务器出现未知异常");
		}
		return resultMsg;
	}
	
	
	/**
	 * 查询账户余额
	 * @param custCode 客户账号
	 * @param password 客户密码
	 * @param serviceBaseUrl http://ip:port
	 * @return ResultMsg
	 */
	public ResultMsg queryAccount(String custCode, String password, String serviceBaseUrl){
		SmsClient smsClient = new SmsClient();
		ResultMsg resultMsg = smsClient.getToken(custCode, serviceBaseUrl);
		try {
			if (resultMsg.isSuccess()) {
				GetTokenResp gtResp = JSON.parseObject(resultMsg.getData(), GetTokenResp.class);
				QueryReq queryAccountReq = new QueryReq();
				String sign = MD5.getMD5((gtResp.getToken() + password).getBytes("utf-8"));
				
				queryAccountReq.setToken_id(gtResp.getToken_id());
				queryAccountReq.setCust_code(custCode);
				queryAccountReq.setSign(sign);
				
				String postData = JSON.toJSONString(queryAccountReq);
				String queryAccountResp = HttpClient.post(serviceBaseUrl + "/queryAccount",
						postData, "application/json", "utf-8");
				
				JSONObject jsonObject = JSON.parseObject(queryAccountResp);
				if (!"failed".equals(jsonObject.getString("status"))) {
					resultMsg.setSuccess(true);
					resultMsg.setData(queryAccountResp);
				} else {
					resultMsg.setSuccess(false);
					resultMsg.setCode(jsonObject.getString("respCode"));
					resultMsg.setMsg(jsonObject.getString("respMsg"));
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
			resultMsg.setSuccess(false);
			resultMsg.setCode("1000");
			resultMsg.setMsg("服务器出现未知异常");
		}
		return resultMsg;
	}
	
	
	/**
	 * 获取上行记录
	 * @param custCode 客户账号
	 * @param password 客户密码
	 * @param serviceBaseUrl http://ip:port
	 * @return ResultMsg
	 */
	public ResultMsg getMo(String custCode, String password, String serviceBaseUrl){
		SmsClient smsClient = new SmsClient();
		ResultMsg resultMsg = smsClient.getToken(custCode, serviceBaseUrl);
		try {
			if (resultMsg.isSuccess()) {
				GetTokenResp gtResp = JSON.parseObject(resultMsg.getData(), GetTokenResp.class);
				QueryReq queryAccountReq = new QueryReq();
				String sign = MD5.getMD5((gtResp.getToken() + password).getBytes("utf-8"));
				
				queryAccountReq.setToken_id(gtResp.getToken_id());
				queryAccountReq.setCust_code(custCode);
				queryAccountReq.setSign(sign);
				
				String postData = JSON.toJSONString(queryAccountReq);
				String getMoResp = HttpClient.post(serviceBaseUrl + "/getMO",
						postData, "application/json", "utf-8");
				
				JSONObject jsonObject;
				try {
					JSON.parseArray(getMoResp);//无异常代表是json数组,即正常返回数据
					resultMsg.setSuccess(true);
					resultMsg.setData(getMoResp);
				} catch (Exception e) {
					jsonObject = JSON.parseObject(getMoResp);
					if (!"failed".equals(jsonObject.getString("status"))) {
						resultMsg.setSuccess(true);
						resultMsg.setData(getMoResp);
					} else {
						resultMsg.setSuccess(false);
						resultMsg.setCode(jsonObject.getString("respCode"));
						resultMsg.setMsg(jsonObject.getString("respMsg"));
					}
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
			resultMsg.setSuccess(false);
			resultMsg.setCode("1000");
			resultMsg.setMsg("服务器出现未知异常");
		}
		return resultMsg;
	}
	
	/**
	 * 获取状态报告
	 * @param custCode 客户账号
	 * @param password 客户密码
	 * @param serviceBaseUrl http://ip:port
	 * @return ResultMsg
	 */
	public ResultMsg getReport(String custCode, String password, String serviceBaseUrl){
		SmsClient smsClient = new SmsClient();
		ResultMsg resultMsg = smsClient.getToken(custCode, serviceBaseUrl);
		try {
			if (resultMsg.isSuccess()) {
				GetTokenResp gtResp = JSON.parseObject(resultMsg.getData(), GetTokenResp.class);
				QueryReq queryAccountReq = new QueryReq();
				String sign = MD5.getMD5((gtResp.getToken() + password).getBytes("utf-8"));
				
				queryAccountReq.setToken_id(gtResp.getToken_id());
				queryAccountReq.setCust_code(custCode);
				queryAccountReq.setSign(sign);
				
				String postData = JSON.toJSONString(queryAccountReq);
				String getReportResp = HttpClient.post(serviceBaseUrl + "/getReport",
						postData, "application/json", "utf-8");
				
				JSONObject jsonObject;
				try {
					JSON.parseArray(getReportResp);//无异常代表是json数组,即正常返回数据
					resultMsg.setSuccess(true);
					resultMsg.setData(getReportResp);
				} catch (Exception e) {
					jsonObject = JSON.parseObject(getReportResp);
					if (!"failed".equals(jsonObject.getString("status"))) {
						resultMsg.setSuccess(true);
						resultMsg.setData(getReportResp);
					} else {
						resultMsg.setSuccess(false);
						resultMsg.setCode(jsonObject.getString("respCode"));
						resultMsg.setMsg(jsonObject.getString("respMsg"));
					}
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
			resultMsg.setSuccess(false);
			resultMsg.setCode("1000");
			resultMsg.setMsg("服务器出现未知异常");
		}
		return resultMsg;
	}
	
	/**
	 * 获取某手机号码的黑名单类型
	 * @param custCode 客户账号
	 * @param password 客户密码
	 * @param serviceBaseUrl http://ip:port
	 * @param mobile 手机号码
	 * @return ResultMsg
	 */
	public ResultMsg getBlacklist(String custCode, String password, String serviceBaseUrl, String mobile){
		SmsClient smsClient = new SmsClient();
		ResultMsg resultMsg = smsClient.getToken(custCode, serviceBaseUrl);
		try {
			if (resultMsg.isSuccess()) {
				GetTokenResp gtResp = JSON.parseObject(resultMsg.getData(), GetTokenResp.class);
				QueryReq queryAccountReq = new QueryReq();
				String sign = MD5.getMD5((gtResp.getToken() + password).getBytes("utf-8"));
				
				queryAccountReq.setToken_id(gtResp.getToken_id());
				queryAccountReq.setCust_code(custCode);
				queryAccountReq.setSign(sign);
				queryAccountReq.setMobile(mobile);
				
				String postData = JSON.toJSONString(queryAccountReq);
				String getReportResp = HttpClient.post(serviceBaseUrl + "/getBlacklist",
						postData, "application/json", "utf-8");
				
				JSONObject jsonObject;
				try {
					JSON.parseArray(getReportResp);//无异常代表是json数组,即正常返回数据
					resultMsg.setSuccess(true);
					resultMsg.setData(getReportResp);
				} catch (Exception e) {
					System.out.println(getReportResp);
					jsonObject = JSON.parseObject(getReportResp);
					if (!"failed".equals(jsonObject.getString("status"))) {
						resultMsg.setSuccess(true);
						resultMsg.setData(getReportResp);
					} else {
						resultMsg.setSuccess(false);
						resultMsg.setCode(jsonObject.getString("respCode"));
						resultMsg.setMsg(jsonObject.getString("respMsg"));
					}
				}
			}
		} catch (Exception e) {
			e.printStackTrace();
			resultMsg.setSuccess(false);
			resultMsg.setCode("1000");
			resultMsg.setMsg("服务器出现未知异常");
		}
		return resultMsg;
	}
}

+ 53 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/demo/GetMo.java

@ -0,0 +1,53 @@
package com.yihu.jw.sms.util.ykyy.demo;
import com.yihu.jw.sms.util.ykyy.client.SmsClient;
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
/**
 * 获取上行记录示例
 */
public class GetMo {
	public static void main(String[] args) {
		String custCode = "xxxxx";							 //[必填] 用户账号
		String password = "xxxxxxxx";						 //[必填] 账号密码
		String serviceBaseUrl = "http://ip:port"; 			 //[必填] http://ip:port
		SmsClient smsClient = new SmsClient();
		ResultMsg resultMsg = smsClient.getMo(custCode, password, serviceBaseUrl);
		if (resultMsg.isSuccess()) { 
			/**
			 * 成功返回json数组字符串,data数据如下:
			 * [
				    {
				        "smsLabel": "",
				        "recv_time": "2017-12-22 09:57:41",
				        "msg_content": "ddcfffffcf",
				        "sp_code": "106903510107281",
				        "src_mobile": "13489080110",
				        "msg_id": "-3807905081491652607"
				    },
				    {
				        "smsLabel": "",
				        "recv_time": "2017-12-22 09:57:44",
				        "msg_content": "sscgvcd",
				        "sp_code": "106903510107281",
				        "src_mobile": "13489080110",
				        "msg_id": "-3807904256858324992"
				    }
				]
			 */
			System.out.println(resultMsg.getData());
		} else {
			/**
			 * 1000:服务器出现未知异常!
			 * 1001 操作不合法,操作前未获取Token,或Token已过时
			 * 1002 签名验证不通过!
			 * 1003Json参数解析出错
			 * 1004 操作不合法,cust_code: xxxxxx不存在
			 */
			System.out.println(resultMsg.getCode());
			System.out.println(resultMsg.getMsg());
		}
	}
}

+ 45 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/demo/GetReport.java

@ -0,0 +1,45 @@
package com.yihu.jw.sms.util.ykyy.demo;
import com.yihu.jw.sms.util.ykyy.client.SmsClient;
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
/**
 * 获取状态报告示例
 */
public class GetReport {
	public static void main(String[] args) {
		String custCode = "xxxxx";							 //[必填] 用户账号
		String password = "xxxxxxxx";						 //[必填] 账号密码
		String serviceBaseUrl = "http://ip:port"; 			 //[必填] http://ip:port
		SmsClient smsClient = new SmsClient();
		ResultMsg resultMsg = smsClient.getReport(custCode, password, serviceBaseUrl);
		if (resultMsg.isSuccess()) {
			/**
			 * 成功返回json数组字符串,data数据如下:
			 * [
				    {
				        "msgid": "59106412211644219176",
				        "mobile": "1348908xxxx",
				        "report_status": "SUCCESS",
				        "report": "DELIVRD",
				        "uid": "1123344567",
				        "recv_time": "2017-12-21 16:44:31"
				    }
				]
			 */
			System.out.println(resultMsg.getData());
		} else {
			/**
			 * 1000:服务器出现未知异常!
			 * 1001 操作不合法,操作前未获取Token,或Token已过时
			 * 1002 签名验证不通过!
			 * 1003Json参数解析出错
			 * 1004 操作不合法,cust_code: xxxxxx不存在
			 */
			System.out.println(resultMsg.getCode());
			System.out.println(resultMsg.getMsg());
		}
	}
}

+ 41 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/demo/QueryAccount.java

@ -0,0 +1,41 @@
package com.yihu.jw.sms.util.ykyy.demo;
import com.yihu.jw.sms.util.ykyy.client.SmsClient;
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
/**
 * 查询账户余额示例
 */
public class QueryAccount {
	public static void main(String[] args) {
		String custCode = "xxxxx";							 //[必填] 用户账号
		String password = "xxxxxxxx";						 //[必填] 账号密码
		String serviceBaseUrl = "http://ip:port"; 			 //[必填] http://ip:port
		SmsClient smsClient = new SmsClient();
		ResultMsg resultMsg = smsClient.queryAccount(custCode, password, serviceBaseUrl);
		if (resultMsg.isSuccess()) {
			/**
			 * 成功返回json对象字符串,data数据如下:
			 * {
				    "cust_code": "096522",
				    "sms_balance": 9950,
				    "status": "1"
				}
			 */
			System.out.println(resultMsg.getData());
		} else {
			/**
			 * 1000:服务器出现未知异常!
			 * 1001 操作不合法,操作前未获取Token,或Token已过时
			 * 1002 签名验证不通过!
			 * 1003Json参数解析出错
			 * 1004 操作不合法,cust_code: xxxxxx不存在
			 */
			System.out.println(resultMsg.getCode());
			System.out.println(resultMsg.getMsg());
		}
	}
}

+ 96 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/demo/SendSms.java

@ -0,0 +1,96 @@
package com.yihu.jw.sms.util.ykyy.demo;
import com.yihu.jw.sms.util.ykyy.client.SmsClient;
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
import com.yihu.jw.sms.util.ykyy.vo.SmsReq;
/**
 * 普通短信发送示例
 * 两种方式:
 * 		1.通过SmsReq对象传参
 * 		2.直接传参
 */
public class SendSms {
	public static void main(String[] args) {
		String custCode = "300643";							 //[必填] 用户账号
		String password = "T9IHN69DDF";						 //[必填] 账号密码
		String serviceBaseUrl = "https://smsapp.wlwx.com"; 			 //[必填] http://ip:port
		/**
		 * 1.通过SmsReq对象传参
		 */
		
		SmsReq smsReq = new SmsReq();
		smsReq.setUid("");							//[选填] 业务标识,由贵司自定义32为数字透传至我司
		smsReq.setCust_code(custCode);				//[必填] 用户账号
		smsReq.setContent("您正在登录,登陆验证码为561445,请在15分钟内按照页面提示填写验证码,切勿将验证码泄露给他人。");				//[必填] 短信内容
		smsReq.setDestMobiles("15859693131");		//[必填] 接收号码,同时发送给多个号码时,号码之间用英文半角逗号分隔(,)
		smsReq.setNeed_report("yes");				//[选填] 状态报告需求与否,是 yes 否 no 默认yes
		smsReq.setSp_code("");						//[选填] 长号码
		smsReq.setMsgFmt("8");						//[选填] 信息格式,0:ASCII串;3:短信写卡操作;4:二进制信息;8:UCS2编码;默认8
		SmsClient smsClient = new SmsClient();
		ResultMsg resultMsg = smsClient.sendSms(smsReq, password, serviceBaseUrl);
		if (resultMsg.isSuccess()) {
			/**
			 * 成功返回json对象字符串,data数据如下:
			 * {
				    "uid": "1123344567",
				    "status": "success",
				    "respCode": "0",
				    "respMsg": "提交成功!",
				    "totalChargeNum": 1,
				    "result": [
				        {
				            "msgid": "59106312221352221524",
				            "mobile": "1348908xxxx",
				            "code": "0",
				            "msg": "提交成功.",
				            "chargeNum": 1
				        }
				    ]
				}
			 */
			System.out.println(resultMsg.getData());
		} else {
			/**
			 *  1000:服务器出现未知异常!
			 *  1001 操作不合法,操作前未获取Token,或Token已过时
			 *	1002 签名验证不通过!
			 *	1003 Json参数解析出错
			 *	1004 操作不合法,cust_code: xxxxxx不存在
			 *	1005 客户端IP鉴权不通过
			 *	1006 客户账号已停用!
			 *	1008 客户提交接口协议HTTP, 与客户参数允许的协议不一致!
			 *	1009 提交的短信内容超过规定的长度!
			 *	1011 客户账户不存在!
			 *	1012 账户没有足够的余额
			 *	1013 扩展号码(sp_code)不符合规范!
			 */
			System.out.println(resultMsg.getCode());
			System.out.println(resultMsg.getMsg());
		}
		
		/**
		 * 2.直接传参
		 */
//		String uid = "1123344567";
//		String content = "短信内容";
//		String destMobiles = "13489080110,13489080111";
//		String needReport = "yes";
//		String spCode = "";
//		String msgFmt = "8";
//
//		SmsClient smsClient1 = new SmsClient();
//		ResultMsg resultMsg1 = smsClient1.sendSms(uid, custCode, content, destMobiles,
//				needReport, spCode, msgFmt, serviceBaseUrl, password);
//		if (resultMsg1.isSuccess()) {
//			System.out.println(resultMsg1.getData());
//		} else {
//			System.out.println(resultMsg1.getCode());
//			System.out.println(resultMsg1.getMsg());
//		}
		
	}
}

文件差异内容过多而无法显示
+ 109 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/demo/SendVariantSms.java


+ 57 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/util/HttpClient.java

@ -0,0 +1,57 @@
package com.yihu.jw.sms.util.ykyy.util;
import java.io.ByteArrayOutputStream;
import java.io.DataOutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.security.KeyManagementException;
import java.security.NoSuchAlgorithmException;
/**
 * http客户端工具
 */
public class HttpClient {
	
	/**
	 * post方式请求服务器(http协议)
	 * 
	 * @param url
	 *            请求地址
	 * @param content
	 *            参数
	 * @param charset
	 *            编码
	 * @return
	 * @throws NoSuchAlgorithmException
	 * @throws KeyManagementException
	 * @throws IOException
	 */
	public static String post(String url, String content, String contentType,
			String charset) throws NoSuchAlgorithmException, KeyManagementException,
			IOException {
		HttpURLConnection conn = (HttpURLConnection) (new URL(url)).openConnection();
		conn.setRequestProperty("Content-Type", contentType);
		conn.setDoOutput(true);
		conn.connect();
		DataOutputStream out = new DataOutputStream(conn.getOutputStream());
		out.write(content.getBytes(charset));
		// 刷新、关闭
		out.flush();
		out.close();
		InputStream is = conn.getInputStream();
		if (is != null) {
			ByteArrayOutputStream outStream = new ByteArrayOutputStream();
			byte[] buffer = new byte[1024];
			int len = 0;
			while ((len = is.read(buffer)) != -1) {
				outStream.write(buffer, 0, len);
			}
			is.close();
			String rspStr = outStream.toString(charset);
			return rspStr;
		}
		return null;
	}
}

+ 29 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/util/MD5.java

@ -0,0 +1,29 @@
package com.yihu.jw.sms.util.ykyy.util;
public class MD5 {
	public static String getMD5(byte[] source) {
		String s = null;
		char hexDigits[] = { // 用来将字节转换成 16 进制表示的字符
		'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
		try {
			java.security.MessageDigest md = java.security.MessageDigest
					.getInstance("MD5");
			md.update(source);
			byte tmp[] = md.digest(); // MD5 的计算结果是一个 128 位的长整数,
										// 用字节表示就是 16 个字节
			char str[] = new char[16 * 2]; // 每个字节用 16 进制表示的话,使用两个字符,
											// 所以表示成 16 进制需要 32 个字符
			int k = 0; // 表示转换结果中对应的字符位置
			for (int i = 0; i < 16; i++) { // 从第一个字节开始,对 MD5 的每一个字节
											// 转换成 16 进制字符的转换
				byte byte0 = tmp[i]; // 取第 i 个字节
				str[k++] = hexDigits[byte0 >>> 4 & 0xf]; // 取字节中高 4 位的数字转换,>>>为逻辑右移,将符号位一起右移
				str[k++] = hexDigits[byte0 & 0xf]; // 取字节中低 4 位的数字转换
			}
			s = new String(str); // 换后的结果转换为字符串
		} catch (Exception e) {
			e.printStackTrace();
		}
		return s;
	}
}

+ 30 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/vo/GetTokenResp.java

@ -0,0 +1,30 @@
package com.yihu.jw.sms.util.ykyy.vo;
/**
 * token对象实体
 */
public class GetTokenResp {
	
	private String token_id;
	private String token;
	
	public GetTokenResp(){}
	
	public GetTokenResp(String token_id, String token){
		this.token_id = token_id;
		this.token = token;
	}
	public String getToken_id() {
		return token_id;
	}
	public void setToken_id(String token_id) {
		this.token_id = token_id;
	}
	public String getToken() {
		return token;
	}
	public void setToken(String token) {
		this.token = token;
	}
	
}

+ 44 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/vo/QueryReq.java

@ -0,0 +1,44 @@
package com.yihu.jw.sms.util.ykyy.vo;
/**
 * 请求对象实体
 */
public class QueryReq {
	
	private String cust_code;//客户账号
	private String sendtime;
	private String token_id;//token编号 10位
	private String mobile;
	private String sign;//数字签名
	public String getCust_code() {
		return cust_code;
	}
	public void setCust_code(String cust_code) {
		this.cust_code = cust_code;
	}
	public String getSendtime() {
		return sendtime;
	}
	public void setSendtime(String sendtime) {
		this.sendtime = sendtime;
	}
	public String getToken_id() {
		return token_id;
	}
	public void setToken_id(String token_id) {
		this.token_id = token_id;
	}
	public String getMobile() {
		return mobile;
	}
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	public String getSign() {
		return sign;
	}
	public void setSign(String sign) {
		this.sign = sign;
	}
	
}

+ 64 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/vo/ResultMsg.java

@ -0,0 +1,64 @@
package com.yihu.jw.sms.util.ykyy.vo;
/**
 * 结果对象
 */
public class ResultMsg {
	private boolean success;//是否成功 true:成功 false:失败
	private String code;//错误码
	private String msg;//异常信息
	private String data;//数据集
	
	/**
	 * true 成功  false 失败
	 * @return boolean
	 */
	public boolean isSuccess() {
		return success;
	}
	public void setSuccess(boolean success) {
		this.success = success;
	}
	/**
	 *  1000 服务器出现未知异常!
	 *  1001 操作不合法,操作前未获取Token,或Token已过时
	 *	1002 签名验证不通过!
	 *	1003Json参数解析出错
	 *	1004 操作不合法,cust_code: xxxxxx不存在
	 *	1005 客户端IP鉴权不通过
	 *	1006 客户账号已停用!
	 *	1008 客户提交接口协议HTTP, 与客户参数允许的协议不一致!
	 *	1009 提交的短信内容超过规定的长度!
	 *	1011 客户账户不存在!
	 *	1012 账户没有足够的余额
	 *	1013 扩展号码(sp_code)不符合规范!
	 */
	public String getCode() {
		return code;
	}
	public void setCode(String code) {
		this.code = code;
	}
	/**
	 * 错误信息描述
	 * @return msg
	 */
	public String getMsg() {
		return msg;
	}
	public void setMsg(String msg) {
		this.msg = msg;
	}
	/**
	 * 数据结果 json字符串
	 * @return String
	 */
	public String getData() {
		return data;
	}
	public void setData(String data) {
		this.data = data;
	}
	
	
}

+ 66 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/vo/SmsReq.java

@ -0,0 +1,66 @@
package com.yihu.jw.sms.util.ykyy.vo;
/**
 * 发送短信对象实体 
 */
public class SmsReq {
	
	private String uid = ""; 			//业务标识[选填],由贵司自定义32为数字透传至我司
	private String content = ""; 		//短信内容[必填]
	private String destMobiles = ""; 	//接收号码[必填],同时发送给多个号码时,号码之间用英文半角逗号分隔(,)
	private String cust_code = ""; 		//用户账号[必填]
	private String sp_code = ""; 		//长号码[选填]
	private String need_report = ""; 	//状态报告需求与否[选填],是 yes 否 no 默认yes
	private String sign = ""; 			//数字签名[必填],签名内容根据 “短信内容+客户密码”进行MD5编码后获得。
	private String msgFmt = "8"; 		//信息格式[选填],0:ASCII串;3:短信写卡操作;4:二进制信息;8:UCS2编码;
	
	public String getUid() {
		return uid;
	}
	public void setUid(String uid) {
		this.uid = uid;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public String getDestMobiles() {
		return destMobiles;
	}
	public void setDestMobiles(String destMobiles) {
		this.destMobiles = destMobiles;
	}
	public String getCust_code() {
		return cust_code;
	}
	public void setCust_code(String cust_code) {
		this.cust_code = cust_code;
	}
	public String getSp_code() {
		return sp_code;
	}
	public void setSp_code(String sp_code) {
		this.sp_code = sp_code;
	}
	public String getNeed_report() {
		return need_report;
	}
	public void setNeed_report(String need_report) {
		this.need_report = need_report;
	}
	public String getSign() {
		return sign;
	}
	public void setSign(String sign) {
		this.sign = sign;
	}
	public String getMsgFmt() {
		return msgFmt;
	}
	public void setMsgFmt(String msgFmt) {
		this.msgFmt = msgFmt;
	}
	
}

+ 25 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/vo/VariantParams.java

@ -0,0 +1,25 @@
package com.yihu.jw.sms.util.ykyy.vo;
/**
 * 变量短信对象实体
 */
public class VariantParams {
	private String mobile;		//手机号码
	private String[] vars;		//变量内容 
	public String getMobile() {
		return mobile;
	}
	public void setMobile(String mobile) {
		this.mobile = mobile;
	}
	public String[] getVars() {
		return vars;
	}
	public void setVars(String[] vars) {
		this.vars = vars;
	}
}

文件差异内容过多而无法显示
+ 78 - 0
business/sms-service/src/main/java/com/yihu/jw/sms/util/ykyy/vo/VariantSmsReq.java


+ 4 - 4
common/common-entity/src/main/java/com/yihu/jw/entity/IntegerIdentityEntity.java

@ -18,13 +18,13 @@ public abstract class IntegerIdentityEntity implements Serializable {
    @Id
    @Id
//==========mysql 环境 id策略======================================================
//==========mysql 环境 id策略======================================================
    @GeneratedValue(generator = "generator")
    @GenericGenerator(name = "generator", strategy = "identity")
    @Column(name = "id", unique = true, nullable = false)
//    @GeneratedValue(generator = "generator")
//    @GenericGenerator(name = "generator", strategy = "identity")
//    @Column(name = "id", unique = true, nullable = false)
//==========mysql 环境 id策略 end======================================================
//==========mysql 环境 id策略 end======================================================
//==========Oracle 环境id策略 =========================================================
//==========Oracle 环境id策略 =========================================================
//    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="id_generated")
//==========Oracle 环境id策略 =========================================================
//==========Oracle 环境id策略 =========================================================
    public Integer getId() {
    public Integer getId() {
        return id;
        return id;

+ 4 - 3
common/common-entity/src/main/java/com/yihu/jw/entity/base/wx/BasePatientWechatDo.java

@ -6,6 +6,7 @@ import com.yihu.jw.entity.UuidIdentityEntityWithOperator;
import javax.persistence.Column;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Table;
import java.util.Date;
/**
/**
 * @author huangwenjie
 * @author huangwenjie
@ -20,7 +21,7 @@ public class BasePatientWechatDo extends UuidIdentityEntity {
	private String patientId;
	private String patientId;
	private String openid;
	private String openid;
	private String unionid;
	private String unionid;
	private String createTime;
	private Date createTime;
	
	
	@Column(name = "saas_id")
	@Column(name = "saas_id")
	public String getSaasId() {
	public String getSaasId() {
@ -66,11 +67,11 @@ public class BasePatientWechatDo extends UuidIdentityEntity {
	}
	}
	
	
	@Column(name = "create_time")
	@Column(name = "create_time")
	public String getCreateTime() {
	public Date getCreateTime() {
		return createTime;
		return createTime;
	}
	}
	
	
	public void setCreateTime(String createTime) {
	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
		this.createTime = createTime;
	}
	}
}
}

+ 44 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/dao/patient/BasePatientMedicareCardDao.java

@ -0,0 +1,44 @@
package com.yihu.jw.security.dao.patient;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
import java.util.Set;
/**
 * Created by Trick on 2018/8/31.
 */
public interface BasePatientMedicareCardDao extends PagingAndSortingRepository<PatientMedicareCardDO, Integer>, JpaSpecificationExecutor<PatientMedicareCardDO> {
    List<PatientMedicareCardDO> findByPatientCode(String patientCode);
    @Query("select id from PatientMedicareCardDO where patientCode = ?1")
    Set<Object> findIdListByPatientCode(String patientCode);
    PatientMedicareCardDO findByCode(String code);
    PatientMedicareCardDO findByTypeAndPatientCodeAndDel(String Type, String patientCode, String del);
    boolean existsByCodeAndDel(String code, String del);
    /**
     * 校验就诊卡号是否存在,就诊卡号有机构code,每个机构的就诊卡相互独立
     * @param code
     * @param orgCode
     * @param del
     * @return
     */
    boolean existsByCodeAndOrgCodeAndDel(String code, String orgCode, String del);
    /**
     * 一个居民在一家医院(机构)只能有一张就诊卡
     * @param patientCode
     * @param orgCode
     * @param del
     * @return
     */
    boolean existsByPatientCodeAndOrgCodeAndDel(String patientCode, String orgCode, String del);
}

+ 17 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/dao/patient/BasePatientWechatDao.java

@ -0,0 +1,17 @@
package com.yihu.jw.security.dao.patient;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by Trick on 2020/3/18.
 */
public interface BasePatientWechatDao extends
        PagingAndSortingRepository<BasePatientWechatDo, String>,
        JpaSpecificationExecutor<BasePatientWechatDo> {
    List<BasePatientWechatDo> findByWechatIdAndPatientId (String wechatid, String patientId);
}

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

@ -23,7 +23,9 @@ import com.yihu.jw.security.service.*;
import com.yihu.jw.security.utils.AES;
import com.yihu.jw.security.utils.AES;
import com.yihu.jw.security.utils.DateUtil;
import com.yihu.jw.security.utils.DateUtil;
import com.yihu.jw.security.utils.SerializeUtil;
import com.yihu.jw.security.utils.SerializeUtil;
import com.yihu.jw.sms.service.YkyySMSService;
import com.yihu.jw.sms.service.ZhongShanSMSService;
import com.yihu.jw.sms.service.ZhongShanSMSService;
import com.yihu.jw.sms.util.ykyy.vo.ResultMsg;
import com.yihu.utils.security.RSAUtils;
import com.yihu.utils.security.RSAUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperation;
@ -126,7 +128,10 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
    private OauthWjwConfigService oauthWjwConfigService;
    private OauthWjwConfigService oauthWjwConfigService;
    @Autowired
    @Autowired
    private OauthSsoService oauthSsoService;
    private OauthSsoService oauthSsoService;
    @Autowired
    private YkyySMSService ykyySMSService;
    @Autowired
    private RegisterService registerService;
    @PostConstruct
    @PostConstruct
    private void init() {
    private void init() {
@ -438,6 +443,12 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        return new ResponseEntity<>(oauth2Envelop, headers, HttpStatus.OK);*/
        return new ResponseEntity<>(oauth2Envelop, headers, HttpStatus.OK);*/
    }
    }
    /**
     * 中山医院短信接口
     * @param parameters
     * @return
     * @throws Exception
     */
    @RequestMapping(value = "/oauth/sendZSCaptcha", method = RequestMethod.GET)
    @RequestMapping(value = "/oauth/sendZSCaptcha", method = RequestMethod.GET)
    public ResponseEntity<Oauth2Envelop<Captcha>> sendZSCaptcha(@RequestParam Map<String, String> parameters) throws Exception {
    public ResponseEntity<Oauth2Envelop<Captcha>> sendZSCaptcha(@RequestParam Map<String, String> parameters) throws Exception {
        String client_id = parameters.get("client_id");
        String client_id = parameters.get("client_id");
@ -472,6 +483,41 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        throw new IllegalStateException("验证码发送失败!");
        throw new IllegalStateException("验证码发送失败!");
    }
    }
    //眼科医院短信验证码
    @RequestMapping(value = "/oauth/sendYKCaptcha", method = RequestMethod.GET)
    public ResponseEntity<Oauth2Envelop<Captcha>> sendYKCaptcha(@RequestParam Map<String, String> parameters) throws Exception {
        String client_id = parameters.get("client_id");
        String username = parameters.get("username");
        if (StringUtils.isEmpty(client_id)) {
            throw new InvalidRequestException("client_id");
        }
        if (StringUtils.isEmpty(username)) {
            throw new InvalidRequestException("username");
        }
        //验证请求间隔超时,防止频繁获取验证码
        if (!wlyyRedisVerifyCodeService.isIntervalTimeout(client_id, username)) {
            throw new IllegalAccessException("SMS request frequency is too fast");
        }
        //发送短信获取验证码
        String captcha = wlyyRedisVerifyCodeService.getCodeNumber();
        ResultMsg result=  ykyySMSService.ykyySendSMS(username,"您好,你的手机登录短信验证码是:"+captcha+",5分钟内有效。");
        if (result.isSuccess()) {
            Captcha _captcha = new Captcha();
            _captcha.setCode(captcha);
            _captcha.setExpiresIn(300);
            wlyyRedisVerifyCodeService.store(client_id, username, captcha, 300);
            Oauth2Envelop<Captcha> oauth2Envelop = new Oauth2Envelop<>("captcha", 200, _captcha);
            HttpHeaders headers = new HttpHeaders();
            headers.set("Cache-Control", "no-store");
            headers.set("Pragma", "no-cache");
            return new ResponseEntity<>(oauth2Envelop, headers, HttpStatus.OK);
        }
        throw new IllegalStateException("验证码发送失败!");
    }
    /**
    /**
     * 验证验证码
     * 验证验证码
     *
     *
@ -1164,4 +1210,68 @@ public class WlyyLoginEndpoint extends AbstractEndpoint {
        return ObjEnvelop.getError("登录失败!");
        return ObjEnvelop.getError("登录失败!");
    }
    }
    @RequestMapping(value = "/oauth/registerPatientAndLogin", method = RequestMethod.POST)
    public ObjEnvelop registerPatientAndLogin(String name, String mobile, String idcard, String ssc, String pw,String client_id,String login_type)throws Exception{
        if (StringUtils.isEmpty(client_id)) {
            throw new InvalidRequestException("client_id is null");
        }
        try {
            Map<String,Object> rs = registerService.registerPatient(name,mobile,idcard,ssc,pw);
            String code = rs.get("code").toString();
            if("1".equals(code)){
                ObjEnvelop objEnvelop = new ObjEnvelop();
                objEnvelop.setObj(rs);
                objEnvelop.setStatus(-1);
                objEnvelop.setMessage("用户已存在!");
                return objEnvelop;
            }
            BasePatientDO patientDO = (BasePatientDO)rs.get("patient");
            ClientDetails authenticatedClient = clientDetailsService.loadClientByClientId(client_id);
            Map<String, String> parameters = new HashedMap();
            parameters.put("username",patientDO.getIdcard());
            parameters.put("grant_type", "ihealthCode");
            TokenRequest tokenRequest = oAuth2RequestFactory.createTokenRequest(parameters, authenticatedClient);
            if (authenticatedClient != null) {
                oAuth2RequestValidator.validateScope(tokenRequest, authenticatedClient);
            }
            OAuth2AccessToken token = getTokenGranter().grant(tokenRequest.getGrantType(), tokenRequest);
            if (token == null) {
                throw new UnsupportedGrantTypeException("Unsupported grant type: " + tokenRequest.getGrantType());
            }
            WlyyUserSimple wlyyUserSimple = userDetailsService.authSuccess(parameters.get("username"));
            wlyyUserSimple.setAccessToken(token.getValue());
            wlyyUserSimple.setTokenType(token.getTokenType());
            wlyyUserSimple.setExpiresIn(token.getExpiresIn());
            wlyyUserSimple.setRefreshToken(token.getRefreshToken().getValue());
            wlyyUserSimple.setUser(parameters.get("username"));
            String loginType = parameters.get("login_type");
            BaseLoginLogDO baseLoginLogDO = new BaseLoginLogDO();
            userDetailsService.setRolePhth(loginType, token, wlyyUserSimple.getId(), redisTemplate);
            baseLoginLogDO.setUserId(wlyyUserSimple.getId());
            baseLoginLogDO.setCreateTime(new Date());
            String userAgent = JSONObject.toJSONString(wlyyUserSimple);
            baseLoginLogDO.setUserAgent(userAgent);
            baseLoginLogDO.setLoginType(loginType);
            baseLoginLogService.save(baseLoginLogDO);
            return ObjEnvelop.getSuccess("success",wlyyUserSimple);
        }catch (Exception e){
            logger.error(e);
        }
        return ObjEnvelop.getError("登录失败!");
    }
}
}

+ 14 - 3
server/svr-authentication/src/main/java/com/yihu/jw/security/service/OauthSsoService.java

@ -4,8 +4,10 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.entity.auth.OauthRsaKeyDO;
import com.yihu.jw.entity.auth.OauthRsaKeyDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.wx.BasePatientWechatDo;
import com.yihu.jw.security.dao.OauthRsaKeyDao;
import com.yihu.jw.security.dao.OauthRsaKeyDao;
import com.yihu.jw.security.dao.patient.BasePatientDao;
import com.yihu.jw.security.dao.patient.BasePatientDao;
import com.yihu.jw.security.dao.patient.BasePatientWechatDao;
import com.yihu.jw.security.utils.IdCardUtil;
import com.yihu.jw.security.utils.IdCardUtil;
import com.yihu.jw.security.utils.RSAEncrypt;
import com.yihu.jw.security.utils.RSAEncrypt;
import com.yihu.utils.security.MD5;
import com.yihu.utils.security.MD5;
@ -30,13 +32,16 @@ public class OauthSsoService {
    Logger logger = LoggerFactory.getLogger(OauthSsoService.class);
    Logger logger = LoggerFactory.getLogger(OauthSsoService.class);
    @Autowired
    @Autowired
    private OauthRsaKeyDao rsaKeyDao;
    private OauthRsaKeyDao rsaKeyDao;
    @Autowired
    @Autowired
    private BasePatientDao basePatientDao;
    private BasePatientDao basePatientDao;
    @Autowired
    private  BasePatientWechatDao basePatientWechatDao;
    public String getAuthCode()throws Exception{
    public String getAuthCode()throws Exception{
        JSONObject jsonObject = new JSONObject();
        JSONObject jsonObject = new JSONObject();
@ -80,6 +85,7 @@ public class OauthSsoService {
        String name = info.getString("name");
        String name = info.getString("name");
        String idcard = info.getString("idcard");
        String idcard = info.getString("idcard");
        String mobile = info.getString("mobile");
        String mobile = info.getString("mobile");
        String openid = info.getString("openid");
        if(StringUtils.isNotBlank(idcard)){
        if(StringUtils.isNotBlank(idcard)){
@ -107,9 +113,14 @@ public class OauthSsoService {
            patient.setBirthday(IdCardUtil.getBirthdayForIdcard(idcard));
            patient.setBirthday(IdCardUtil.getBirthdayForIdcard(idcard));
            patient.setSex(Integer.parseInt(IdCardUtil.getSexForIdcard_new(idcard)));
            patient.setSex(Integer.parseInt(IdCardUtil.getSexForIdcard_new(idcard)));
            basePatientDao.save(patient);
            BasePatientDO temp = basePatientDao.save(patient);
            return basePatientDO;
            //保存openid
            BasePatientWechatDo wechatDo = new BasePatientWechatDo();
            wechatDo.setOpenid(openid);
            wechatDo.setPatientId(temp.getId());
            wechatDo.setWechatId(appId);
            basePatientWechatDao.save(wechatDo);
        }
        }
        return null;
        return null;

+ 81 - 0
server/svr-authentication/src/main/java/com/yihu/jw/security/service/RegisterService.java

@ -0,0 +1,81 @@
package com.yihu.jw.security.service;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.security.dao.patient.BasePatientDao;
import com.yihu.jw.security.dao.patient.BasePatientMedicareCardDao;
import com.yihu.jw.security.utils.IdCardUtil;
import com.yihu.utils.security.MD5;
import org.apache.commons.collections.map.HashedMap;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
/**
 * Created by Trick on 2020/3/19.
 */
@Service
@Transactional
public class RegisterService {
    @Autowired
    private BasePatientDao basePatientDao;
    @Autowired
    private BasePatientMedicareCardDao basePatientMedicareCardDao;
    public Map<String,Object> registerPatient(String name, String mobile, String idcard, String ssc, String pw)throws Exception{
        Map<String,Object> rs = new HashedMap();
        BasePatientDO p1 = basePatientDao.findByIdcardAndDel(idcard,"1");
        if(p1!=null){
            rs.put("code","-1");
            rs.put("mes","idcard isExist");
        }
        List<BasePatientDO> p2 = basePatientDao.findByMobileAndDel(mobile,"1");
        if(p2!=null&&p2.size()>0){
            rs.put("code","-2");
            rs.put("mes","mobile isExist");
        }
        BasePatientDO patient = new BasePatientDO();
        String salt = UUID.randomUUID().toString().substring(0,5);
        patient.setIdcard(idcard);
        patient.setName(name);
        patient.setPassword(MD5.md5Hex(pw + "{" + salt + "}"));
        patient.setSalt(salt);
        patient.setMobile(mobile);
        patient.setDel("1");
        patient.setEnabled(1);
        patient.setLocked(0);
        patient.setCreateTime(new Date());
        patient.setUpdateTime(new Date());
        patient.setBirthday(IdCardUtil.getBirthdayForIdcard(idcard));
        patient.setSex(Integer.parseInt(IdCardUtil.getSexForIdcard_new(idcard)));
        BasePatientDO temp = basePatientDao.save(patient);
        PatientMedicareCardDO medicareCardDO = new PatientMedicareCardDO();
        medicareCardDO.setDel("1");
        medicareCardDO.setType(PatientMedicareCardDO.Type.MedicareCard.getType());
        medicareCardDO.setCode(ssc);
        medicareCardDO.setPatientCode(temp.getId());
        basePatientMedicareCardDao.save(medicareCardDO);
        rs.put("code","1");
        rs.put("mes","ok");
        rs.put("patient",temp);
        return rs;
    }
}

+ 7 - 0
svr/svr-internet-hospital-entrance/src/main/java/com/yihu/jw/entrance/controller/XzzxCotroller.java

@ -0,0 +1,7 @@
package com.yihu.jw.entrance.controller;
/**
 * Created by Trick on 2020/3/18.
 */
public class XzzxCotroller {
}

+ 4 - 4
svr/svr-internet-hospital-job/pom.xml

@ -51,10 +51,10 @@
            <artifactId>spring-cloud-starter-eureka</artifactId>
            <artifactId>spring-cloud-starter-eureka</artifactId>
        </dependency>
        </dependency>
        <!--注释掉就不会读取git的配置,只会读取yml中的配置-->
        <!--注释掉就不会读取git的配置,只会读取yml中的配置-->
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-config</artifactId>
        </dependency>
        <!--<dependency>-->
            <!--<groupId>org.springframework.cloud</groupId>-->
            <!--<artifactId>spring-cloud-starter-config</artifactId>-->
        <!--</dependency>-->
        <dependency>
        <dependency>
            <groupId>org.json</groupId>
            <groupId>org.json</groupId>

+ 5 - 1
svr/svr-internet-hospital-job/src/main/java/com/yihu/jw/web/quota/JobController.java

@ -466,5 +466,9 @@ public class JobController extends BaseController {
            return error(-1, "执行失败");
            return error(-1, "执行失败");
        }
        }
    }
    }
    @RequestMapping(value = "/testImg", method = RequestMethod.GET)
    @ApiOperation("测试图片")
    public String testImg(String path) {
      return write(200, ykyyInternetService.testImg(path));
    }
}
}

+ 22 - 3
svr/svr-internet-hospital-job/src/main/resources/application.yml

@ -52,6 +52,17 @@ FileTempPath:
  voice_path : /var/local/upload/voice
  voice_path : /var/local/upload/voice
  chat_file_path : /var/local/upload/chat
  chat_file_path : /var/local/upload/chat
#发现服务
eureka:
  client:
    healthcheck:
      enabled: false #监控检查
    serviceUrl:
      defaultZone: http://jw:jkzl@127.0.0.1:8761/eureka/
  instance:
    prefer-ip-address: false
#    instance-id: ${spring.cloud.client.ipAddress}:${server.port}
---
---
spring:
spring:
  profiles: jwdev
  profiles: jwdev
@ -78,6 +89,8 @@ fastDFS:
  fastdfs_file_url: http://172.26.0.110:8888/
  fastdfs_file_url: http://172.26.0.110:8888/
wechat:
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
---
---
spring:
spring:
  profiles: jwtest
  profiles: jwtest
@ -106,6 +119,8 @@ wlyy:
  url: http://www.xmtyw.cn/wlyytest/
  url: http://www.xmtyw.cn/wlyytest/
wechat:
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
---
---
spring:
spring:
  profiles: jwOracleTest
  profiles: jwOracleTest
@ -141,14 +156,16 @@ wlyy:
  url: http://www.xmtyw.cn/wlyytest/
  url: http://www.xmtyw.cn/wlyytest/
wechat:
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
---
---
spring:
spring:
  profiles: jwOracleProd
  profiles: jwOracleProd
  datasource:
  datasource:
    driver-class-name: oracle.jdbc.driver.OracleDriver
    driver-class-name: oracle.jdbc.driver.OracleDriver
    url: jdbc:oracle:thin:@192.168.20.55:1521:orcl
    username: system
    password: hxyk9573
    url: jdbc:oracle:thin:@10.10.10.16:1521/rac
    username: HLWYY
    password: Xmykzxhlwyy963
  jpa:
  jpa:
    properties:
    properties:
      hibernate:
      hibernate:
@ -176,6 +193,8 @@ wlyy:
  url: http://www.xmtyw.cn/wlyytest/
  url: http://www.xmtyw.cn/wlyytest/
wechat:
wechat:
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
  id: d24d1367-7f4f-43af-910e-a0a43799e040  # base库中,wx_wechat 的id字段
---
---
spring:
spring:
  profiles: jwprod
  profiles: jwprod

+ 1 - 1
svr/svr-internet-hospital-job/src/main/resources/bootstrap.yml

@ -34,7 +34,7 @@ spring:
  profiles: jwOracleProd
  profiles: jwOracleProd
  cloud:
  cloud:
    config:
    config:
      uri: ${wlyy.spring.config.uri:http://127.0.0.1:1221}
      uri: ${wlyy.spring.config.uri:http://192.168.33.199:1221}
      label: ${wlyy.spring.config.label:jwdev}
      label: ${wlyy.spring.config.label:jwdev}
---
---
spring:
spring:

+ 2 - 1
svr/svr-internet-hospital-job/src/main/resources/quartz.properties

@ -24,6 +24,7 @@ org.quartz.jobStore.isClustered=false
# RAM
# RAM
# org.quartz.jobStore.class: org.quartz.simpl.RAMJobStore
# org.quartz.jobStore.class: org.quartz.simpl.RAMJobStore
# Configure JobStore Cluster
# Configure JobStore Cluster
org.quartz.jobStore.useProperties = true
org.quartz.jobStore.class:org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.class:org.quartz.impl.jdbcjobstore.JobStoreTX
org.quartz.jobStore.driverDelegateClass:org.quartz.impl.jdbcjobstore.StdJDBCDelegate
org.quartz.jobStore.driverDelegateClass:org.quartz.impl.jdbcjobstore.StdJDBCDelegate
#datasource׺
#datasource׺
@ -40,4 +41,4 @@ org.quartz.jobStore.tablePrefix:QRTZ_
#org.quartz.dataSource.qzDS.password: 123456
#org.quartz.dataSource.qzDS.password: 123456
org.quartz.jobGroupName = RS_JOBGROUP_NAME
org.quartz.jobGroupName = RS_JOBGROUP_NAME
org.quartz.triggerGroupName = RS_TRIGGERGROUP_NAME
org.quartz.triggerGroupName = RS_TRIGGERGROUP_NAME

+ 4 - 3
svr/svr-internet-hospital/src/main/resources/application.yml

@ -77,6 +77,7 @@ express:
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_url: http://bsp-oisp.sf-express.com/bsp-oisp/sfexpressService
  sf_code: JKZL
  sf_code: JKZL
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
  sf_check_word: QkeIfIvQdheqIv2cVSgAUnBU29lfNbVk
---
---
spring:
spring:
  profiles: jwdev
  profiles: jwdev
@ -371,9 +372,9 @@ spring:
  profiles: jwOracleProd
  profiles: jwOracleProd
  datasource:
  datasource:
    driver-class-name: oracle.jdbc.driver.OracleDriver
    driver-class-name: oracle.jdbc.driver.OracleDriver
    url: jdbc:oracle:thin:@172.26.0.141:1521:helowin
    username: normal
    password: normal
    url: jdbc:oracle:thin:@10.10.10.16:1521/rac
    username: HLWYY
    password: Xmykzxhlwyy963
  jpa:
  jpa:
    properties:
    properties:
      hibernate:
      hibernate: