LAPTOP-KB9HII50\70708 пре 2 година
родитељ
комит
f8175f9383

+ 21 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/dao/device/BaseDeviceElectricRecordDao.java

@ -0,0 +1,21 @@
package com.yihu.jw.care.dao.device;
import com.yihu.jw.entity.care.device.BaseDeviceElectricRecordDO;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * Created by yeshijie on 2022/6/30.
 */
public interface BaseDeviceElectricRecordDao extends PagingAndSortingRepository<BaseDeviceElectricRecordDO,String>,
        JpaSpecificationExecutor<BaseDeviceElectricRecordDO> {
    @Query("select a from BaseDeviceElectricRecordDO a where a.statDate = ?1 ")
    List<BaseDeviceElectricRecordDO> findByStatDate(String statDate);
    @Query("select a from BaseDeviceElectricRecordDO a where a.patient = ?1 and a.statDate = ?2")
    List<BaseDeviceElectricRecordDO> findByPatientAndStatDate(String patient,String statDate);
}

+ 17 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/dao/device/BaseHzInterfaceDictDao.java

@ -0,0 +1,17 @@
package com.yihu.jw.care.dao.device;
import com.yihu.jw.entity.util.BaseHzInterfaceDictEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by wsl on 2022/6/29
 */
public interface BaseHzInterfaceDictDao extends PagingAndSortingRepository<BaseHzInterfaceDictEntity,Long>,
        JpaSpecificationExecutor<BaseHzInterfaceDictEntity> {
    @Query("select a from BaseHzInterfaceDictEntity a where a.status = ?1 and a.code = ?2")
    BaseHzInterfaceDictEntity findByStatusAndCode(Integer status,String code);
}

+ 8 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/event/ApplicationEvent.java

@ -209,6 +209,14 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
                logger.info("SYN_FACE_RECORD_JOB success");
            }
            //同步人脸数据,每天8点跑一次
            if (!quartzHelper.isExistJob("SYN_ELECTRIC_RECORD_JOB")){
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("SYN_ELECTRIC_RECORD_JOB");
                quartzHelper.addJob(SynElectricRecordsJob.class, trigger, "SYN_ELECTRIC_RECORD_JOB", new HashMap<String, Object>());
                logger.info("SYN_ELECTRIC_RECORD_JOB success");
            }else {
                logger.info("SYN_ELECTRIC_RECORD_JOB success");
            }
        } catch (Exception e) {
            logger.info(" job start failed");

+ 27 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/job/device/SynElectricRecordsJob.java

@ -0,0 +1,27 @@
package com.yihu.jw.care.job.device;
import com.yihu.jw.care.service.hz.HzInterfaceService;
import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.springframework.beans.factory.annotation.Autowired;
/**
 * 同步人脸记录数据 每天8点跑一次
 * Created by yeshijie on 2022/6/2.
 */
@DisallowConcurrentExecution
public class SynElectricRecordsJob implements Job {
    @Autowired
    private HzInterfaceService hzInterfaceService;
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        try {
            hzInterfaceService.electricityTable(null);
        }catch (Exception e){
            e.printStackTrace();
        }
    }
}

+ 2 - 2
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/service/device/DeviceFaceService.java

@ -35,8 +35,8 @@ public class DeviceFaceService {
                return;
            }
            String response = httpClientUtil.get(url,"utf-8");
            logger.info("请求设备工程人脸数据:type="+type+",response"+response);
//            String response = httpClientUtil.get(url,"utf-8");
//            logger.info("请求设备工程人脸数据:type="+type+",response"+response);
        }catch (Exception e){
            e.printStackTrace();
        }

+ 210 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/service/hz/HzInterfaceService.java

@ -0,0 +1,210 @@
package com.yihu.jw.care.service.hz;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.dao.device.BaseDeviceElectricRecordDao;
import com.yihu.jw.care.dao.device.BaseHzInterfaceDictDao;
import com.yihu.jw.care.dao.device.PatientDeviceDao;
import com.yihu.jw.care.util.DSLUtils;
import com.yihu.jw.care.util.HttpToolUtil;
import com.yihu.jw.care.util.MD5Utils;
import com.yihu.jw.entity.care.device.BaseDeviceElectricRecordDO;
import com.yihu.jw.entity.care.device.DevicePatientDevice;
import com.yihu.jw.entity.util.BaseHzInterfaceDictEntity;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.HttpMethod;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
import java.util.concurrent.TimeUnit;
/**
 * Created by wsl on 2022/6/29
 */
