Forráskód Böngészése

Merge branch 'dev' of chinawu123/wlyy2.0 into dev

chinawu123 2 éve
szülő
commit
49691e31a8

+ 17 - 0
common/common-entity/sql/sql记录

@ -2383,6 +2383,23 @@ CREATE TABLE `pad_use_time` (
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=97 DEFAULT CHARSET=utf8mb4 COMMENT='pad使用时间';
alter table base_zhaohui_daily_watch add column locations varchar(5000) default null comment '轨迹';
CREATE TABLE `base_zhaohui_fire_gas_sec` (
  `id` int(50) NOT NULL AUTO_INCREMENT,
  `daily_id` varchar(50) NOT NULL COMMENT '朝晖日报id',
  `online` int(2) DEFAULT NULL COMMENT '在线状态0 不在线 1在线',
  `sec_status` int(2) DEFAULT NULL COMMENT '预警状态0无 1有',
  `order_id` varchar(50) DEFAULT NULL COMMENT '工单id',
  `fire_curve` varchar(5000) DEFAULT NULL COMMENT '曲线',
  `type` INT(2) DEFAULT NULL COMMENT '1 烟感 2气感',
  PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=0 DEFAULT CHARSET=utf8mb4 COMMENT='朝晖日报-烟感气感预警';
-- 2022-11-28 ysj
CREATE TABLE `base_copywriting` (
  `id` varchar(50) NOT NULL,

+ 26 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/log/ZhaohuiDailyEntity.java

@ -76,6 +76,32 @@ public class ZhaohuiDailyEntity extends IdEntity {
    private String familyCode;
    //所属社区
    private String orgCode;
    //用户类型 1 居民 2幼儿  3社工 4 管理员
    private Integer userType;
    @Column(name = "user_type")
    public Integer getUserType() {
        return userType;
    }
    public void setUserType(Integer userType) {
        this.userType = userType;
    }
    @Column(name = "org_code")
    public String getOrgCode() {
        return orgCode;
    }
    public void setOrgCode(String orgCode) {
        this.orgCode = orgCode;
    }
    @Column(name = "eme_num")
    public Integer getEmeNum() {
        return emeNum;

+ 13 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/log/ZhaohuiDailyWatchEntity.java

@ -56,6 +56,19 @@ public class ZhaohuiDailyWatchEntity extends IdEntity {
    private String serveDesc;
    //轨迹
    private String locations;
    @Column(name = "locations")
    public String getLocations() {
        return locations;
    }
    public void setLocations(String locations) {
        this.locations = locations;
    }
    @Column(name = "daily_id")
    public String getDailyId() {
        return dailyId;

+ 100 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/log/ZhaohuifireGasSecEntity.java

@ -0,0 +1,100 @@
package com.yihu.jw.entity.log;
import com.yihu.jw.entity.IdEntity;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;
/**
 * Created by wsl on 2022/11/28
 */
@Entity
@Table(name = "base_zhaohui_fire_gas_sec")
public class ZhaohuifireGasSecEntity extends IdEntity {
    /**
     * 朝晖日报id
     */
    private String dailyId;
    /**
     * 在线状态0 不在线 1在线
     */
    private Integer online;
    /**
     * 预警状态0无 1有
     */
    private Integer secStatus;
    /**
     * 工单id
     */
    private String orderId;
    /**
     * 曲线
     */
    private String fireCurve;
    /**
     * 1 烟感 2气感
     */
    private Integer type;
    @Column(name = "daily_id")
    public String getDailyId() {
        return dailyId;
    }
    public void setDailyId(String dailyId) {
        this.dailyId = dailyId;
    }
    @Column(name = "online")
    public Integer getOnline() {
        return online;
    }
    public void setOnline(Integer online) {
        this.online = online;
    }
    @Column(name = "sec_status")
    public Integer getSecStatus() {
        return secStatus;
    }
    public void setSecStatus(Integer secStatus) {
        this.secStatus = secStatus;
    }
    @Column(name = "order_id")
    public String getOrderId() {
        return orderId;
    }
    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }
    @Column(name = "fire_curve")
    public String getFireCurve() {
        return fireCurve;
    }
    public void setFireCurve(String fireCurve) {
        this.fireCurve = fireCurve;
    }
    @Column(name = "type")
    public Integer getType() {
        return type;
    }
    public void setType(Integer type) {
        this.type = type;
    }
}

+ 53 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/message/DoctorMessageEndpoint.java

@ -7,6 +7,7 @@ import com.yihu.jw.care.service.message.DoctorMessageService;
import com.yihu.jw.care.service.message.PatientMessageService;
import com.yihu.jw.restmodel.ResponseContant;
import com.yihu.jw.restmodel.web.Envelop;
import com.yihu.jw.restmodel.web.ListEnvelop;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import com.yihu.jw.restmodel.web.PageEnvelop;
import com.yihu.jw.restmodel.web.endpoint.EnvelopRestEndpoint;
@ -224,4 +225,56 @@ public class DoctorMessageEndpoint extends EnvelopRestEndpoint {
            return failedObjEnvelopException2(e);
        }
    }
    @GetMapping(value = "/getZhaoHuiRiBaoList")
    @ApiOperation(value = "获取朝晖日报列表")
    public ListEnvelop getZhaoHuiRiBaoList(@ApiParam(name = "startTime", required = false)
                                           @RequestParam(value = "startTime", required = false) String startTime,
                                           @ApiParam(name = "endTime", required = false)
                                           @RequestParam(value = "endTime", required = false) String endTime,
                                           @ApiParam(name = "orgCode", required = false)
                                           @RequestParam(value = "orgCode", required = false) String orgCode,
                                           @ApiParam(name = "userType", required = false)
                                           @RequestParam(value = "userType", required = false) String userType
    ) {
        try {
            return success("获取成功", 200, patientMessageService.getZhaoHuiRiBaoList(userType,startTime,null,endTime,orgCode));
        } catch (Exception e) {
            e.printStackTrace();
            return failedListEnvelopException2(e);
        }
    }
    @GetMapping(value = "/getZHaohuiRiBaoInfo")
    @ApiOperation(value = "获取朝晖日报信息")
    public ObjEnvelop getZHaohuiRiBaoInfo(
                                           @ApiParam(name = "orgId", required = false)
                                           @RequestParam(value = "orgId", required = false) String orgId,
                                           @ApiParam(name = "dailyId", required = false)
                                           @RequestParam(value = "dailyId", required = false) String dailyId
    ) {
        try {
            return success("获取成功", 200, patientMessageService.getZhaohuiDailyDoctor(dailyId,orgId));
        } catch (Exception e) {
            e.printStackTrace();
            return failedObjEnvelopException2(e);
        }
    }
    @GetMapping(value = "/getDoctorOrgId")
    @ApiOperation(value = "获取社区id")
    public ObjEnvelop getDoctorOrgId(
            @ApiParam(name = "id", required = false)
            @RequestParam(value = "id", required = false) String id
    ) {
        try {
            return success("获取成功", 200, patientMessageService.getDoctorOrgId(id));
        } catch (Exception e) {
            e.printStackTrace();
            return failedObjEnvelopException2(e);
        }
    }
}

+ 9 - 9
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/message/PatientMessageEndpoint.java

@ -259,18 +259,18 @@ public class PatientMessageEndpoint extends EnvelopRestEndpoint {
    @GetMapping(value = "/getZhaoHuiRiBaoList")
    @ApiOperation(value = "获取朝晖日报")
    @ApiOperation(value = "获取朝晖日报列表")
    public ListEnvelop getZhaoHuiRiBaoList(@ApiParam(name = "startTime", required = false)
                                          @RequestParam(value = "startTime",required = false) String startTime,
                                          @ApiParam(name = "endTime", required = false)
                                          @RequestParam(value = "endTime",required = false) String endTime,
                                          @ApiParam(name = "patient", required = true)
                                          @RequestParam(value = "patient") String patient,
                                          @ApiParam(name = "dailyId", required = false)
                                          @RequestParam(value = "dailyId",required = false) String dailyId
                                           @RequestParam(value = "startTime", required = false) String startTime,
                                           @ApiParam(name = "endTime", required = false)
                                           @RequestParam(value = "endTime", required = false) String endTime,
                                           @ApiParam(name = "patient", required = false)
                                           @RequestParam(value = "patient",required = false) String patient,
                                           @ApiParam(name = "userType", required = false)
                                           @RequestParam(value = "userType", required = false) String userType
    ) {
        try {
            return success("获取成功", 200, patientMessageService.getZhaoHuiRiBaoList(startTime, endTime, patient));
            return success("获取成功", 200, patientMessageService.getZhaoHuiRiBaoList(userType,startTime, endTime, patient,null));
        } catch (Exception e) {
            e.printStackTrace();
            return failedListEnvelopException2(e);

+ 2 - 2
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/consult/ConsultTeamService.java

@ -240,8 +240,8 @@ public class ConsultTeamService {
                systemMessageDao.save(messageDO);
                BasePatientDO family3 = patientDao.findById(patientId);
                messageUtil.putTemplateWxMessage(wxId,"template_error_notice","jjhjyctz",family3.getOpenid(),patientDO.getName()+"发起紧急呼叫",null,null,3,templateJson, DateUtil.getStringDate(),"紧急呼叫",title+",请及时核实处理");
                String url = "https://zhyzh.gongshu.gov.cn/medical-care-patient/sos/info?id="+orderId+"&OrderType=20";
                messageUtil.putTemplateWxMessage(wxId,"template_error_notice","jjhjyctz",family3.getOpenid(),patientDO.getName()+"发起紧急呼叫",url,null,3,templateJson, DateUtil.getStringDate(),"紧急呼叫",title+",请及时核实处理");
            }
        }

+ 57 - 11
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/message/PatientMessageService.java

@ -328,6 +328,43 @@ public class PatientMessageService {
    }
    public String getDoctorOrgId(String id){
        String sql = "select id from base_team where leader_code = '"+id+"' and del = 1 and org_code = 'zdjsylfwyxgszhfgs' ";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        return list.get(0).get("id").toString();
    }
    public JSONObject getZhaohuiDailyDoctor(String dailyId, String orgId) {
        JSONObject resultObj = new JSONObject();
        ZhaohuiDailyEntity zhaohuiDailyEntity = zhaohuiDailyDao.findById(Long.parseLong(dailyId));
        String[] data = zhaohuiDailyEntity.getServiceTime().split(",");
        data[0] = "1999-01-01 00:00:00";
        data[1] = "2022-11-29 23:59:59";
        String sql = "select * from base_zhaohui_daily where org_code='" + orgId + "' and create_time>= '" + data[0] + "' and create_time<='" + data[1] + "' and user_type = 1 ";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        List<JSONObject> patientBasInfoList = new ArrayList<>();
        if (list.size()>0) {
            for (Map<String, Object> map : list) {
                JSONObject zHaohuiRiBaoInfo = getZHaohuiRiBaoInfo(map.get("patient").toString(), map.get("id").toString());
                sql = "SELECT SUM(a.total) as total FROM (\n" +
                        "SELECT count(o.id) total FROM base_emergency_assistance_order o  WHERE o.patient ='"+map.get("patient").toString()+"' and o.status NOT IN (-1,0) AND o.create_time >='" + data[0] + "' AND o.create_time<='" + data[1] + "' \n" +
                        "UNION ALL \n" +
                        "SELECT count(o.id) total FROM base_security_monitoring_order o  WHERE o.patient = '"+map.get("patient").toString()+"'  and o.status NOT IN (-1,0) AND o.create_time >='" + data[0] + "' AND o.create_time<='" + data[1] + "' \n" +
                        ") a";
                Integer emeNum = jdbcTemplate.queryForObject(sql, Integer.class);
                zHaohuiRiBaoInfo.put("redDot",emeNum);
                patientBasInfoList.add(zHaohuiRiBaoInfo);
            }
        }
        resultObj.put("doctorBaseInfo", zhaohuiDailyEntity);
        resultObj.put("patientBaseInfo", patientBasInfoList);
        return resultObj;
    }
    public JSONObject getZHaohuiRiBaoInfo(String patient, String dailyId){
@ -403,20 +440,29 @@ public class PatientMessageService {
        return result;
    }
    public List<Map<String, Object>> getZhaoHuiRiBaoList(String start, String end, String patient) {
    //userType   1 家属   2 幼儿  3 社工
    public List<Map<String, Object>> getZhaoHuiRiBaoList(String userType, String start, String end, String patient,String orgCode) {
        StringBuffer sql = new StringBuffer("SELECT id,eme_num,service,DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%s') as create_time,patient_name,user_type,family_code FROM base_zhaohui_daily WHERE 1=1  ");
            StringBuffer sql = new StringBuffer("SELECT  id,eme_num,service,DATE_FORMAT(create_time,'%Y-%m-%d %H:%i:%s') as create_time,patient_name FROM base_zhaohui_daily WHERE family_code = '" + patient + "' ");
            if (StringUtils.isNotBlank(start)) {
                start+=" 00:00:00";
                sql.append(" and create_time >='" + start + "' ");
            }
        if (StringUtils.isBlank(userType) || "1".equals(userType)) {
            sql.append(" and family_code = '" + patient + "' and user_type = 1");
            if (StringUtils.isNotBlank(end)) {
                end +=" 23:59:59";
                sql.append(" and create_time <= '" + end + "' ");
            }
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql.toString());
        } else if ("2".equals(userType)) {
            sql.append(" and family_code = '" + patient + "' and user_type = 2");
        } else if ("3".equals(userType)) {
            sql.append(" and org_code = '" + orgCode + "' and user_type = 3");
        }
        if (StringUtils.isNotBlank(start)) {
            start += " 00:00:00";
            sql.append(" and create_time >='" + start + "' ");
        }
        if (StringUtils.isNotBlank(end)) {
            end += " 23:59:59";
            sql.append(" and create_time <= '" + end + "' ");
        }
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql.toString());
        return list;
    }

+ 1 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/util/MessageUtil.java

@ -125,6 +125,7 @@ public class MessageUtil {
     * type 1 安防紧急预警 2紧急呼叫 4im 5生日祝福
     * msgtype 消息类型 text
     */
    @Async
    public void sendDoctorDingdingMessage(BaseDoctorDO doctorDO,String doctorCode,String msgtype,String type,String content,String title,String url){
        try {
            if(doctorDO == null){

+ 11 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/dao/pushLog/ZhaohuifireGasSecDao.java

@ -0,0 +1,11 @@
package com.yihu.jw.care.dao.pushLog;
import com.yihu.jw.entity.log.ZhaohuifireGasSecEntity;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.repository.PagingAndSortingRepository;
/**
 * Created by wsl on 2022/11/28
 */
public interface ZhaohuifireGasSecDao extends PagingAndSortingRepository<ZhaohuifireGasSecEntity, String>, JpaSpecificationExecutor<ZhaohuifireGasSecEntity> {
}

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

@ -7,7 +7,6 @@ import com.yihu.jw.care.job.consult.FinishConsultJob;
import com.yihu.jw.care.job.data.SaveDataPushJob;
import com.yihu.jw.care.job.device.*;
import com.yihu.jw.care.job.message.DoctorSendUnreadJob;
import com.yihu.jw.care.job.message.PatientSendUnreadJob;
import com.yihu.jw.care.job.order.*;
import com.yihu.jw.care.job.pushRecord.*;
import com.yihu.jw.care.job.sim.GetSimsVoiceFlowDayJob;
@ -56,13 +55,13 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
            }
            //#每天的早上9:00,给所有居民发送未读消息微信模板
            if (!quartzHelper.isExistJob("PATIENT_SEND_UNREAD_MES_JOB")) {
            /*if (!quartzHelper.isExistJob("PATIENT_SEND_UNREAD_MES_JOB")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("PATIENT_SEND_UNREAD_MES_JOB");
                quartzHelper.addJob(PatientSendUnreadJob.class, trigger, "PATIENT_SEND_UNREAD_MES_JOB", new HashMap<String, Object>());
                logger.info("PATIENT_SEND_UNREAD_MES_JOB success");
            } else {
                logger.info("PATIENT_SEND_UNREAD_MES_JOB exist");
            }
            }*/
            //#每天的早上9:00,生日祝福提醒短信
            if (!quartzHelper.isExistJob("BIRTHDAY_REMINDER_JOB")) {

+ 5 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/job/pushRecord/PushZhaohuiRoundJob.java

@ -28,6 +28,11 @@ public class PushZhaohuiRoundJob implements Job {
            zhaohuiDailyService.allRound();
            logger.info("PushZhaohuiRoundJob end");
            System.out.println("====================朝晖日报end==================");
            zhaohuiDailyService.doctorDaily();
            zhaohuiDailyService.child();
            System.out.println("====================朝晖日报end==================");
        } catch (Exception e) {
            logger.info("PushZhaohuiRoundJob --ERROR MSG:" + e.getMessage());
            e.printStackTrace();

+ 37 - 0
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/service/device/PatientDeviceService.java

@ -1,6 +1,7 @@
package com.yihu.jw.care.service.device;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.yihu.jw.care.config.AqgConfig;
import com.yihu.jw.care.dao.device.DeviceDao;
@ -14,6 +15,7 @@ import com.yihu.jw.hospital.message.dao.SystemMessageDao;
import com.yihu.jw.util.common.GpsUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import org.apache.commons.lang3.StringUtils;
import org.json.JSONArray;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -21,6 +23,7 @@ import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.http.HttpEntity;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.MediaType;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional;
@ -412,6 +415,40 @@ public class PatientDeviceService {
    }
    public static final String X1_locations = baseUrl+"/api/locationdata/";
    public JSONArray getX1Locations(String deviceSn, String time_begin){
        JSONArray result = new JSONArray();
        String url = X1_locations+"?device="+deviceSn+"&depth="+1+"&rows_per_page="+300;
        if (StringUtils.isNotBlank(time_begin)){
            url += "&time_begin="+time_begin;
        }
        Map<String,Object> headers = new HashMap<>();
        headers.put("Accept", MediaType.APPLICATION_JSON.toString());
        headers.put("Cookie", getCookie());
        String  responseStr = httpClientUtil.get(url,"utf-8",headers);
        com.alibaba.fastjson.JSONObject resObj = JSON.parseObject(responseStr);
        if (resObj.getBooleanValue("success")){
            com.alibaba.fastjson.JSONArray arr = resObj.getJSONArray("objs");
            arr.sort(Comparator.comparing(obj -> ((com.alibaba.fastjson.JSONObject) obj).getJSONObject("created_at").getLong("$date")));
            for (int i=0;i<arr.size();i++){
                try {
                    com.alibaba.fastjson.JSONObject obj = arr.getJSONObject(i);
                    com.alibaba.fastjson.JSONArray pointArr = obj.getJSONObject("point").getJSONArray("coordinates");
                    Double lon = pointArr.getDouble(0);
                    Double lat = pointArr.getDouble(1);
                    com.alibaba.fastjson.JSONObject pointJson = gpsUtil.gcj02_To_Bd09(lat,lon);
                    result.put(pointJson);
                }catch (Exception e){
                }
            }
        }
        return result;
    }

+ 254 - 22
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/service/message/ZhaohuiDailyService.java

@ -1,15 +1,18 @@
package com.yihu.jw.care.service.message;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.yihu.jw.care.dao.pushLog.*;
import com.yihu.jw.care.service.device.PatientDeviceService;
import com.yihu.jw.care.util.MessageUtil;
import com.yihu.jw.dict.service.BaseCopywritingService;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.care.device.DevicePatientDevice;
import com.yihu.jw.entity.log.*;
import com.yihu.jw.patient.dao.BasePatientDao;
import com.yihu.jw.util.date.DateUtil;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -55,6 +58,10 @@ public class ZhaohuiDailyService {
    private ZhaohuiDailySleepDao zhaohuiDailySleepDao;
    @Autowired
    private ZhaohuiDailyEmeDao zhaohuiDailyEmeDao;
    @Autowired
    private ZhaohuifireGasSecDao zhaohuifireGasSecDao;
    @Autowired
    private BaseCopywritingService dictService;
    public void allRound() {
@ -69,7 +76,7 @@ public class ZhaohuiDailyService {
                          //  AND id = '808080eb78d3ce030178edeb4346002b'
    //获取所有老人
    private List<BasePatientDO> olds() {
        String sql = "SELECT * FROM base_patient WHERE archive_type =1 AND sign_status =1  AND del = 1 NOT IN (SELECT dict_code FROM wlyy_hospital_sys_dict WHERE `dict_name` = 'jkzl_older')";
        String sql = "SELECT * FROM base_patient WHERE archive_type =1 AND sign_status =1  AND del = 1 and id NOT IN (SELECT dict_code FROM wlyy_hospital_sys_dict WHERE `dict_name` = 'jkzl_older')";
        List<BasePatientDO> query = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(BasePatientDO.class));
        return query;
    }
@ -87,6 +94,8 @@ public class ZhaohuiDailyService {
    @Autowired
    private PadUseTimeDao padUseTimeDao;
@ -97,13 +106,17 @@ public class ZhaohuiDailyService {
        List<ZhaohuiDailySleepEntity> zhaohuiDailySleepList = new ArrayList<>();
        List<ZhaohuiDailyVideoEntity> zhaohuiDailyVideoList = new ArrayList<>();
        List<ZhaohuiDailyEmeEntity> zhaohuiDailyEmeList = new ArrayList<>();
        List<ZhaohuifireGasSecEntity> zhaohuifireGasSecEntityList = new ArrayList<>();
        String message = dictService.findCopywriting("zhaohui_dailyReport", "family_zhaohui_daily1");
        String oldId = old.getId();
        String date = DateUtil.getStringDateShort();
        String stateDate = date + " 00:00:00";
        String endDate = date + " 23:59:59";
        Integer deviceTotal = 0;
        String deviceName = "";
        String sex = old.getSex()==1?"爷爷":"奶奶";
@ -113,36 +126,44 @@ public class ZhaohuiDailyService {
        zhaohuiDailyEntity.setPhoto(old.getPhoto());
        zhaohuiDailyEntity.setCreateTime(new Date());
        zhaohuiDailyEntity.setFamilyCode(familyCode);
        zhaohuiDailyEntity.setUserType(1);
        String message = "";
        String orgCodeSql = "SELECT t.id as orgId FROM base_service_package_sign_record r INNER JOIN base_team t ON r.sign_doctor= t.leader_code WHERE r.patient = '"+oldId+"' ";
        List<Map<String, Object>> orgCodeList = jdbcTemplate.queryForList(orgCodeSql);
        if (orgCodeList.size()>0) {
            zhaohuiDailyEntity.setOrgCode(orgCodeList.get(0).get("orgId").toString());
        }
        String emeSql = "select count(id) from base_emergency_assistance_order where patient='"+oldId+"'  and create_time>='"+stateDate+"' and create_time<='"+endDate+"'";
        String emeSql = "select count(id) from base_emergency_assistance_order where patient='"+oldId+"'  and create_time>='"+stateDate+"' and create_time<='"+endDate+"' and status <> -1";
        Integer emeTotal = jdbcTemplate.queryForObject(emeSql, Integer.class);
        if (emeTotal>0){
        /*if (emeTotal>0){
            message += old.getName()+sex+"今日发起"+emeTotal+"次紧急呼叫";
        }
        }*/
        String secSql ="select count(id) total,serve_desc from  base_security_monitoring_order where patient= '"+oldId+"' and create_time>='"+stateDate+"' and create_time<='"+endDate+"' ";
        String secSql ="select count(id) total,serve_desc from  base_security_monitoring_order where patient= '"+oldId+"' and create_time>='"+stateDate+"' and create_time<='"+endDate+"' and status <> -1 ";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(secSql);
        if (list.size()>0&&0>Integer.parseInt(list.get(0).get("total").toString())) {
        /*if (list.size()>0&&0>Integer.parseInt(list.get(0).get("total").toString())) {
            if (StringUtils.isNotBlank(message)) {
                message += "\n 监护到"+old.getName()+sex+"今日存在安全预警:【"+list.get(0).get("serve_desc")+"】";
            }else {
                message = "监护到"+old.getName()+sex+"今日存在安全预警:【"+list.get(0).get("serve_desc")+"】";
            }
        }
        }*/
        zhaohuiDailyEntity.setEmeNum(emeTotal+(list.size()>0?Integer.parseInt(list.get(0).get("total").toString()):0));
        if (StringUtils.isBlank(message)) {
            message = old.getName()+sex+"今日状态正常,未发生异常情况";
        }
        /*if (StringUtils.isBlank(message)) {
            message = old.getName()+sex+"今日状态正常,未发生异常情况,今日家中设备工作正常";
        }*/
        zhaohuiDailyEntity.setMessage(message);
        zhaohuiDailyEntity.setMessage(old.getName()+sex+","+message);
        String lifeSql = "select count(id) from base_life_care_order where patient = '" + oldId + "' and status = 1 and create_time>= '" + stateDate + "' and create_time<= '" + endDate + "'";
        String lifeSql = "select count(id) from base_life_care_order where patient = '" + oldId + "' and status = 1 and create_time>= '" + stateDate + "' and create_time<= '" + endDate + "' and status <> -1";
        String lifeInfoSql = "select d.name,d.create_time create_time from base_life_care_order o INNER JOIN base_life_care_fee_detail d ON o.id=d.order_id where o.patient = '" + oldId + "' and o.status = 1 and o.create_time>= '" + stateDate + "' and o.create_time<= '" + endDate + "' order by o.create_time DESC limit 1";
        List<Map<String, Object>> lifeList = jdbcTemplate.queryForList(lifeInfoSql);
        Integer lifeTotal = jdbcTemplate.queryForObject(lifeSql, Integer.class);
@ -176,9 +197,9 @@ public class ZhaohuiDailyService {
        zhaohuiDailyEntity = zhaohuiDailyDao.save(zhaohuiDailyEntity);
        String sql = "SELECT pd.device_sn,pd.category_code FROM base.wlyy_patient_device pd  where pd.del=0 AND  category_code in ('7','12','4','13') AND user = '" + oldId + "'  ";
        String sql = "SELECT pd.device_sn,pd.category_code FROM base.wlyy_patient_device pd  where pd.del=0 AND  category_code in ('7','12','4','13','14','15') AND user = '" + oldId + "'  ";
        List<Map<String, Object>> oldDeviceList = jdbcTemplate.queryForList(sql);
        String zhaohuiID = zhaohuiDailyEntity.getId().toString();
        for (Map<String, Object> device : oldDeviceList) {
            String deviceSn = device.get("device_sn").toString();
@ -187,7 +208,7 @@ public class ZhaohuiDailyService {
                case 7: //居家报警器
                    ZhaohuiDailyEmeEntity zhaohuiDailyEmeEntity = new ZhaohuiDailyEmeEntity();
                    zhaohuiDailyEmeEntity.setDailyId(zhaohuiDailyEntity.getId().toString());
                    zhaohuiDailyEmeEntity.setDailyId(zhaohuiID);
                    sql = "  select o.id,o.create_time from base_emergency_assistance_order o " +
                            " INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' and o.status=1  and o.create_time >= '"+stateDate+"' and o.create_time <= '"+endDate+"'  ORDER BY create_time desc  limit 1 ";
@ -207,18 +228,22 @@ public class ZhaohuiDailyService {
                        //在线状态实时获取
                        if (!aqgDeviceInfo2.getBoolean("online")) {//设备在线状态
                            zhaohuiDailyEmeEntity.setOnline(0);
                            deviceTotal+=1;
                            deviceName +=",居家报警器离线";
                        } else {
                            zhaohuiDailyEmeEntity.setOnline(1);
                        }
                    }else {
                        zhaohuiDailyEmeEntity.setOnline(0);
                        deviceTotal +=1;
                        deviceName +=",居家报警器离线";
                    }
                    zhaohuiDailyEmeList.add(zhaohuiDailyEmeEntity);
                    break;
                case 4: //智能手表
                    ZhaohuiDailyWatchEntity zhaohuiDailyWatchEntity = new ZhaohuiDailyWatchEntity();
                    zhaohuiDailyWatchEntity.setDailyId(zhaohuiDailyEntity.getId().toString());
                    zhaohuiDailyWatchEntity.setDailyId(zhaohuiID);
                    JSONObject response = patientDeviceService.getAqgDeviceInfo2(deviceSn);
                    if (null != response) {
@ -235,6 +260,8 @@ public class ZhaohuiDailyService {
                        }
                        //在线状态实时获取
                        if (!response.getBoolean("online")) {//设备在线状态
                            deviceTotal+=1;
                            deviceName+=",手表离线";
                            zhaohuiDailyWatchEntity.setOnline(0);
                        } else {
                            zhaohuiDailyWatchEntity.setOnline(1);
@ -277,6 +304,11 @@ public class ZhaohuiDailyService {
                        zhaohuiDailyWatchEntity.setServeDesc("无");
                    }
                    JSONArray x1Locations = getX1Locations(oldId, stateDate);
                    if (null!=x1Locations&&x1Locations.size()>0) {
                        zhaohuiDailyWatchEntity.setLocations(x1Locations.toJSONString());
                    }
                    zhaohuiDailyWatchList.add(zhaohuiDailyWatchEntity);
                    break;
                case 12: //防跌倒视频监测
@ -296,19 +328,21 @@ public class ZhaohuiDailyService {
                    }
                    zhaohuiDailyVideoEntity.setDeviceSn(deviceSn);
                    zhaohuiDailyVideoEntity.setDailyId(zhaohuiDailyEntity.getId().toString());
                    zhaohuiDailyVideoEntity.setDailyId(zhaohuiID);
                    zhaohuiDailyVideoEntity.setTime(stateDate + "," + endDate);
                    zhaohuiDailyVideoList.add(zhaohuiDailyVideoEntity);
                    break;
                case 13: //睡眠带
                    ZhaohuiDailySleepEntity zhaohuiDailySleep = new ZhaohuiDailySleepEntity();
                    zhaohuiDailySleep.setDailyId(zhaohuiDailyEntity.getId().toString());
                    zhaohuiDailySleep.setDailyId(zhaohuiID);
                    JSONObject sleepDeviceInfo = patientDeviceService.getSleepDeviceInfo(deviceSn);
                    if (sleepDeviceInfo.getBooleanValue("success")) {
                        JSONArray objs = sleepDeviceInfo.getJSONArray("objs");
                        response = objs.getJSONObject(0);
                        if (!response.getBoolean("online")) {//设备在线状态
                            zhaohuiDailySleep.setStatus("0");
                            deviceTotal+=1;
                            deviceName+=",睡眠带离线";
                        } else {
                            zhaohuiDailySleep.setStatus("1");
                        }
@ -351,11 +385,76 @@ public class ZhaohuiDailyService {
                    }
                    zhaohuiDailySleepList.add(zhaohuiDailySleep);
                    break;
                case 14: //烟感
                    ZhaohuifireGasSecEntity yg = new ZhaohuifireGasSecEntity();
                    sql = " select count(o.id) as total from base_security_monitoring_order o " +
                            " INNER JOIN base_patient p on p.id = o.patient where device_sn='" + deviceSn + "' and o.status=1 and o.create_time >= '" + stateDate + "' and o.create_time <= '" + endDate + "' ORDER BY create_time desc    ";
                    Integer ygTotal = jdbcTemplate.queryForObject(sql, Integer.class);
                    sql = " select value, DATE_FORMAT( record_time, '%H:%i:%S' ) as record_time  from base_device_health_index where device_sn='" + deviceSn + "' and record_time >= '" + stateDate + "' and record_time <= '" + endDate + "' ORDER BY record_time desc";
                    List<Map<String, Object>> ygList = jdbcTemplate.queryForList(sql);
                    JSONArray ygJsonArray = JSONArray.parseArray(ygList.toString());
                    yg.setDailyId(zhaohuiID);
                    yg.setOnline(1);
                    yg.setType(1);
                    if (ygTotal>0) {
                        yg.setSecStatus(1);
                    }else {
                        yg.setSecStatus(0);
                    }
                    yg.setFireCurve(ygJsonArray.toJSONString());
                    zhaohuifireGasSecEntityList.add(yg);
                    break;
                case 15: //气感
                    sql = " select count(o.id) as total from base_security_monitoring_order o " +
                            " INNER JOIN base_patient p on p.id = o.patient where device_sn='"+deviceSn+"' and o.status=1 and o.create_time >= '"+stateDate+"' and o.create_time <= '"+endDate+"' ORDER BY create_time desc  limit 1 ";
                    Integer qgTotal = jdbcTemplate.queryForObject(sql, Integer.class);
                    ZhaohuifireGasSecEntity qg = new ZhaohuifireGasSecEntity();
                    qg.setDailyId(zhaohuiID);
                    qg.setOnline(1);
                    qg.setType(2);
                    if (qgTotal>0) {
                        qg.setSecStatus(1);
                    }else {
                        qg.setSecStatus(0);
                    }
                    sql = " select value,DATE_FORMAT( record_time, '%H:%i:%S' ) as record_time  from base_device_health_index where device_sn='"+deviceSn+"' and record_time >='"+stateDate+"' and record_time <= '"+endDate+"'  ORDER BY record_time desc limit 1 ";
                    List<Map<String, Object>> qgList = jdbcTemplate.queryForList(sql);
                    JSONArray qgJsonArray = JSONArray.parseArray(qgList.toString());
                    qg.setFireCurve(qgJsonArray.toJSONString());
                    zhaohuifireGasSecEntityList.add(qg);
                    break;
            }
        }
        wxPush(old.getName(),familyCode, zhaohuiDailyEntity.getService(), emeTotal);
        String secMessage = "";
        String deviceMessage = "";
        //判断是否存在预警
        secSql = "select serve_desc,status total,serve_desc from  base_security_monitoring_order where patient= '" + oldId + "' and create_time>='" + stateDate + "' and create_time<='" + endDate + "' and status <> -1 order by create_time DESC  ";
        list = jdbcTemplate.queryForList(secSql);
        if (list.size() > 0) {
            secMessage = dictService.findCopywriting("zhaohui_dailyReport", "family_eme1");
            secMessage = secMessage.replace("<serve>",list.get(0).get("serve_desc").toString()).replace("<status>","");
        }else {
            secMessage = dictService.findCopywriting("zhaohui_dailyReport", "family_eme2");
        }
        if (deviceTotal>0) {
            deviceMessage = dictService.findCopywriting("zhaohui_dailyReport", "family_device1");
            deviceMessage.replace("<deviceName>",deviceName.replace(",",""));
        }else {
            deviceMessage = dictService.findCopywriting("zhaohui_dailyReport", "family_device2");
        }
        zhaohuiDailyEntity.setMessage(old.getName()+sex+secMessage+deviceMessage);
        zhaohuiDailyDao.save(zhaohuiDailyEntity);
@ -368,11 +467,13 @@ public class ZhaohuiDailyService {
        messageUtil.putTemplateWxMessage(wxId,"template_zhrb","zhrb","123456",first,null,null,1,null,"",key2+"",liftOlderTotal+"","【推送完成】",DateUtil.getStringDate());
*/
        wxPush(old.getName(),familyCode, zhaohuiDailyEntity.getService(), emeTotal);
        zhaohuiDailySleepDao.save(zhaohuiDailySleepList);
        zhaohuiDailyWatchDao.save(zhaohuiDailyWatchList);
        zhaohuiDailyVideoDao.save(zhaohuiDailyVideoList);
        zhaohuiDailyEmeDao.save(zhaohuiDailyEmeList);
        zhaohuifireGasSecDao.save(zhaohuifireGasSecEntityList);
    }
@ -385,11 +486,140 @@ public class ZhaohuiDailyService {
                String content = "紧急预警:" + eme + "\r\n生活照料:" + lift + "";
                String url = "https://zhyzh.gongshu.gov.cn/medical-care-patient/message/daily";
                //o_DJs59V7MKJ5ea-YW__LoccEn50
                messageUtil.putTemplateWxMessage(wxId, "template_system_family", "jsxtxx", "o_DJs59V7MKJ5ea-YW__LoccEn50", first, url, null, 1, null, content, "【推送完成】", com.yihu.jw.util.date.DateUtil.getStringDate());
                messageUtil.putTemplateWxMessage(wxId, "template_system_family", "jsxtxx", list.get(0).get("openid").toString(), first, url, null, 1, null, content, "【推送完成】", com.yihu.jw.util.date.DateUtil.getStringDate());
            }
    }
    //行动轨迹
    public JSONArray getX1Locations(String patient, String date){
        String sql = "select * from wlyy_patient_device where user = '"+patient+"' and category_code = '4' and del = 0";
        List<DevicePatientDevice> byUserAndCategoryCode = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(DevicePatientDevice.class));
        if (byUserAndCategoryCode.size()==0){
            return null;
        }
        JSONArray x1Locations = JSON.parseArray(JSON.toJSONString(patientDeviceService.getX1Locations(byUserAndCategoryCode.get(0).getDeviceSn(), date), SerializerFeature.WriteMapNullValue));
        return x1Locations;
    }
    public void doctorDaily(){
        String doctorSql ="select id from base_team where org_code = 'zdjsylfwyxgszhfgs' ";
        String date = DateUtil.getStringDateShort();
        String stateDate = date + " 00:00:00";
        String endDate = date + " 23:59:59";
        List<Map<String, Object>> orgList = jdbcTemplate.queryForList(doctorSql);
        List<ZhaohuiDailyEntity> zhaohuiDailyEntityList = new ArrayList<>();
        for (Map<String, Object> map : orgList) {
            ZhaohuiDailyEntity zhaohuiDailyEntity = new ZhaohuiDailyEntity();
            String dailySql = "SELECT count(d.id) as total ,GROUP_CONCAT(patient_name) as patientName,sum(eme_num) as  emeNum,SUM(service) as serviceNum FROM base_zhaohui_daily d INNER JOIN base_team t ON d.org_code = t.id where d.org_code = '"+map.get("id")+"' and d.user_type = 1  and d.create_time >= '"+stateDate+"' and d.create_time<= '"+endDate+"' GROUP BY d.org_code ";
            List<Map<String, Object>> list = jdbcTemplate.queryForList(dailySql);
            if (list.size()>0) {
                String message = "";
                Integer emeNum = Integer.parseInt(list.get(0).get("emeNum").toString());
                String oldNUm = list.get(0).get("total").toString();
                Boolean flag = true;
                if (0<emeNum){
                    String oldNumMessage = dictService.findCopywriting("zhaohui_dailyReport", "doctor_oldnum");
                    message +=oldNumMessage.replace("<num>",oldNUm);
                    message += ","+dictService.findCopywriting("zhaohui_dailyReport", "doctor_emeNum").replace("<num>",emeNum.toString());
                }else {
                    flag = false;
                    message = dictService.findCopywriting("zhaohui_dailyReport", "doctor_zhaohui_daily1").replace("<num>",oldNUm);
                }
                String doctorInfoSql ="SELECT d.id,d.`name`,d.photo FROM base_team t INNER JOIN base_doctor d ON t.leader_code = d.id  WHERE t.id = '"+map.get("id")+"'";
                List<Map<String, Object>> doctorInfoList = jdbcTemplate.queryForList(doctorInfoSql);
                zhaohuiDailyEntity.setUserType(3);
                zhaohuiDailyEntity.setEmeNum(Integer.parseInt(list.get(0).get("emeNum").toString()));
                zhaohuiDailyEntity.setService(Integer.parseInt(list.get(0).get("serviceNum").toString()));
                zhaohuiDailyEntity.setPatient(doctorInfoList.get(0).get("id").toString());
                zhaohuiDailyEntity.setPatientName(doctorInfoList.get(0).get("name").toString());
                zhaohuiDailyEntity.setFamilyCode(list.get(0).get("patientName").toString());
                zhaohuiDailyEntity.setOrgCode(map.get("id").toString());
                zhaohuiDailyEntity.setPhoto(doctorInfoList.get(0).get("photo").toString());
                zhaohuiDailyEntity.setCreateTime(new Date());
                zhaohuiDailyEntity.setServiceTime(stateDate+","+endDate);
                if (flag) {
                    String emeSecstatusSql = "SELECT count(a.total) total, a.`status` FROM (\n" +
                            "SELECT count(o.id) total ,o.`status` AS `status` FROM base_team t INNER JOIN base_service_package_sign_record r ON t.leader_code = r.sign_doctor INNER JOIN base_emergency_assistance_order o ON o.patient = r.patient WHERE t.id = '" + map.get("id") + "' and o.status <> -1 AND o.create_time >='" + stateDate + "' AND o.create_time<='" + endDate + "' GROUP BY o.`status`\n" +
                            "UNION ALL\n" +
                            "SELECT count(o.id) total ,o.`status` AS `status` FROM base_team t INNER JOIN base_service_package_sign_record r ON t.leader_code = r.sign_doctor INNER JOIN base_security_monitoring_order o ON o.patient = r.patient WHERE t.id = '" + map.get("id") + "' and o.status <> -1 AND o.create_time >='" + stateDate + "' AND o.create_time<='" + endDate + "'  GROUP BY o.`status`\n" +
                            ") a  GROUP BY a.`status`";
                    List<Map<String, Object>> emeSecStatusList = jdbcTemplate.queryForList(emeSecstatusSql);
                    Integer statusNUm = 0;
                    if (emeSecStatusList.size() > 0) {
                        for (Map<String, Object> stringObjectMap : emeSecStatusList) {
                            Integer.parseInt(stringObjectMap.get("status").toString());
                            if (0 == Integer.parseInt(stringObjectMap.get("status").toString())) {
                                statusNUm = Integer.parseInt(stringObjectMap.get("total").toString());
                            }
                        }
                    }
                    if (statusNUm == emeNum||statusNUm<emeNum) {
                        message += ","+dictService.findCopywriting("zhaohui_dailyReport", "doctor_emeStatus2");
                    }else {
                        message += ","+dictService.findCopywriting("zhaohui_dailyReport", "doctor_emeStatus1").replace("<num>",(emeNum-statusNUm)+"");
                    }
                }
                zhaohuiDailyEntity.setMessage(message);
                zhaohuiDailyEntityList.add(zhaohuiDailyEntity);
            }
        }
        zhaohuiDailyDao.save(zhaohuiDailyEntityList);
    }
    public void child(){
        String sql = "select * from base_patient where archive_type = 2 and id not in (SELECT dict_code FROM wlyy_hospital_sys_dict WHERE `dict_name` = 'jkzl_child')";
        List<BasePatientDO> childEntityList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(BasePatientDO.class));
        List<ZhaohuiDailyEntity> zhaohuiDailyEntityList = new ArrayList<>();
        for (BasePatientDO child : childEntityList) {
            sql = "select p.id from base_patient_family_member m inner join base_patient p on m.family_member = p.id where m.patient = '"+child.getId()+"' and p.del = 1 ";
            List<Map<String, Object>> familyList = jdbcTemplate.queryForList(sql);
            if (familyList.size() > 0) {
                for (Map<String, Object> map : familyList) {
                    ZhaohuiDailyEntity zhaohuiDailyEntity = new ZhaohuiDailyEntity();
                    zhaohuiDailyEntity.setPhoto(child.getPhoto());
                    zhaohuiDailyEntity.setPatientName(child.getName());
                    zhaohuiDailyEntity.setPatient(child.getId());
                    zhaohuiDailyEntity.setUserType(2);
                    zhaohuiDailyEntity.setCreateTime(new Date());
                    //上门辅导
                    String upDoorSql = "select count(id) from base_door_coach_order where patient = '" + child.getId() + "' and status<> -1 and create_time >= '' and create_time >= '' ";
                    Integer num = jdbcTemplate.queryForObject(upDoorSql, Integer.class);
                    zhaohuiDailyEntity.setService(num);
                    String activitySql = "select count(id) from base_child_activity_registration where patient = '" + child.getId() + "' and create_time >= '' and create_time >= '' ";
                    num = jdbcTemplate.queryForObject(activitySql, Integer.class);
                    zhaohuiDailyEntity.setEmeNum(num);
                    zhaohuiDailyEntity.setFamilyCode(map.get("id").toString());
                    zhaohuiDailyEntityList.add(zhaohuiDailyEntity);
                }
            }
        }
        for (ZhaohuiDailyEntity zhaohuiDailyEntity : zhaohuiDailyEntityList) {
             sql = "select openid from base_patient where id = '" + zhaohuiDailyEntity.getFamilyCode() + "' and openid is not null ";
            List<Map<String, Object>> openidList = jdbcTemplate.queryForList(sql);
            if (openidList.size()>0) {
                openidList.get(0).get("openid");
                String first = "您好,您的亲属【" + zhaohuiDailyEntity.getPatientName() + "】今日照护日报已生成";
                String content = "上门辅导:" + zhaohuiDailyEntity.getService() + "\r\n在线教育:" + zhaohuiDailyEntity.getEmeNum() + "";
                String url = "https://zhyzh.gongshu.gov.cn/medical-care-patient/message/daily?type=2";
                //o_DJs59V7MKJ5ea-YW__LoccEn50
                messageUtil.putTemplateWxMessage(wxId, "template_system_family", "jsxtxx", "o_DJs59V7MKJ5ea-YW__LoccEn50", first, url, null, 1, null, content, "【推送完成】", com.yihu.jw.util.date.DateUtil.getStringDate());
            }
        }
        zhaohuiDailyDao.save(zhaohuiDailyEntityList);
    }
    public static void main(String[] args) {
        String abc = "[\"12:30-14:09\",\"22:00-04:06\",\"05:09-05:24\"]";
        String[] split = abc.split(",");
@ -401,4 +631,6 @@ public class ZhaohuiDailyService {
    }
}

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

@ -13,6 +13,7 @@ import com.yihu.jw.care.service.WlyysimFlowVoiceService;
import com.yihu.jw.care.service.device.InitializeDataJobService;
import com.yihu.jw.care.service.device.WechatPushService;
import com.yihu.jw.care.service.hz.HzInterfaceService;
import com.yihu.jw.care.service.message.ZhaohuiDailyService;
import com.yihu.jw.care.util.SystemConf;
import com.yihu.jw.restmodel.web.ObjEnvelop;
import io.swagger.annotations.Api;
@ -53,6 +54,35 @@ public class JobController extends BaseController {
    @Autowired
    private HzInterfaceService hzInterfaceService;
    @Autowired
    private ZhaohuiDailyService zhaohuiDailyService;
    @RequestMapping(value = "ZhaohuiDailyService", method = RequestMethod.GET)
    @ApiOperation("123")
    public String abc() {
        try {
            zhaohuiDailyService.doctorDaily();
            return success("更新成功!");
        } catch (Exception e) {
            error(e);
            return error(-1, "更新失败:" + e.getMessage());
        }
    }
    @RequestMapping(value = "child", method = RequestMethod.GET)
    @ApiOperation("456")
    public String child() {
        try {
            zhaohuiDailyService.child();
            return success("更新成功!");
        } catch (Exception e) {
            error(e);
            return error(-1, "更新失败:" + e.getMessage());
        }
    }
    @RequestMapping(value = "electricityTable", method = RequestMethod.GET)
    @ApiOperation("收到更新居民电表数据")
    public String electricityTable(String queryDate) {