Просмотр исходного кода

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

humingfen 4 лет назад
Родитель
Сommit
3dca3f2fc9

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

@ -10934,7 +10934,12 @@ public class PrescriptionService extends BaseJpaService<WlyyPrescriptionDO, Pres
                "t.appointment_time as \"appointmentTime\" " +
                " from base_nat_appointment t where 1=1 ";
        if (StringUtils.isNoneBlank(patientId)){
            sql+=" and t.consumer ='"+patientId+"'";
            if (wechatId.equalsIgnoreCase("xm_ykyy_wx")){
                sql+=" and t.consumer ='"+patientId+"'";
            }else {
                sql+=" and t.patient_id ='"+patientId+"'";
            }
        }
        if (StringUtils.isNoneBlank(id)){
            sql+=" and t.id ='"+id+"'";

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

@ -895,4 +895,6 @@ public class TnyyEntranceService {
        List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
        return mapList;
    }
}

Разница между файлами не показана из-за своего большого размера
+ 23 - 0
common/common-entity/src/main/java/com/yihu/jw/entity/util/TransforSqlUtl.java


+ 1 - 0
common/common-request-mapping/src/main/java/com/yihu/jw/rm/hospital/BaseHospitalRequestMapping.java

@ -1185,6 +1185,7 @@ public class BaseHospitalRequestMapping {
        //根据医生id生成二维码
        public static final String setQrCode  = "/setQrCode";
        public static final String setUrlCode="/setUrlCode";
        //生成所有医生二维码
        public static final String setAllCode  = "/setAllCode";
        public static final String findArticleByCategoryAndName  = "/findArticleByCategoryAndName";

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

@ -808,6 +808,15 @@ public class PatientNoLoginEndPoint extends EnvelopRestEndpoint {
        String uri = qrcodeService.makeSpecialistQrcode(doctor);
        return success("操作成功",uri);
    }
    @GetMapping(value = BaseHospitalRequestMapping.KnowledgeArticle.setUrlCode)
    @ApiOperation(value = "生成链接推送")
    public Envelop setUrlCode(@ApiParam(name = "flag", value = "flag", required = true)
                             @RequestParam(value = "flag", required = true)String flag) throws Exception{
        String uri = qrcodeService.makeUrlQrcode(flag);
        return success("操作成功",uri);
    }
    @GetMapping(value = BaseHospitalRequestMapping.PatientNoLogin.querySettledRecord)
    @ApiOperation(value = "易联众_查询结算状态")
    public Envelop querySettledRecord(@ApiParam(name = "cardNo", value = "cardNo", required = true)

+ 38 - 1
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/consult/QrcodeService.java

@ -35,7 +35,6 @@ import java.io.InputStream;
import java.net.HttpURLConnection;
import java.net.URL;
import java.net.URLEncoder;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
@Service
@ -171,6 +170,44 @@ public class QrcodeService {
            throw new Exception("找不到对应医生信息!");
        }
    }
    public String makeUrlQrcode(String flag) throws Exception {
        System.out.println("flag"+flag);
        String token=null;
        //中山医院互联网医院
        if("xm_zsyy_wx".equals(wxId)) {
            String response = entranceService.getAccessToken("100033");
            net.sf.json.JSONObject object1 = net.sf.json.JSONObject.fromObject(response);
            if (null != object1&&null!=object1.get("respCode") && "00".equals(object1.get("respCode"))) {
                token  = object1.getJSONObject("respEntity").getString("access_token");
            } else {
                throw new Exception("获取ACCESSTOKEN失败");
            }
        }else if("xm_xzzx_wx".equals(wxId)){
            token = xzzxEntranceService.getXzToken();
        }else{
            token = wxAccessTokenService.getWxAccessTokenById(wxId).getAccessToken();
        }
        System.out.println("token"+token);
        System.out.println("wxId"+wxId);
        // 二维码内容
        String content = "flag_" + flag ;
        System.out.println("content"+content);
        // 二维码图片文件名
        String fileName = flag+".png";
        /*String path = QrcodeService.class.getResource("/").getPath().replace("/WEB-INF/classes/", "")
                + File.separator + "qrcode";*/
        System.out.println("fileName"+fileName);
        // 通过微信接口生成医生二维码
        String uri = makeQrcodeFromWeiXin(content, fileName, token);
        System.out.println("uri"+uri);
        return uri;
    }
    /**
     * 从微信生成二维码并下载到本地
     *

+ 33 - 0
svr/svr-internet-hospital/src/main/java/com/yihu/jw/hospital/service/wechat/WeiXinEventProcess.java

@ -117,6 +117,39 @@ public class WeiXinEventProcess {
            // 消息XML
            result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        }else if (StringUtils.isNotEmpty(eventKey) && (eventKey.startsWith("flag_"))){
            // 图文信息
            List<Map<String, String>> articles = new ArrayList<>();
            Map<String, String> article = new HashMap<>();
            // 二维码参数
            // 图片URL
            String picUrl = "";
            String url = null;
            // 医生二维码跳转URL
            if ("xm_ykyy_wx".equalsIgnoreCase(wechatId)){
                url = "https://open.weixin.qq.com/connect/oauth2/authorize?appid=wxa67b466e6ab64bba&redirect_uri=https%3a%2f%2fintel.yanketong.com%2fims-wx%2f%23%2fpersonal%2ffamilyMember%2findex%3ftype%3dnucleicTest&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect";
                picUrl = "https://intel.yanketong.com/group1/M00/00/13/wKghxmAZD-iAEyHgAAA-zHpYNyg537.png";
                article.put("Url", url);
                article.put("Title", "核酸检测预约");
                article.put("Description", "厦门眼科中心医院互联网医院");
                article.put("PicUrl", picUrl);
                articles.add(article);
            }
            // 图文消息URL
            //图片地址
//            picUrl = picUrl.replace("{server}", serverUrl);
            // 消息XML
            result = WeiXinMessageReplyUtils.replyNewsMessage(message.get("FromUserName"), message.get("ToUserName"), articles);
        }
        return result;

+ 1 - 1
svr/svr-iot/src/main/java/com/yihu/iot/service/device/IotPatientDeviceService.java

@ -260,7 +260,7 @@ public class IotPatientDeviceService extends BaseJpaService<IotPatientDeviceDO,
     * @return
     */
    public List<LocationDataVO> findAllDeviceLocations() throws IOException {
        String sql ="select id,AES_DECRYPT(from_base64(idcard),'jkzl2021ZJXL*#%a') idCard,category_code categoryCode,device_sn deviceSn,location,device_time deviceTime,disease_condition diseaseCondition,\n" +
        String sql ="select id,idcard idCard,category_code categoryCode,device_sn deviceSn,location,device_time deviceTime,disease_condition diseaseCondition,\n" +
                "create_time createTime,device_name equimentName from device.wlyy_patient_device_location where del=0 ";
        List<Map<String,Object>> result = jdbcTemplate.queryForList(sql);
        List<LocationDataVO> locationDataVOList = new ArrayList<>();

+ 19 - 16
svr/svr-iot/src/main/java/com/yihu/iot/service/device/WlyyDeviceService.java

@ -4,6 +4,7 @@ package com.yihu.iot.service.device;
import com.yihu.iot.service.common.OrgUserService;
import com.yihu.iot.service.useragent.UserAgent;
import com.yihu.jw.entity.util.AesEncryptUtils;
import com.yihu.jw.entity.util.TransforSqlUtl;
import com.yihu.jw.restmodel.iot.device.DeviceHealthIndexVO;
import com.yihu.jw.restmodel.iot.device.WlyyDeviceVO;
import com.yihu.jw.restmodel.iot.device.WlyyHealthStandardVO;
@ -80,29 +81,31 @@ public class WlyyDeviceService {
        sql += " order by id desc ";
        Long count = Long.valueOf(jdbcTemplate.queryForList(sql).size());
        sql += "limit " + (page - 1) * pageSize + "," + pageSize;
        sql = TransforSqlUtl.deviceAll(sql);
        List<WlyyDeviceVO> deviceVOList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WlyyDeviceVO.class));
        deviceVOList.forEach(one->{
            one.setLinkman(AesEncryptUtils.decrypt(one.getLinkman()));
            one.setTel(AesEncryptUtils.decrypt(one.getTel()));
            one.setRepresentative(AesEncryptUtils.decrypt(one.getRepresentative()));
            one.setApplicantName(AesEncryptUtils.decrypt(one.getApplicantName()));
            one.setApplicantTel(AesEncryptUtils.decrypt(one.getApplicantTel()));
            one.setApplicantIdentity(AesEncryptUtils.decrypt(one.getApplicantIdentity()));
        });
//        deviceVOList.forEach(one->{
//            one.setLinkman(AesEncryptUtils.decrypt(one.getLinkman()));
//            one.setTel(AesEncryptUtils.decrypt(one.getTel()));
//            one.setRepresentative(AesEncryptUtils.decrypt(one.getRepresentative()));
//            one.setApplicantName(AesEncryptUtils.decrypt(one.getApplicantName()));
//            one.setApplicantTel(AesEncryptUtils.decrypt(one.getApplicantTel()));
//            one.setApplicantIdentity(AesEncryptUtils.decrypt(one.getApplicantIdentity()));
//        });
        return MixEnvelop.getSuccessListWithPage(IotRequestMapping.Common.message_success_find, deviceVOList, page, pageSize, count);
    }
    public MixEnvelop<WlyyDeviceVO,WlyyDeviceVO> findById(Long id){
        String sql = "select * from device.wlyy_devices where id = "+id;
        sql = TransforSqlUtl.deviceAll(sql);
        List<WlyyDeviceVO> deviceVOList = jdbcTemplate.query(sql, new BeanPropertyRowMapper<>(WlyyDeviceVO.class));
        deviceVOList.forEach(one->{
            one.setLinkman(AesEncryptUtils.decrypt(one.getLinkman()));
            one.setTel(AesEncryptUtils.decrypt(one.getTel()));
            one.setRepresentative(AesEncryptUtils.decrypt(one.getRepresentative()));
            one.setApplicantName(AesEncryptUtils.decrypt(one.getApplicantName()));
            one.setApplicantTel(AesEncryptUtils.decrypt(one.getApplicantTel()));
            one.setApplicantIdentity(AesEncryptUtils.decrypt(one.getApplicantIdentity()));
        });
//        deviceVOList.forEach(one->{
//            one.setLinkman(AesEncryptUtils.decrypt(one.getLinkman()));
//            one.setTel(AesEncryptUtils.decrypt(one.getTel()));
//            one.setRepresentative(AesEncryptUtils.decrypt(one.getRepresentative()));
//            one.setApplicantName(AesEncryptUtils.decrypt(one.getApplicantName()));
//            one.setApplicantTel(AesEncryptUtils.decrypt(one.getApplicantTel()));
//            one.setApplicantIdentity(AesEncryptUtils.decrypt(one.getApplicantIdentity()));
//        });
        return MixEnvelop.getSuccess(IotRequestMapping.Common.message_success_find,deviceVOList.get(0));
    }

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