@Service
public class HzInterfaceService {
    Logger logger = LoggerFactory.getLogger(HzInterfaceService.class);
    @Autowired
    private StringRedisTemplate redisTemplate;
    @Autowired
    private BaseHzInterfaceDictDao baseHzInterfaceDictDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Autowired
    private HttpClientUtil httpClientUtil;
    @Autowired
    private PatientDeviceDao patientDeviceDao;
    @Autowired
    private BaseDeviceElectricRecordDao baseDeviceElectricRecordDao;
    /**
     * 同步居民电表数据
     * @param queryDate
     * @return
     */
    public void electricityTable(String queryDate){
        try {
            List<BaseDeviceElectricRecordDO> list = new ArrayList<>();
            if(StringUtils.isBlank(queryDate)){
                queryDate = DateUtil.getStringDateShort();
            }
            list = baseDeviceElectricRecordDao.findByStatDate(queryDate);
            if(list.size()>0){
                logger.info("当天数据已同步,请勿重复操作:"+queryDate);
                return;
            }
            Map<String,Integer> map = new HashMap<>();
            JSONArray jsonArray = getAreaApi(queryDate);
            for (int i=0;i<jsonArray.size();i++){
                JSONObject json = jsonArray.getJSONObject(i);
                String consNo = json.getString("consNo");
                if(!map.containsKey(consNo)){
                    map.put(consNo,0);
                    BaseDeviceElectricRecordDO recordDO = new BaseDeviceElectricRecordDO();
                    recordDO.setAddress(json.getString("address"));
                    recordDO.setConsNo(json.getString("consNo"));
                    recordDO.setHome(json.getString("home"));
                    recordDO.setLowerLimit(json.getString("lowerLimit"));
                    recordDO.setStatDate(json.getString("statDate"));
                    recordDO.setUpperLimit(json.getString("upperLimit"));
                    recordDO.setName(json.getString("name"));
                    DevicePatientDevice patientDevice = patientDeviceDao.findByDeviceSnAndCategoryCodeAndUserType(consNo,"20","-1");
                    if(patientDevice!=null){
                        recordDO.setPatient(patientDevice.getUser());
                    }
                    list.add(recordDO);
                }
            }
            if(list.size()>0){
                baseDeviceElectricRecordDao.save(list);
            }
        }catch (Exception e){
            e.printStackTrace();
        }
    }
    private long expire(String key) {
        return redisTemplate.opsForValue().getOperations().getExpire(key);
    }
    public JSONArray getAreaApi(String date){
        try {
            BaseHzInterfaceDictEntity dbkey = requestDBKEY();
            //判断是否过期 或者 是否不存在
            if(expire(dbkey.getCode()) > 0?false:true||redisTemplate.hasKey(dbkey.getCode())){
                PopBasicInfo();
            }
            String requestSecret = redisTemplate.opsForValue().get(dbkey.getCode());
            //请求接口地址(政务网环境根据接口文档地址改动)
            String electricityTableSql = "SELECT url FROM base_hz_interface_dict WHERE `status` = 1 AND `code` = 'zfjddjlrdbjk'";
            String url = jdbcTemplate.queryForObject(electricityTableSql, String.class);
            String requestTime = DSLUtils.dateToLong(new Date()) + "";//时间戳
            String sign = MD5Utils.encoderByMd5(dbkey.getAppKey()+ requestSecret + requestTime);
            JSONObject json = new JSONObject();
            json.put("queryDate",date);
            url +="?appKey="+dbkey.getAppKey()+"&sign="+sign+"&requestTime="+requestTime;
            org.springframework.http.HttpEntity<JSONObject> response = httpClientUtil.assesTokenPostHttp(url, json, HttpMethod.POST);
            logger.info("电表接口调用结果----> "+response);
            JSONObject responseBody = response.getBody();
            if("0".equals(responseBody.getString("code"))){
                return responseBody.getJSONArray("data");
            }
        }catch (Exception e){
            e.printStackTrace();
        }
        return new JSONArray();
    }
    // 刷新密钥还存在时可以调用这个方法
    private String refreshKey(BaseHzInterfaceDictEntity refreshdbkey, BaseHzInterfaceDictEntity requestdbkey){
        Map<String, String> params = new HashMap<String, String>();
        String appkey = refreshdbkey.getAppKey();   //appKey
        String requstSecret = refreshdbkey.getRefreshSecret();//刷新密钥
        String requestTime = DSLUtils.dateToLong(new Date()) + "";//时间戳
        String url = refreshdbkey.getUrl();  //请求url
        String sign = MD5Utils.encoderByMd5(appkey + requstSecret + requestTime);
        params.put("appKey", appkey);
        params.put("sign", sign);
        params.put("requestTime", requestTime);
        JSONObject resultObj = HttpToolUtil.httpURLConnection_sendPost(url, params);
        logger.info("接口返回值:"+resultObj.toString());
        System.out.println("接口返回值:"+resultObj.toString());
        JSONObject datasObj = JSONObject.parseObject(resultObj.get("datas").toString());
        requestdbkey.setRequestSecret(datasObj.get("requestSecret").toString());
        requestdbkey.setRequestSecretEndTime(DateUtil.strToDateLong(datasObj.get("requestSecretEndTime").toString()));
        baseHzInterfaceDictDao.save(requestdbkey);
        redisTemplate.opsForValue().set(requestdbkey.getCode(),resultObj.get("requestSecret").toString(),14, TimeUnit.MINUTES);
        return datasObj.toString();
    }
    @Transactional(rollbackFor = Exception.class)
    public String PopBasicInfo() {
        Map<String, String> params = new HashMap<String, String>();
        BaseHzInterfaceDictEntity requestdbkey = requestDBKEY();
        BaseHzInterfaceDictEntity refreshdbkey = refreshDBKEY();
        /*if(redisTemplate.hasKey(refreshdbkey.getCode())){
            return refreshKey(refreshdbkey,requestdbkey);
        }*/
        String appkey = requestdbkey.getAppKey();   //appKey
        String requstSecret = requestdbkey.getAppPwd();//app密钥
        String requestTime = DSLUtils.dateToLong(new Date()) + "";//时间戳
        String url = requestdbkey.getUrl();  //请求url
        //sign 格式:APP_KEY + APP秘钥+时间戳,经过MD5加密生成的串(字母小写)
        String sign = MD5Utils.encoderByMd5(appkey + requstSecret + requestTime);
        params.put("appKey", appkey);
        params.put("sign", sign);
        params.put("requestTime", requestTime);
        JSONObject resultObj = HttpToolUtil.httpURLConnection_sendPost(url, params);
//        logger.info("接口返回值:"+resultObj.toString());
//        System.out.println("接口返回值:"+resultObj.toString());
        //请求密钥
        JSONObject datasObj = JSONObject.parseObject(resultObj.get("datas").toString());
        requestdbkey.setRequestSecret(datasObj.get("requestSecret").toString());
        requestdbkey.setRequestSecretEndTime(DateUtil.strToDateLong(datasObj.get("requestSecretEndTime").toString()));
        //刷新密钥
        refreshdbkey.setRefreshSecret(datasObj.get("refreshSecret").toString());
        baseHzInterfaceDictDao.save(requestdbkey);
        baseHzInterfaceDictDao.save(refreshdbkey);
        redisTemplate.opsForValue().set(requestdbkey.getCode(),datasObj.get("requestSecret").toString(),14, TimeUnit.MINUTES);
        redisTemplate.opsForValue().set(refreshdbkey.getCode(),datasObj.get("refreshSecret").toString(),47, TimeUnit.HOURS);
        return resultObj.toString();
    }
    // 请求密钥 15分钟过期
    public BaseHzInterfaceDictEntity requestDBKEY(){
        return baseHzInterfaceDictDao.findByStatusAndCode(1,"dbmyhq");
    }
    // 刷新密钥 48小时过期
    public BaseHzInterfaceDictEntity refreshDBKEY(){
        return baseHzInterfaceDictDao.findByStatusAndCode(1,"dbmysxhq");
    }
}

