Browse Source

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

wangjun 4 năm trước cách đây
mục cha
commit
58a0c7ea74

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

@ -4298,25 +4298,23 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
            //String prefix="https://www.xmheart.com";
            String prefix = "https://ih.xmheart.com/hlwyy";
            if(StringUtils.isNotEmpty(outpatientId)){
                responseMsg = xzzxEntranceService.sendXCXMes(wxId,
                responseMsg = xzzxEntranceService.sendMes(wxId,
                        patientDO.getId(),
                        patientDO.getIdcard(),
                        first,
                        contentMsg,
                        remark,
                        prefix+msgUrl,
                        "wx53f6bb4ac081d840");
                        prefix+msgUrl);
            }
            if (consultTeam!=null&&consPatientDO!=null){
                responseMsg = xzzxEntranceService.sendXCXMes(wxId,
                responseMsg = xzzxEntranceService.sendMes(wxId,
                        consPatientDO.getId(),
                        consPatientDO.getIdcard(),
                        first,
                        contentMsg,
                        remark,
                        prefix+msgUrl,
                        "wx53f6bb4ac081d840");
                        prefix+msgUrl);
            }
            logger.info("url="+prefix+msgUrl);
            String msg="first:"+first+"contentMsg:"+contentMsg+"remark:"+remark;
