Procházet zdrojové kódy

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

 Conflicts:
	svr/svr-cloud-job/src/main/resources/system.properties
liubing před 3 roky
rodič
revize
8f41ca07e7

+ 154 - 4
business/base-service/src/main/java/com/yihu/jw/hospital/prescription/service/entrance/EntranceService.java

@ -13,13 +13,16 @@ import com.yihu.jw.entity.base.doctor.BaseDoctorDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorHospitalDO;
import com.yihu.jw.entity.base.doctor.BaseDoctorRoleDO;
import com.yihu.jw.entity.base.patient.BasePatientDO;
import com.yihu.jw.entity.base.patient.PatientMedicareCardDO;
import com.yihu.jw.entity.hospital.consult.WlyyHospitalSysDictDO;
import com.yihu.jw.entity.hospital.dict.WlyyChargeDictDO;
import com.yihu.jw.entity.hospital.doctor.BaseDoctorZsInfoDO;
import com.yihu.jw.entity.hospital.httplog.WlyyHttpLogDO;
import com.yihu.jw.entity.hospital.mapping.DoctorMappingDO;
import com.yihu.jw.entity.hospital.mapping.PatientMappingDO;
import com.yihu.jw.entity.hospital.prescription.WlyyOutpatientDO;
import com.yihu.jw.entity.hospital.prescription.WlyyPrescriptionDO;
import com.yihu.jw.entity.order.BusinessOrderDO;
import com.yihu.jw.hospital.dict.WlyyChargeDictDao;
import com.yihu.jw.hospital.dict.WlyyHospitalSysDictDao;
import com.yihu.jw.hospital.httplog.dao.WlyyHttpLogDao;
@ -32,12 +35,17 @@ import com.yihu.jw.hospital.prescription.dao.PrescriptionEmrDao;
import com.yihu.jw.hospital.prescription.service.entrance.util.ConvertUtil;
import com.yihu.jw.hospital.prescription.service.entrance.util.MqSdkUtil;
import com.yihu.jw.hospital.prescription.service.entrance.util.WebserviceUtil;
import com.yihu.jw.order.dao.BusinessOrderDao;
import com.yihu.jw.order.pay.ylz.YlzPayService;
import com.yihu.jw.patient.dao.BasePatientMedicareCardDao;
import com.yihu.jw.restmodel.hospital.archive.ArchiveVO;
import com.yihu.jw.restmodel.hospital.prescription.*;
import com.yihu.jw.util.common.PwdUtil;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.http.HttpClientUtil;
import com.yihu.jw.util.idcard.IdCardUtil;
import com.ylzinfo.onepay.sdk.domain.ResponseParams;
import com.ylzinfo.onepay.sdk.domain.ext.RefundResult;
import net.sf.json.JSON;
import net.sf.json.JSONArray;
import net.sf.json.xml.XMLSerializer;
@ -99,7 +107,7 @@ public class EntranceService {
    private static String BS16018 = "BS16018";
    //his退费接口
    private static String BS15021 = "BS15021";
    private static String BS15051 = "BS15051";
    private String orgCode = "350211A1002";
    private String orgName = "350211A1002";
@ -144,6 +152,10 @@ public class EntranceService {
    private WlyyHttpLogDao wlyyHttpLogDao;
    @Autowired
    private BaseDoctorRoleDao baseDoctorRoleDao;
    @Autowired
    private BusinessOrderDao businessOrderDao;
    @Autowired
    private BasePatientMedicareCardDao basePatientMedicareCardDao;
    private static String entranceUrl="http://172.16.100.240:10023/mqsdk/";
//    private static String entranceUrl="http://localhost:10023/mqsdk/";
@ -1417,11 +1429,11 @@ public class EntranceService {
     * @return
     * @throws Exception
     */
    public JSONArray BS15021(String userId, String userName, String cardType, String cardNo, String accountType,String idNo,
    public JSONArray BS15051(String userId, String userName, String cardType, String cardNo, String accountType,String idNo,
                             String withdrawMode,String depositType,String ServiceType,String amount,String outRefundNo,
                             String outChargeNo,String origTraceNo,String traceSerial,String paydate,String notes,String tradeState,
                             String failReason,String failTime,String extra, boolean demoFlag) throws Exception {
        String fid = BS15021;
        String fid = BS15051;
        String resp = "";
        if (demoFlag) {
            resp = getJosnFileResullt(fid);
@ -1499,7 +1511,7 @@ public class EntranceService {
            WlyyHttpLogDO wlyyHttpLogDO = new WlyyHttpLogDO();
            wlyyHttpLogDO.setRequest(sbs.toString());
            wlyyHttpLogDO.setResponse(resp);
            wlyyHttpLogDO.setCode(BS15021);
            wlyyHttpLogDO.setCode(BS15051);
            wlyyHttpLogDO.setName("预交金退款");
            wlyyHttpLogDO.setCreateTime(new Date());
            wlyyHttpLogDao.save(wlyyHttpLogDO);
@ -1507,6 +1519,144 @@ public class EntranceService {
        return ConvertUtil.convertListEnvelopInBodyRow(resp);
    }
    /**
     * 门诊预缴金退费接口
     *
     * @param outPatientId 门诊表id
     * @return
     * @throws Exception
     */
    public String hisRefund(String outPatientId) throws Exception {
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(outPatientId);
        if (outpatientDO == null){
            return "门诊信息表为空";
        }
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outPatientId);
        if (businessOrderDO == null){
            return "订单表为空";
        }
        PatientMedicareCardDO patientMedicareCardDO = basePatientMedicareCardDao.findByCode(outpatientDO.getCardNo());
        if (patientMedicareCardDO == null){
            return "患者卡包为空";
        }
        String userId = outpatientDO.getPatient();
        String userName = outpatientDO.getPatientName();
        String idNo = outpatientDO.getIdcard();
        String cardType = "03";
        if ("A_01".equals(patientMedicareCardDO.getType())){
            cardType = "01";
        }
        String cardNo =outpatientDO.getCardNo();
        String accountType = "01";
        String withdrawMode = "";
        String depositType = "";
        if (businessOrderDO.getPayType()==3){
            depositType = "WX_PUB";
        }
        String ServiceType = "04";
        String outChargeNo = "";
        String traceSerial = "";
        String tradeState="";
        String paydate ="";
        String notes = "";
        String failReason = "";
        String failTime = "";
        String extra = "";
        boolean demoFlag = false;
        String amount = businessOrderDO.getPayPrice().toString();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
        String uuid = sdf.format(new Date()) + UUID.randomUUID().toString().replaceAll("-", "").substring(0, 4);
        String outRefundNo = uuid;
        String origTraceNo = businessOrderDO.getTraceNo();
        //调用his退费接口
        JSONArray jsonArray = BS15051(userId, userName, cardType, cardNo, accountType, idNo, withdrawMode, depositType, ServiceType, amount, outRefundNo, outChargeNo, origTraceNo, traceSerial, paydate, notes, tradeState, failReason, failTime, extra, demoFlag);
        YlzPayService ylzPayService = new YlzPayService();
        //调用易联众预缴金退款接口
        String refund = ylzPayService.refund(userId, userName, cardType, accountType, cardNo, idNo, amount, outChargeNo, userName, withdrawMode, traceSerial, outRefundNo,cardNo);
        JSONObject jsonObject = JSONObject.parseObject(refund);
        //获取调用易联众退费接口交易状态
        String respCode = jsonObject.getString("respCode");
        if (respCode.equals("000000")){
            tradeState = "succ";
        }else {
            tradeState = "fail";
        }
        JSONArray resp = BS15051(userId, userName, cardType, cardNo, accountType, idNo, withdrawMode, depositType, ServiceType, amount, outRefundNo, outChargeNo, origTraceNo, traceSerial, paydate, notes, tradeState, failReason, failTime, extra, demoFlag);
        String result = resp.toString();
        return result;
    }
    /**
     * 门诊预缴金退费接口(系统自动退费)
     *
     * @param outPatientId 门诊表id
     * @return
     * @throws Exception
     */
    public String autoRefund(String outPatientId) throws Exception {
        WlyyOutpatientDO outpatientDO = outpatientDao.findById(outPatientId);
        if (outpatientDO == null){
            return "门诊信息表为空";
        }
        BusinessOrderDO businessOrderDO = businessOrderDao.selectByRelationCode(outPatientId);
        if (businessOrderDO == null){
            return "订单表为空";
        }
        PatientMedicareCardDO patientMedicareCardDO = basePatientMedicareCardDao.findByCode(outpatientDO.getCardNo());
        if (patientMedicareCardDO == null){
            return "患者卡包为空";
        }
        String operatorId = "9690";
        String operatorName = "9690";
        String userName = outpatientDO.getPatientName();
        String idNo = outpatientDO.getIdcard();
        String cardType = "03";
        if ("A_01".equals(patientMedicareCardDO.getType())){
            cardType = "01";
        }
        String cardNo = patientMedicareCardDO.getMedicareNumber();
        String accountType = "01";
        String withdrawMode = "1";
        String depositType = "";
        if (businessOrderDO.getPayType()==3){
            depositType = "WX_PUB";
        }
        String ServiceType = "04";
        String outChargeNo = "";
        String traceSerial = "";
        String tradeState="";
        String paydate ="";
        String notes = "";
        String failReason = "";
        String failTime = "";
        String extra = "";
        boolean demoFlag = false;
        String amount = businessOrderDO.getPayPrice().toString();
        SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmss");
        String uuid = sdf.format(new Date()) + UUID.randomUUID().toString().replaceAll("-", "").substring(0, 4);
        String outRefundNo = uuid;
        String origTraceNo = businessOrderDO.getTraceNo();
        //调用his退费接口
        JSONArray jsonArray = BS15051(operatorId, operatorName, cardType, cardNo, accountType, idNo, withdrawMode, depositType, ServiceType, amount, outRefundNo, outChargeNo, origTraceNo, traceSerial, paydate, notes, tradeState, failReason, failTime, extra, demoFlag);
        YlzPayService ylzPayService = new YlzPayService();
        //调用易联众预缴金退款接口
        String refund = ylzPayService.refund(operatorId, operatorName, cardType, accountType, cardNo, idNo, amount, outChargeNo, userName, withdrawMode, traceSerial, outRefundNo,cardNo);
        JSONObject jsonObject = JSONObject.parseObject(refund);
        //获取调用易联众退费接口交易状态
        String respCode = jsonObject.getString("respCode");
        if (respCode.equals("000000")){
            tradeState = "succ";
        }else {
            tradeState = "fail";
        }
        JSONArray resp = BS15051(operatorId, operatorName, cardType, cardNo, accountType, idNo, withdrawMode, depositType, ServiceType, amount, outRefundNo, outChargeNo, origTraceNo, traceSerial, paydate, notes, tradeState, failReason, failTime, extra, demoFlag);
        String result = resp.toString();
        return result;
    }
    /**
     * 检查检验
     *

+ 9 - 5
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/family/FamilyMemberEndpoint.java

@ -17,6 +17,7 @@ import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
@ -95,9 +96,9 @@ public class FamilyMemberEndpoint extends EnvelopRestEndpoint {
    public Envelop addOlderByRelatives(
            @ApiParam(name = "relatives",value = "家属code")
            @RequestParam("relatives") String relatives,
            @ApiParam(name = "name",value = "老人姓名")
            @ApiParam(name = "name",value = "老人/幼儿 姓名")
            @RequestParam("name") String name,
            @ApiParam(name = "idcard",value = "老人身份证")
            @ApiParam(name = "idcard",value = "老人/幼儿 身份证")
            @RequestParam("idcard") String idcard,
            @RequestParam(value = "relation",defaultValue = "0") Integer relation,
@ -107,14 +108,17 @@ public class FamilyMemberEndpoint extends EnvelopRestEndpoint {
            @ApiParam(name = "relativesIdcard",value = "家属本人身份证")
            @RequestParam(value = "relativesIdcard",required = false) String relativesIdcard,
            @ApiParam(name = "relativesSex",value = "家属本人性别")
            @RequestParam(value = "relativesSex",required = false) String relativesSex
            /**********************/) {
            @RequestParam(value = "relativesSex",required = false) String relativesSex,
            /**********************/
            @ApiParam(name = "type",value = "类型  1老人   2幼儿")
            @RequestParam(value = "type",required = true) Integer type
            ) {
        try {
            if (StringUtils.isEmpty(relatives)) {
                return failed("当前用户信息错误",-1);
            }
            JSONObject result = familyMemberService.addOlderByRelatives(relatives,name,idcard,relation,relativesName,relativesIdcard,relativesSex);
            JSONObject result = familyMemberService.addOlderByRelatives(relatives,name,idcard,relation,relativesName,relativesIdcard,relativesSex,type);
            if (result.getInteger(ResponseContant.resultFlag)==ResponseContant.success){
                return success("添加成功");
            }else {

+ 31 - 1
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/endpoint/security/SecurityMonitoringOrderEndpoint.java

@ -349,13 +349,27 @@ public class SecurityMonitoringOrderEndpoint extends EnvelopRestEndpoint {
        }
    }
    @ApiOperation("获取行动轨迹")
    @RequestMapping(value = "getX1Locations",method = {RequestMethod.POST,RequestMethod.GET})
    @ResponseBody
    public ObjEnvelop getX1Locations(@ApiParam(name = "patient",value = "patient")
                                     @RequestParam(value = "patient")String patient,
                                     @ApiParam(name = "date",value = "date")
                                     @RequestParam(value = "date")String date){
        try {
            return ObjEnvelop.getSuccess("查询成功",securityMonitoringOrderService.getX1Locations(patient,date));
        } catch (Exception e) {
            return failedObjEnvelopException2(e);
        }
    }
    @ApiOperation("助老员端获取日常监护居民")
    @GetMapping(value = "findMonitorPatientsByDoctor")
    @ResponseBody
    public ObjEnvelop findMonitorPatientsByDoctor(@ApiParam(name = "doctor",  required = true)@RequestParam(value = "doctor")String doctor,
                                                  @ApiParam(name = "topicItem", value = "专题code,关联security_topic_dict字典,actionTrack行动轨迹", required = true)
                                                  @RequestParam(value = "topicItem",required = true,defaultValue = "preventLost") String topicItem,
                                                  @ApiParam(name = "day", value = "day", required = false)
                                                      @ApiParam(name = "day", value = "day", required = false)
                                                  @RequestParam(value = "day",required = false) String day,
                                                  @ApiParam(name = "page")
                                                  @RequestParam(value = "page",required = false) Integer page,
@ -404,6 +418,22 @@ public class SecurityMonitoringOrderEndpoint extends EnvelopRestEndpoint {
        }
    }
    @PostMapping("know")
    @ApiOperation(value = "我已知悉")
    @ObserverRequired
    public Envelop know(
            @ApiParam(value = "工单id", name = "orderId")
            @RequestParam(value = "orderId", required = true) String orderId,
            @ApiParam(value = "doctor", name = "doctor")
            @RequestParam(value = "doctor", required = true) String doctor) {
        try {
            securityMonitoringOrderService.know(doctor, orderId);
            return ObjEnvelop.getSuccess("操作成功");
        } catch (Exception e) {
            return failedException2(e);
        }
    }
    @PostMapping(value = "updateDoctorLocation")
    @ApiOperation(value = "更新医生定位信息")
    @ObserverRequired

+ 30 - 5
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/family/PatientFamilyMemberService.java

@ -221,7 +221,7 @@ public class PatientFamilyMemberService extends BaseJpaService<BasePatientFamily
        return 1;
    }
    public JSONObject addOlderByRelatives(String relatives,String name,String idcard,Integer relation,String relativesName,String relativesIdcard,String relativesSex) throws Exception {
    public JSONObject addOlderByRelatives(String relatives,String name,String idcard,Integer relation,String relativesName,String relativesIdcard,String relativesSex,Integer type) throws Exception {
        JSONObject result = new JSONObject();
        BasePatientDO patientDO = patientDao.findById(relatives);
@ -255,11 +255,36 @@ public class PatientFamilyMemberService extends BaseJpaService<BasePatientFamily
            return result;
        }
        List<BasePatientDO> addPatients = patientDao.findByNameAndIdcard(name,idcard);
        if (addPatients.size()==0){
            result.put(ResponseContant.resultFlag,ResponseContant.fail);
            result.put(ResponseContant.resultMsg,"添加成员不存在");
            return result;
        if (2  == type){
            if (addPatients.size()==0){
                BasePatientDO basePatientDO = new BasePatientDO();
                String salt = UUID.randomUUID().toString().substring(0, 5);
                String pw = "";
                if(true){
                    pw = idcard.substring(idcard.length()-7,idcard.length()-1);
                }else{
                    pw = idcard.substring(idcard.length()-6);
                }
                basePatientDO.setIdcard(idcard);
                basePatientDO.setName(name);
                basePatientDO.setPassword(com.yihu.utils.security.MD5.md5Hex(pw + "{" + salt + "}"));
                basePatientDO.setSalt(salt);
                basePatientDO.setArchiveType(2);
                basePatientDO.setArchiveStatus(3);
                basePatientDO.setCreateUserName(relatives);
                basePatientDO.setCreateTime(new Date());
                basePatientDO.setDel("1");
                patientDao.save(basePatientDO);
            }
        }else {
            if (addPatients.size()==0){
                result.put(ResponseContant.resultFlag,ResponseContant.fail);
                result.put(ResponseContant.resultMsg,"添加成员不存在");
                return result;
            }
        }
        BasePatientDO addPatient = addPatients.get(0);
        // 添加自己与对方的关系

+ 74 - 0
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/security/SecurityMonitoringOrderService.java

@ -46,6 +46,7 @@ import com.yihu.jw.util.common.IdCardUtil;
import com.yihu.jw.util.common.LatitudeUtils;
import com.yihu.jw.util.date.DateUtil;
import com.yihu.jw.util.entity.EntityUtils;
import com.yihu.jw.util.healthIndex.HealthIndexUtil;
import com.yihu.mysql.query.BaseJpaService;
import jdk.nashorn.internal.runtime.FindProperty;
import org.apache.commons.lang3.StringUtils;
@ -139,6 +140,8 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
    private BaseOrgDao orgDao;
    @Autowired
    private DeviceDetailDao deviceDetailDao;
    @Autowired
    private HealthIndexUtil healthIndexUtil;
    private Logger logger = LoggerFactory.getLogger(SecurityMonitoringOrderService.class);
@ -1575,6 +1578,7 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
    /**
     * 老人家属首页实时监护信息
     * 居家状态取手表 无手表缺省
     * 最近 血糖  血压记录
     * 监控
     */
    public JSONObject patientMonitoringInfo2(String patient) {
@ -1647,9 +1651,62 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        }
        patientSignTopicInfo(result, patient, "preventFall", null, true);
        String healthXYSql ="SELECT value1,value2,value3 FROM wlyy_patient_health_index WHERE `user` = '"+patient+"' AND type = 2  ORDER BY record_date DESC LIMIT 1";
        List<Map<String, Object>> XY = jdbcTemplate.queryForList(healthXYSql);
        String healthXTSql ="SELECT value1,value2,value3,value4 FROM wlyy_patient_health_index WHERE `user` = '"+patient+"' AND type = 1  ORDER BY record_date DESC LIMIT 1";
        List<Map<String, Object>> XT = jdbcTemplate.queryForList(healthXTSql);
        if (XY.size()!= 0) {
            for (Map<String, Object> map : XY) {
                //HealthIndexUtil.verifyHealthIndex
                JSONArray jsonArray = healthIndexUtil.verifyHealthIndex(2, map.get("value1").toString(), map.get("value2").toString(), map.get("value3").toString());
                if(jsonArray.size()==0){
                    map.put("value1Index","");
                    map.put("value2Index","");
                    //map.put("value3Index","");
                }else {
                    //收缩压
                    map.put("value1Index",jsonArray.getJSONObject(0).get("error"));
                    //舒张压
                    map.put("value2Index",jsonArray.getJSONObject(1).get("error"));
                    //脉搏
                    //map.put("value3Index",jsonArray.getJSONObject(2).get("error"));
                }
                result.put("xy",map);
            }
        }else {
            result.put("xy",null);
        }
        if (XT.size()!= 0) {
            for (Map<String, Object> map : XT) {
                JSONArray jsonArray = healthIndexUtil.verifyHealthIndex(1, map.get("value1").toString(), map.get("value2").toString());
                if(jsonArray.size()==0){
                    map.put("value1Index","");
                }else {
                    //血糖
                    map.put("value1Index",jsonArray.getJSONObject(0).get("error"));
                }
                result.put("xt",map);
            }
        }else {
            result.put("xt",null);
        }
        return result;
    }
    //行动轨迹
    public JSONArray getX1Locations(String patient, String date){
        List<DevicePatientDevice> byUserAndCategoryCode = patientDeviceDao.findByUserAndCategoryCode(patient, "4");//手表
        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 preventLost(JSONObject result, String patient, String deviceSn) {
        //手表与拐杖同时绑定时优先手表,围栏状态其中一个超出围栏即为超出围栏
        try {
@ -2086,6 +2143,23 @@ public class SecurityMonitoringOrderService extends BaseJpaService<SecurityMonit
        return result;
    }
    /**
     * 我已知悉
     */
    public void know(String doctor,String orderId){
        BaseDoctorDO doctorDO = baseDoctorDao.findById(doctor);
        if (null != doctorDO) {
            BaseEmergencyWarnLogDO logDO = new BaseEmergencyWarnLogDO();
            logDO.setUserCode(doctor);
            logDO.setUserName(doctorDO.getName());
            logDO.setOrderId(orderId);
            logDO.setUserType(2);
            logDO.setCreateTime(new Date());
            logDO.setContent("社工" + doctorDO.getName() + "已知悉");
            logDao.save(logDO);
        }
    }
    /**
     * 获取居民睡眠计划
     */

+ 34 - 4
svr/svr-cloud-care/src/main/java/com/yihu/jw/care/service/statistics/StatisticsService.java

@ -798,9 +798,16 @@ public class StatisticsService {
            if (StringUtils.isNotBlank(type)) {
                //周/月 增量
                String start = statisticsUtilService.calStart(endDate, type);
                SaveModel saveModelAdd = elasticsearchUtil.findOneDateQuotaLevel0(start, endDate, area, level, ind, SaveModel.timeLevel_ZL, areaLevel);
                res.put("index_" + ind + "_add", saveModelAdd.getResult2().longValue());
                long addNum = 0;
                if("55".equals(ind)){
                    //已关联家属老人数 增量用2个时间相减
                    SaveModel saveModelstart = elasticsearchUtil.findOneDateQuotaLevel0(start, start, area, level, ind, SaveModel.timeLevel_DDL, areaLevel);
                    addNum = saveModel.getResult2().longValue() - saveModelstart.getResult2().longValue();
                }else{
                    SaveModel saveModelAdd = elasticsearchUtil.findOneDateQuotaLevel0(start, endDate, area, level, ind, SaveModel.timeLevel_ZL, areaLevel);
                    addNum = saveModelAdd.getResult2().longValue();
                }
                res.put("index_" + ind + "_add", addNum);
            }
        }
@ -1270,7 +1277,7 @@ public class StatisticsService {
    }
    /**
     * 管理端首页老人接入情况
     * 管理端首页老人接入情况,关联家属
     *
     * @return
     */
@ -1289,9 +1296,32 @@ public class StatisticsService {
        sql = " select count(DISTINCT p.id) from base_patient p INNER JOIN wlyy_patient_device pd on p.id = pd.user and p.archive_type=1 and pd.del=0 where p.del=1 and p.id " + filter;
        Integer bindingCount = jdbcTemplate.queryForObject(sql, Integer.class);
        //老人接入情况
        result.put("olderCount", olderCount);
        result.put("bindingCount", bindingCount);
        result.put("range", commonUtil.getRange(bindingCount, olderCount));
        //关联家属
        String sqlfamily = "SELECT COUNT(DISTINCT p.id)  FROM " +
                "base_patient p INNER JOIN base_service_package_sign_record sr " +
                "on p.id = sr.patient and sr.`status`=1 and  p.id not in " +
                "(SELECT dict_code from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_child' or dict_name = 'jkzl_older') " +
                ",(SELECT DISTINCT fm.family_member from base_patient_family_member fm,base_patient p1 " +
                "WHERE p1.id = fm.patient and p1.archive_type = '3') f1 " +
                "WHERE p.del = 1 and p.archive_type =1 and p.id = f1.family_member ";
        String sqlSign = "SELECT COUNT(DISTINCT p.id) FROM " +
                "base_patient p INNER JOIN base_service_package_sign_record sr " +
                "on p.id = sr.patient and sr.`status`=1 and  p.id not in " +
                "(SELECT dict_code from wlyy_hospital_sys_dict WHERE dict_name = 'jkzl_child' or dict_name = 'jkzl_older') " +
                "WHERE p.del = 1 and p.archive_type =1 ";
        Integer familyOlderCount = jdbcTemplate.queryForObject(sqlfamily, Integer.class);
        Integer familySignCount = jdbcTemplate.queryForObject(sqlSign, Integer.class);
        result.put("familyOlderCount", familyOlderCount);
        result.put("familySignCount", familySignCount);
        result.put("famulyRange", commonUtil.getRange(familyOlderCount, familySignCount));
        return result;
    }

+ 5 - 6
svr/svr-cloud-job/src/main/java/com/yihu/jw/care/job/data/SaveDataPushJob.java

@ -46,6 +46,9 @@ public class SaveDataPushJob implements Job {
    public void execute(JobExecutionContext context) throws JobExecutionException {
        // id  日期  字段(保存的) 表名(从哪里取到的)
        String date = DateUtil.dateToStrShort(new Date());
        //System.out.println(date);
        date = DateUtil.getNextDay(date, -1);
        //System.out.println(date);
        saveSecurityMonitoringOrder(date);
        saveEmergencyAssistanceOrder(date);
        saveDoorCoachOrder(date);
@ -61,14 +64,14 @@ public class SaveDataPushJob implements Job {
    //安防监护工单
    public void saveSecurityMonitoringOrder(String date){
        String securityMonitoringOrderSql="SELECT id,number,patient,serve_desc,serve_town,serve_address,doctor_name,`status`,hospital,service_status from base_security_monitoring_order WHERE create_time > '"+date+"'";
        String securityMonitoringOrderSql="SELECT id,number,patient,serve_desc,serve_town,serve_address,doctor_name,`status`,hospital,service_status from base_security_monitoring_order WHERE create_time >= '"+date+"'";
        List<ZhSecurityMonitoringOrderDO> query = jdbcTemplate.query(securityMonitoringOrderSql, new BeanPropertyRowMapper<>(ZhSecurityMonitoringOrderDO.class));
        zhSecurityMonitoringOrderDao.save(query);
    }
    //紧急救助工单
    public void saveEmergencyAssistanceOrder(String date){
        String emergencyAssistanceOrderSql ="SELECT id,patient_name,patient_phone,patient_idcard,org_name,serve_address,doctor_name,doctor_address,complete_time,team_code,proxy_patient_name,proxy_patient_phone,type,order_source FROM base_emergency_assistance_order WHERE create_time > '"+date+"'";
        String emergencyAssistanceOrderSql ="SELECT id,patient_name,patient_phone,patient_idcard,org_name,serve_address,doctor_name,doctor_address,complete_time,team_code,proxy_patient_name,proxy_patient_phone,type,order_source FROM base_emergency_assistance_order WHERE create_time >= '"+date+"'";
        List<ZhEmergencyAssistanceDO> query = jdbcTemplate.query(emergencyAssistanceOrderSql, new BeanPropertyRowMapper<>(ZhEmergencyAssistanceDO.class));
        zhEmergencyAssistanceDao.save(query);
    }
@ -129,8 +132,4 @@ public class SaveDataPushJob implements Job {
        List<ZhDeviceDetail> query = jdbcTemplate.query(deviceSql, new BeanPropertyRowMapper<>(ZhDeviceDetail.class));
        zhDeviceDetailDao.save(query);
    }
}

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

@ -30,7 +30,7 @@ EME_WARNING_OVERTIME_NOT_RESPONSE=0 0 * * * ?
EME_WARNING_OVERTIME_NOT_RESPONSE_DAY=0 30 9 * * ?
#\u5B9A\u65F6\u63A8\u9001\u4FDD\u5B58\u6570\u636E
SAVE_DATA_PUSH_JOB= 0 0 23 * * ?
SAVE_DATA_PUSH_JOB= 0 0 2 * * ? *
#\u5B9A\u65F6\u67E5\u8BE2\u79FB\u52A8\u5E73\u53F0\u7269\u8054\u5361\u4FE1\u606F
UPDATE_SIMS_JOB= 0 30 0 * * ?
@ -39,4 +39,4 @@ UPDATE_SIMS_JOB= 0 30 0 * * ?
GET_SIMS_VOICE_FLOW_DAY_JOB= 0 50 1 * * ?
#\u5B9A\u65F6\u67E5\u8BE2\u79FB\u52A8\u7269\u8054\u5361\u8BED\u97F3\uFF0C\u6D41\u91CF\u4F7F\u7528\u4FE1\u606F--\u6708
GET_SIMS_VOICE_FLOW_MONTH_JOB= 0 0 2 * * ?
GET_SIMS_VOICE_FLOW_MONTH_JOB= 0 15 2 * * ?

+ 1 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/prescription/PrescriptionEndpoint.java

@ -1183,6 +1183,7 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                if ("xm_zsyy_wx".equalsIgnoreCase(wxId)) {
                    String msgUrl = "https://hlwyy.xmzsh.com/ims-wx/index.html#/returnVisit/record?outpatientId=" + outPatientId;
                    prescriptionService.sendZsMsgFlow("OL_WZ_CANCEL", outPatientId, "", msgUrl, "取消问诊(用户)");
                    String refund = entranceService.hisRefund(outPatientId);
                }
            } catch (Exception e) {