+ 75 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/util/DSLUtils.java

@ -0,0 +1,75 @@
package com.yihu.jw.care.util;
import java.text.SimpleDateFormat;
import java.util.Date;
/**   杭州第三方接口 工具类
 * Data、String、Long三种日期类型之间的相互转换
 * @ClassName: DSLUtils
 * @Description: TODO
 * @author:  yuhl
 * @date: Jul 10, 2017 6:00:45 PM
 */
public class DSLUtils {
	
	// date类型转换为String类型  
    // formatType格式为yyyy-MM-dd HH:mm:ss//yyyy年MM月dd日 HH时mm分ss秒  
    // data Date类型的时间  
    public static String dateToString(Date data, String formatType) {  
        return new SimpleDateFormat(formatType).format(data);  
    }  
   
    // long类型转换为String类型  
    // currentTime要转换的long类型的时间  
    // formatType要转换的string类型的时间格式  
    public static String longToString(long currentTime, String formatType)  
            throws Exception {  
        Date date = longToDate(currentTime, formatType); // long类型转成Date类型  
        String strTime = dateToString(date, formatType); // date类型转成String  
        return strTime;  
    }  
   
    // string类型转换为date类型  
    // strTime要转换的string类型的时间,formatType要转换的格式yyyy-MM-dd HH:mm:ss//yyyy年MM月dd日  
    // HH时mm分ss秒,  
    // strTime的时间格式必须要与formatType的时间格式相同  
    public static Date stringToDate(String strTime, String formatType)  
            throws Exception {  
        SimpleDateFormat formatter = new SimpleDateFormat(formatType);  
        Date date = null;  
        date = formatter.parse(strTime);  
        return date;  
    }  
   