@ -8548,12 +8546,15 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
     * @param size
     * @return
     */
    public PageEnvelop findPatientAllPrescription(String keyName, String status, Integer page, Integer size) {
        String uid = userAgent.getUID();
    public PageEnvelop findPatientAllPrescription(String keyName, String status, Integer page, Integer size,String patient) {
        BasePatientDO patientDO = basePatientDao.findById(patient);
        if (patientDO==null){
            return PageEnvelop.getError("找不到该患者",-1);
        }
        StringBuffer sql = new StringBuffer(" SELECT b.*, c.oneself_pickup_flg,f.job_title_code,f.job_title_name  FROM (SELECT a.* FROM wlyy_prescription a left join wlyy_outpatient o ON o.id=a.outpatient_id  WHERE o.consumer = '");
        StringBuffer countSql = new StringBuffer("select COUNT(b.id) count FROM (SELECT a.* FROM wlyy_prescription a left join wlyy_outpatient o ON o.id=a.outpatient_id  WHERE o.consumer = '");
        sql.append(uid).append("') b  LEFT JOIN wlyy_prescription_expressage c ON c.outpatient_id = b.outpatient_id LEFT JOIN base_doctor f ON b.doctor=f.id  ");
        countSql.append(uid).append("') b  LEFT JOIN wlyy_prescription_expressage c ON c.outpatient_id = b.outpatient_id LEFT JOIN base_doctor f ON b.doctor=f.id  ");
        sql.append(patient).append("') b  LEFT JOIN wlyy_prescription_expressage c ON c.outpatient_id = b.outpatient_id LEFT JOIN base_doctor f ON b.doctor=f.id  ");
        countSql.append(patient).append("') b  LEFT JOIN wlyy_prescription_expressage c ON c.outpatient_id = b.outpatient_id LEFT JOIN base_doctor f ON b.doctor=f.id  ");
        if (StringUtils.isNotEmpty(status)) {
            status = status.substring(1, status.length() - 1);

+ 5 - 2
gateway/ag-basic/src/main/java/com/yihu/jw/gateway/filter/BasicZuulFilter.java

@ -297,9 +297,12 @@ public class BasicZuulFilter extends ZuulFilter {
        envelop.setMessage(errorMsg);
        envelop.setStatus(status);
        try {
            JSONObject object = new JSONObject();
            object.put("status","200");
            object.put("data", AesEncryptUtils.encrypt(JSONObject.toJSONString(envelop)));
            //requestContext.setResponseStatusCode(status);
            requestContext.getResponse().getWriter().write(objectMapper.writeValueAsString(envelop));
        } catch (IOException e) {
            requestContext.getResponse().getWriter().write(objectMapper.writeValueAsString(object));
        } catch (Exception e) {
            requestContext.setResponseStatusCode(ResultStatus.FAILED_RESP);
            logger.error(e.getMessage());
        }

+ 9 - 5
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/endpoint/patient/PatientNoLoginEndPoint.java

@ -906,8 +906,10 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                        for (WaitPayDetailVO waitPayDetailVO1:listWPD){
                                            if (waitPayDetailVO1.getItemName().equalsIgnoreCase("互联网医院复诊诊查费")){
                                                WlyyOutpatientDO wlyyOutpatientDO1 = outpatientDao.findByRealOrder(waitPayDetailVO1.getRecipeNo());
                                                wlyyOutpatientDO1.setHisStatus(1);
                                                outpatientDao.save(wlyyOutpatientDO1);
                                                if (wlyyOutpatientDO1!=null){
                                                    wlyyOutpatientDO1.setHisStatus(1);
                                                    outpatientDao.save(wlyyOutpatientDO1);
                                                }
                                            }
                                        }
                                        logger.info("处方结算成功"+pushPayLog+"====="+waitPayDetailVO.getRecipeNo());
@ -934,9 +936,11 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
                                        }
                                    }else {
                                        WlyyOutpatientDO wlyyOutpatientDO1 = outpatientDao.findByRealOrder(waitPayDetailVO.getRecipeNo());
                                        wlyyOutpatientDO1.setHisStatus(1);
                                        outpatientDao.save(wlyyOutpatientDO1);
                                        logger.info("更新门诊结算状态");
                                        if (wlyyOutpatientDO1!=null){
                                            wlyyOutpatientDO1.setHisStatus(1);
                                            outpatientDao.save(wlyyOutpatientDO1);
                                            logger.info("更新门诊结算状态");
                                        }
                                    }
                                }
                                prescriptionDao.updateStatusByRealOrder(waitPayDetailVO.getRecipeNo(),30,new Date());

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

@ -1984,7 +1984,8 @@ public class PrescriptionEndpoint extends EnvelopRestEndpoint {
                                                  @ApiParam(name = "size", value = "页面大小")
                                                  @RequestParam(value = "size",required = false,defaultValue = "10") Integer size)throws Exception {
        try {
            return prescriptionService.findPatientAllPrescription(keyName,status,page,size);
            String patient = getUID();
            return prescriptionService.findPatientAllPrescription(keyName,status,page,size,patient);
        } catch (Exception e) {
            return PageEnvelop.getError(e.getMessage(),-1);
        }

+ 11 - 0
svr/svr-iot/src/main/java/com/yihu/iot/controller/monitorPlatform/MonitorPlatformController.java

@ -803,4 +803,15 @@ public class MonitorPlatformController extends EnvelopRestEndpoint {
        return success(monitorPlatformService.getBrandsDetail(deviceType));
    }
    @RequestMapping(value="/getDeviceData", method = RequestMethod.GET)
    @ApiOperation("物联网大屏实时动态设备")
    public Envelop getDeviceData(){
        try {
            return success(monitorPlatformService.getDeviceData());
        }catch (Exception e){
            e.printStackTrace();
            return MixEnvelop.getError("查询失败");
        }
    }
}

+ 53 - 2
svr/svr-iot/src/main/java/com/yihu/iot/service/monitorPlatform/MonitorPlatformService.java

@ -17,7 +17,6 @@ import com.yihu.jw.entity.iot.equipment.IotEquipmentDetailDO;
import com.yihu.jw.restmodel.web.MixEnvelop;
import com.yihu.jw.util.http.HttpClientUtil;
import io.swagger.annotations.ApiOperation;
import io.swagger.util.Json;
import iot.device.LocationDataVO;
import org.apache.http.Consts;
import org.apache.http.client.utils.URLEncodedUtils;
@ -1155,6 +1154,19 @@ public class MonitorPlatformService  {
                    if ("0".equals(showLevel)){
                        obj.put("device_name","单体征测量仪");
                        obj.put("Subdivision",true);//是否可查看下一层次
                        StringBuffer sqlTmp = new StringBuffer("select code from xmiot.iot_system_dict where dict_name='DEVICE_TYPE' and `code` in ('");
                        sqlTmp.append(deviceType.replace(",","','")).append("') ");
                        sqlTmp.append("and del=1 and parent_code \n" +
                                "in(select id from xmiot.iot_system_dict where dict_name='DEVICE' and `value`='单体征测量仪' and del=1)");
                        List<String> list = jdbcTemplate.queryForList(sqlTmp.toString(),String.class);
                        sqlTmp = new StringBuffer();
                        for (String s:list){
                            sqlTmp.append(","+s);
                        }
                        if (list.size()!=0){
                            sqlTmp.deleteCharAt(0);
                        }
                        obj.put("type",sqlTmp.toString());
                    }
                    else if("1".equals(showLevel)){
                        String temp = obj.getString("type");
@ -1168,6 +1180,7 @@ public class MonitorPlatformService  {
                    else{
                        obj.put("Subdivision",false);
                    }
                    obj.put("showLevel",Integer.parseInt(showLevel));
                }
                result.put("deviceInfo",arr);//设备信息统计
                //统计物联率设备,失联设备
@ -1208,6 +1221,7 @@ public class MonitorPlatformService  {
                    tmp.put("device_name","健康小屋");
                    tmp.put("Subdivision",false);
                }
                tmp.put("showLevel",Integer.parseInt(showLevel));
                result.getJSONArray("deviceInfo").add(tmp);
                result.put("grantCount",result.getInteger("grantCount")+count);
                //统计健康小屋数据/ 小屋全部统计为正常使用
@ -1242,7 +1256,7 @@ public class MonitorPlatformService  {
        float size = (float) (first * 100) / second;
        DecimalFormat df = new DecimalFormat("0.00");//格式化小数,不足的补0
        String filesize = df.format(size);
        return filesize + "%";
        return filesize;
    }
    /**
@ -1362,4 +1376,41 @@ public class MonitorPlatformService  {
            return null;
        }
    }
    public JSONObject getDeviceData(){
        JSONObject object = new JSONObject();
        //血糖仪数量
        String bloodGlucosemeterCount = "SELECT COUNT(1) FROM wlyy.wlyy_patient_device WHERE category_code = 1 AND del = 0";
        //血压计数量
        String sphygmomanometerCount = "SELECT COUNT(1) FROM wlyy.wlyy_patient_device WHERE category_code = 2 AND del = 0";
        Integer aa = jdbcTemplate.queryForObject(bloodGlucosemeterCount,Integer.class);
        Integer bb = jdbcTemplate.queryForObject(sphygmomanometerCount,Integer.class);
        object.put("homeHealthEquipment",aa+bb);
        //血糖仪 血压计 体征数据
        String physicalSignData = "SELECT count(1) from wlyy.wlyy_sign_family s,wlyy.wlyy_patient_device d, device.wlyy_patient_health_index p WHERE s.`status`>0 \n" +
                "and d.`user` = s.patient and p.`user`=d.`user` and p.del=1 and (p.type=1 or p.type=2)";
        Integer cc = jdbcTemplate.queryForObject(physicalSignData,Integer.class);
        object.put("homePhysicalSignData",cc);
        //异常数据
        String abnormalPhysicalSignData = "SELECT count(1) from wlyy.wlyy_sign_family s,wlyy.wlyy_patient_device d,device.wlyy_patient_health_index p WHERE s.`status`>0 \n" +
                "and d.`user` = s.patient and p.`user`=d.`user` and p.`status`=1 and p.del=1 and (p.type=1 or p.type=2)";
        Integer dd = jdbcTemplate.queryForObject(abnormalPhysicalSignData,Integer.class);
        object.put("homeAbnormalSignData",dd);
        //小屋数量
        String cabinCount = "SELECT COUNT(1) FROM xmiot.iot_equipmet_detail";
        Integer ee = jdbcTemplate.queryForObject(cabinCount,Integer.class);
        object.put("medicalInstitutionIquipment",ee);
        //小屋体征数据
        String cabinSignData = "SELECT count(1) from wlyy.wlyy_sign_family s,wlyy.wlyy_patient_device d, device.wlyy_patient_health_index p WHERE s.`status`>0 \n" +
                "and d.`user` = s.patient and p.`user`=d.`user` and p.del=1 and p.type>2";
        Integer ff = jdbcTemplate.queryForObject(cabinSignData,Integer.class);
        object.put("medicalPhysicalSignData",ff);
        //小屋异常体征数据
        String abnormalSignDataOfCabin = "SELECT count(1) from wlyy.wlyy_sign_family s,wlyy.wlyy_patient_device d,device.wlyy_patient_health_index p WHERE s.`status`>0 \n" +
                "and d.`user` = s.patient and p.`user`=d.`user` and p.`status`=1 and p.del=1 and p.type>2";
        Integer gg = jdbcTemplate.queryForObject(abnormalSignDataOfCabin,Integer.class);
        object.put("medicalAbnormalSignData",gg);
        return object;
    }
}