@ -96,7 +96,7 @@ public class MonitorPlatformService  {
            total = json.getInteger("total");
            JSONArray list = json.getJSONArray("list");
            for(int i=0;i<list.size();i++){
                String sql ="select id, AES_DECRYPT(from_base64(idcard),'jkzl2021ZJXL*#%a') idCard,category_code categoryCode,device_sn deviceSn,location,device_time deviceTime,disease_condition diseaseCondition,\n" +
                String sql ="select id, idcard idCard,category_code categoryCode,device_sn deviceSn,location,device_time deviceTime,disease_condition diseaseCondition,\n" +
                        "create_time createTime,device_name equimentName from device.wlyy_patient_device_location where del=0 and  device_sn='"+list.getString(i)+"'";
                List<Map<String,Object>> result = jdbcTemplate.queryForList(sql.toString());
                List<LocationDataVO> locationDataVOList = new ArrayList<>();
@ -159,7 +159,7 @@ public class MonitorPlatformService  {
                        envelop.getDetailModelList().addAll(euipmentList);
                    }
                }
                StringBuffer sql = new StringBuffer("select id,AES_DECRYPT(from_base64(idcard),'jkzl2021ZJXL*#%a') idCard,category_code categoryCode,device_sn deviceSn,location,device_time deviceTime,disease_condition diseaseCondition,\n" +
                StringBuffer sql = new StringBuffer("select id,idcard idCard,category_code categoryCode,device_sn deviceSn,location,device_time deviceTime,disease_condition diseaseCondition,\n" +
                        "create_time createTime,device_name equimentName\n" +
                        "from device.wlyy_patient_device_location  ");
                StringBuffer sqlCounts = new StringBuffer("select count(*) from device.wlyy_patient_device_location ");
@ -1130,7 +1130,7 @@ public class MonitorPlatformService  {
                jsonObject.put("filter",jsonArray1);
                jsonObject.put("page",1);
                jsonObject.put("size",5);
                String sqlLocation = "select AES_DECRYPT(from_base64(idcard),'jkzl2021ZJXL*#%a') idCard,category_code categoryCode,device_sn deviceSn,location,device_time deviceTime,disease_condition diseaseCondition,\n" +
                String sqlLocation = "select idcard idCard,category_code categoryCode,device_sn deviceSn,location,device_time deviceTime,disease_condition diseaseCondition,\n" +
                        "create_time createTime,device_name equimentName\n" +
                        "from device.wlyy_patient_device_location where del=0 and  device_sn='"+deviceSn+"' limit 0,5 ";
                try {
@ -1759,7 +1759,7 @@ public class MonitorPlatformService  {
                    location.put("lon", Double.valueOf(json.get("lng")));
                    String insertSql = "INSERT INTO device.wlyy_patient_device_location(patient,idcard,disease_condition,device_sn,\n" +
                            "device_name,category_code,device_time,create_time,location)\n" +
                            "VALUES('" + map.get("code").toString() + "','" + AesEncryptUtils.jiamiMysql(map.get("idcard").toString()) + "','" + map.get("disease_condition").toString() + "','" + map.get("device_sn").toString() + "','" + map.get("device_name") + "',\n" +
                            "VALUES('" + map.get("code").toString() + "','" + map.get("idcard").toString() + "','" + map.get("disease_condition").toString() + "','" + map.get("device_sn").toString() + "','" + map.get("device_name") + "',\n" +
                            "'" + map.get("category_code").toString() + "','" + map.get("create_time") + "','" + map.get("create_time").toString() + "','" + location.toJSONString() + "')\n";
                    jdbcTemplate.execute(insertSql);
                }

+ 2 - 0
svr/svr-statistics/src/main/java/com/yihu/wlyy/statistics/etl/convert/wlyy/UseDeviceTypeConvert.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.statistics.etl.convert.wlyy;
import com.yihu.jw.entity.base.statistics.DimensionQuotaDO;
import com.yihu.jw.entity.util.TransforSqlUtl;
import com.yihu.wlyy.statistics.etl.convert.Convert;
import com.yihu.wlyy.statistics.vo.DataModel;
import org.springframework.jdbc.core.JdbcTemplate;
@ -55,6 +56,7 @@ public class UseDeviceTypeConvert implements Convert {
    public Map<String,Object> getTeam(DataModel dataModel,JdbcTemplate jdbcTemplate){
        String deviceCode =  dataModel.getHealthProblem();
        String sql = " select * from device.wlyy_devices d where d.device_code ='"+deviceCode+"' and is_grant=1";
        sql = TransforSqlUtl.deviceAll(sql);
        List<Map<String,Object>> result = jdbcTemplate.queryForList(sql);
        if(result.size()>0){
            return result.get(0);