    // long转换为Date类型  
    // currentTime要转换的long类型的时间  
    // formatType要转换的时间格式yyyy-MM-dd HH:mm:ss//yyyy年MM月dd日 HH时mm分ss秒  
    public static Date longToDate(long currentTime, String formatType)  
            throws Exception {  
        Date dateOld = new Date(currentTime); // 根据long类型的毫秒数生命一个date类型的时间  
        String sDateTime = dateToString(dateOld, formatType); // 把date类型的时间转换为string  
        Date date = stringToDate(sDateTime, formatType); // 把String类型转换为Date类型  
        return date;  
    }  
   
    // string类型转换为long类型  
    // strTime要转换的String类型的时间  
    // formatType时间格式  
    // strTime的时间格式和formatType的时间格式必须相同  
    public static long stringToLong(String strTime, String formatType)  
            throws Exception {  
        Date date = stringToDate(strTime, formatType); // String类型转成date类型  
        if (date == null) {  
            return 0;  
        } else {  
            long currentTime = dateToLong(date); // date类型转成long类型  
            return currentTime;  
        }  
    }  
   
    // date类型转换为long类型  
    // date要转换的date类型的时间  
    public static long dateToLong(Date date) {  
        return date.getTime();  
    }  
}

+ 204 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/util/HttpToolUtil.java

@ -0,0 +1,204 @@
package com.yihu.jw.care.util;
import com.alibaba.fastjson.JSON;
import javax.net.ssl.*;
import java.io.*;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.net.URLEncoder;
import java.security.SecureRandom;
import java.security.cert.CertificateException;
import java.security.cert.X509Certificate;
import java.util.Map;
// 杭州第三方接口 工具类
public class HttpToolUtil {
	/**
	 * 发送post请求
	 * @Title HttpToolUtil.java
	 * @auther gaoyang
	 * @Descrption
	 * @DATE Sep 2, 2018 1:26:36 AM
	 * @param urlStr
	 * @param paramMap
	 * @return JSONObject
	 */
	public static com.alibaba.fastjson.JSONObject httpURLConnection_sendPost(String urlStr, Map paramMap) {
		return httpURLConnection_sendPost(urlStr, paramMap, "application/x-www-form-urlencoded");
	}
	/**
	 * 发送post请求
	 * @Title HttpToolUtil.java
	 * @auther gaoyang
	 * @Descrption
	 * @DATE Sep 2, 2018 1:26:36 AM
	 * @param urlStr
	 * @param paramMap
	 * @return JSONObject
	 */
	public static com.alibaba.fastjson.JSONObject httpURLConnection_sendPost(String urlStr, Map paramMap, String ContentType) {
		System.out.println(urlStr);
		com.alibaba.fastjson.JSONObject result = new com.alibaba.fastjson.JSONObject();
		result.put("code", 200);
		result.put("msg", null);
		OutputStream out = null;
		DataOutputStream dataOutputStream = null;
		InputStream in = null;
		ByteArrayOutputStream baos = null;
		try {
			// 开启HTTPS证书信任,否则请求不了HTTPS的接口,编办有个接口是这样
			if (urlStr.startsWith("https")){
				SSLContext sslcontext = SSLContext.getInstance("SSL");
				TrustManager[] tm = {new MyX509TrustManager()};
				sslcontext.init(null, tm, new SecureRandom());
				HostnameVerifier ignoreHostnameVerifier = new HostnameVerifier() {
					@Override
					public boolean verify(String s, SSLSession sslsession) {
						System.out.println("WARNING: Hostname is not matched for cert.");
						return true;
					}
				};
				HttpsURLConnection.setDefaultHostnameVerifier(ignoreHostnameVerifier);
				HttpsURLConnection.setDefaultSSLSocketFactory(sslcontext.getSocketFactory());
			}
			URL url = new URL(urlStr);
			URLConnection urlConnection = url.openConnection();
			// 将url 以 open方法返回的urlConnection  连接强转为HttpURLConnection连接  (标识一个url所引用的远程对象连接)
			HttpURLConnection connection = (HttpURLConnection) url.openConnection();// 此时cnnection只是为一个连接对象,待连接中
			// 设置连接输出流为true,默认false (post 请求是以流的方式隐式的传递参数)
			connection.setDoOutput(true);
			// 设置连接输入流为true
			connection.setDoInput(true);
			// 设置请求方式为post
			connection.setRequestMethod("POST");
			// post请求缓存设为false
			connection.setUseCaches(false);
			// 设置该HttpURLConnection实例是否自动执行重定向
			connection.setInstanceFollowRedirects(true);
			// 设置请求头里面的各个属性 (以下为设置内容的类型,设置为经过urlEncoded编码过的from参数)
			// application/x-javascript text/xml->xml数据 application/x-javascript->json对象 application/x-www-form-urlencoded->表单数据
			connection.setRequestProperty("Content-Type", ContentType);
			// 建立连接 (请求未开始,直到connection.getInputStream()方法调用时才发起,以上各个参数设置需在此方法之前进行)
			connection.connect();
			// 建立输入流,向指向的URL传入参数
			String queryString = "";
			if (paramMap != null) {
				for (Object e : paramMap.entrySet()) {
					Map.Entry<String, Object> entry = (Map.Entry<String, Object>) e;
					queryString += entry.getKey() + "=" + URLEncoder.encode(entry.getValue().toString(), "UTF-8") + "&";
				}
			}
//			System.out.println("httpURLConnection_sendPost参数:" + queryString);
			if (queryString.length() > 0) {
				queryString = queryString.substring(0, queryString.length() - 1);
				out = connection.getOutputStream();
				dataOutputStream = new DataOutputStream(out);
				dataOutputStream.writeBytes(queryString);
//				System.out.println("httpURLConnection_sendPost接收参数:" + connection.getOutputStream());
				dataOutputStream.flush();
				out.flush();
			}
			// 获得响应状态
			int responseCode = connection.getResponseCode();
			baos = new ByteArrayOutputStream();
			byte[] buffer = new byte[1024];
			int len = 0;
			in = connection.getInputStream();
			while ((len = in.read(buffer)) != -1) {
				baos.write(buffer, 0, len);
				baos.flush();
			}
			if (HttpURLConnection.HTTP_OK == responseCode) {
				try {
					result.putAll(JSON.parseObject(baos.toString("UTF-8")));
				} catch (RuntimeException e) {
					result.put("data", baos.toString("UTF-8"));
					result.put("dataCount", 1);
					result.put("msg", "请求成功");
				}
			} else {
				result.put("code", responseCode);
				result.put("msg", "源接口访问异常:" + baos.toString("UTF-8"));
			}
		} catch (Exception e) {
			result.put("code", 500);
			result.put("msg", "源接口访问异常:" + e.getClass() + "->" + e.getMessage());
		} finally {
			if (baos != null) {
				try {
					baos.close();
				} catch (IOException e) {
					result.put("code", 500);
					result.put("msg", "源接口访问异常:" + e.getClass() + "->" + e.getMessage());
				}
			}
			if (in != null) {
				try {
					in.close();
				} catch (IOException e) {
					result.put("code", 500);
					result.put("msg", "源接口访问异常:" + e.getClass() + "->" + e.getMessage());
				}
			}
			if (dataOutputStream != null) {
				try {
					dataOutputStream.close();
				} catch (IOException e) {
					result.put("code", 500);
					result.put("msg", "源接口访问异常:" + e.getClass() + "->" + e.getMessage());
				}
			}
			if (out != null) {
				try {
					out.close();
				} catch (IOException e) {
					result.put("code", 500);
					result.put("msg", "源接口访问异常:" + e.getClass() + "->" + e.getMessage());
				}
			}
		}
//		System.out.println("httpURLConnection_sendPost执行结果:" + result);
		return result;
	}
	/**
	 * 空实现即可
	 * 跳过https的证书验证
	 * @author lilin
	 * @date 2020-12-09
	 */
	static class MyX509TrustManager implements X509TrustManager{
		@Override
		public void checkClientTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException {
		}
		@Override
		public void checkServerTrusted(X509Certificate[] x509Certificates, String s) throws CertificateException {
		}
		@Override
		public X509Certificate[] getAcceptedIssuers() {
			return new X509Certificate[0];
		}
	}
}

+ 43 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/util/MD5Utils.java

@ -0,0 +1,43 @@
package com.yihu.jw.care.util;
import java.security.MessageDigest;
import java.security.NoSuchAlgorithmException;
//杭州第三方接口 工具类
public class MD5Utils {
	
    /**利用MD5进行加密
    *
    * @param plainText
    *            明文
    * @return 32位密文
    */
   public static String encoderByMd5(String plainText) {
       String re_md5 = new String();
       try {
           MessageDigest md = MessageDigest.getInstance("MD5");
           md.update(plainText.getBytes());
           byte b[] = md.digest();
           int i;
           StringBuffer buf = new StringBuffer("");
           for (int offset = 0; offset < b.length; offset++) {
               i = b[offset];
               if (i < 0)
                   i += 256;
               if (i < 16)
                   buf.append("0");
               buf.append(Integer.toHexString(i));
           }
           re_md5 = buf.toString();
       } catch (NoSuchAlgorithmException e) {
           e.printStackTrace();
       }
       return re_md5;
   }
   
}

+ 15 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/web/JobController.java

@ -11,6 +11,7 @@ import com.yihu.jw.care.service.BirthdayReminderService;
import com.yihu.jw.care.service.JobService;
import com.yihu.jw.care.service.WlyysimFlowVoiceService;
import com.yihu.jw.care.service.device.InitializeDataJobService;
import com.yihu.jw.care.service.hz.HzInterfaceService;
import com.yihu.jw.care.util.SystemConf;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import io.swagger.annotations.Api;
@ -48,6 +49,20 @@ public class JobController extends BaseController {
    private YunXunDeviceService yunXunDeviceService;
    @Autowired
    private InitializeDataJobService initializeDataJobService;
    @Autowired
    private HzInterfaceService hzInterfaceService;
    @RequestMapping(value = "electricityTable", method = RequestMethod.GET)
    @ApiOperation("收到更新居民电表数据")
    public String electricityTable(String queryDate) {
        try {
            hzInterfaceService.electricityTable(queryDate);
            return success("删除成功!");
        } catch (Exception e) {
            error(e);
            return invalidUserException(e, -1, "删除失败:" + e.getMessage());
        }
    }
    @RequestMapping(value = "/deviceLostAssociationJob", method = RequestMethod.POST)
    @ApiOperation("医养物联网检测大屏失联率")

+ 3 - 1
svr/svr-cloud-job/src/main/resources/system.properties

@ -35,4 +35,6 @@ DAILY_WATER_JOB= 0 15 * * * ?
#\u4EBA\u8138\u5E93\u6BCF\u5929\u665A\u4E0A3\u70B9\u8DD1\u4E00\u6B21
DEVICE_DATA_FACE_JOB= 0 0 3 * * ? *
#\u4EBA\u8138\u8BB0\u5F55\u6BCF30\u5206\u949F\u8DD1\u4E00\u6B21
SYN_FACE_RECORD_JOB= 0 0/30 * * * ? *
SYN_FACE_RECORD_JOB= 0 0/30 * * * ? *
#\u7535\u8868\u6BCF\u5929\u65E9\u4E0A\u4E0A8\u70B9\u8DD1\u4E00\u6B21
SYN_ELECTRIC_RECORD_JOB= 0 0 3 * * ? *