瀏覽代碼

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

huangwenjie 7 年之前
父節點
當前提交
a16253bc64
共有 15 個文件被更改,包括 205 次插入100 次删除
  1. 100 68
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/DeviceHealthIndexService.java
  2. 1 1
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/WlyyPatientDeviceService.java
  3. 8 8
      patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/util/SystemConf.java
  4. 4 0
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/device/deviceHealthIndex_list_js.jsp
  5. 1 1
      patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/device/patientDevice_list.jsp
  6. 2 1
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/ConvertHelper.java
  7. 1 1
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/job/Mysql2ESJob.java
  8. 9 5
      patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/service/JobService.java
  9. 1 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/DoctorInfoService.java
  10. 6 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java
  11. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java
  12. 21 7
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/Base64Utils.java
  13. 23 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandingService.java
  14. 12 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandlingController.java
  15. 15 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java

+ 100 - 68
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/DeviceHealthIndexService.java

@ -65,33 +65,34 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
        User loginUser = (User) request.getSession().getAttribute("userInfo");
        Pageable pageRequest = new PageRequest(page-1,pageSize);
        StringBuilder filter = new StringBuilder();
        String sql = "SELECT a.patient  FROM wlyy.wlyy_sign_family a, wlyy.wlyy_patient b WHERE a.status > 0 AND a.patient = b.code  ";
        String sql =" SELECT i.* ,s.name userName FROM device.wlyy_patient_health_index i , wlyy.wlyy_sign_family s WHERE s. STATUS > 0  and i.user=s.patient ";
        String countSql =" SELECT count(1) as num FROM device.wlyy_patient_health_index i, wlyy.wlyy_sign_family s WHERE s. STATUS > 0  and i.user=s.patient ";
        //1、管理员  2、医生 0、其他
        if(loginUser.getType()==2){
            Doctor doctor = doctorDao.findByCode(loginUser.getCode());
            if(doctor!=null &&StringUtils.isNotEmpty(doctor.getHospital())){
                sql += " AND a.hospital = '"+doctor.getHospital()+"' ";
                filter.append(" AND s.hospital = '"+doctor.getHospital()+"' ");
            }
        }
        //根据患者名称过滤
        if(!StringUtils.isEmpty(userName)){
            sql +=" AND b.NAME LIKE '%"+userName+"%'";
            filter.append(" AND s.NAME LIKE '%"+userName+"%' ");
        }
        //根据健管师或医生名称过滤
        if(!StringUtils.isEmpty(doctorName)){
            sql += " and (a.doctor_name like '%"+doctorName+"%' or a.doctor_health_name like '%"+doctorName+"%') ";
            filter.append(" and (s.doctor_name like '%"+doctorName+"%' or s.doctor_health_name like '%"+doctorName+"%') ");
        }
        List<String> patientList = jdbcTemplate.queryForList(sql,String.class);
        if(!StringUtils.isEmpty(deviceSn)){
            filter.append("deviceSn="+deviceSn+";");
            filter.append(" and i.deviceSn="+deviceSn);
        }
        if(!StringUtils.isEmpty(idcard)){
            filter.append("idcard="+idcard+";");
            filter.append(" and i.idcard="+idcard);
        }
        //体征数据创建时间
        if(!StringUtils.isEmpty(date)){
            Date startTimeTemp  =  DateTimeUtil.simpleDateParse(date);
            Calendar calendar = new GregorianCalendar();
@ -101,63 +102,81 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
            calendar.set(Calendar.SECOND,59);
            calendar.set(Calendar.MILLISECOND,999);
            Date endTimeTemp = calendar.getTime();
            filter.append("czrq>=" + DateTimeUtil.utcDateTimeFormat(startTimeTemp)+ ";");
            filter.append("czrq<=" + DateTimeUtil.utcDateTimeFormat(endTimeTemp)+ ";");
        }
        if(patientList != null && patientList.size() >0){
            String temp = StringUtils.join(patientList, ",");
//            temp = temp.substring(0,temp.length()-1);
            filter.append("user="+temp+";");
        }else {
            return new PageImpl<DeviceHealthIndexVO>(new ArrayList<>(), pageRequest, 0);
            filter.append(" and i.czrq>=" + DateTimeUtil.utcDateTimeFormat(startTimeTemp));
            filter.append(" and i.czrq<=" + DateTimeUtil.utcDateTimeFormat(endTimeTemp));
        }
        //指标类型
        if(!StringUtils.isEmpty(indexType)){
            filter.append("type="+indexType+";");
            filter.append(" and i.type="+indexType);
        }
        //体征数据
        if("1".equals(indexType)||"2".equals(indexType)||"4".equals(indexType)){
            if(indexTypeMin1!=null){
                filter.append("value1>="+indexTypeMin1+";");
                filter.append(" and value1>="+indexTypeMin1);
            }
            if(indexTypeMax1!=null){
                filter.append("value1<="+indexTypeMax1+";");
                filter.append(" and value1<="+indexTypeMax1);
            }
            if(indexTypeMin2!=null){
                filter.append("value2>="+indexTypeMin2+";");
                filter.append(" and value2>="+indexTypeMin2);
            }
            if(indexTypeMax2!=null){
                filter.append("value2<="+indexTypeMax2+";");
                filter.append(" and value2<="+indexTypeMax2);
            }
        }else{
            if(indexTypeMin1!=null){
                filter.append("value3>="+indexTypeMin1+";");
                filter.append(" and value3>="+indexTypeMin1);
            }
            if(indexTypeMax1!=null){
                filter.append("value3<="+indexTypeMax1+";");
                filter.append(" and value3<="+indexTypeMax1);
            }
            if(indexTypeMin2!=null){
                filter.append("value4>="+indexTypeMin2+";");
                filter.append(" and value4>="+indexTypeMin2);
            }
            if(indexTypeMax2!=null){
                filter.append("value4<="+indexTypeMax2+";");
                filter.append(" and value4<="+indexTypeMax2);
            }
        }
        List<DeviceHealthIndex> list = (List<DeviceHealthIndex>)search("", filter.toString(), "-czrq", page, pageSize);
        String f = filter.toString();
        List<Map<String, Object>> resultList = jdbcTemplate.queryForList(sql+f+" order by i.czrq desc "+" limit "+(page-1)+","+pageSize);
        if(resultList.size()<=0){
            return new PageImpl<DeviceHealthIndexVO>(new ArrayList<>(), pageRequest, 0);
        }
        long count = 0;
        String regex = "(\\w{3})(\\w+)(\\w{3})";
        List<DeviceHealthIndexVO> listTemp = new ArrayList<>();
        if(list !=null && list.size()>0){
            count = getCount(filter.toString());
            for (DeviceHealthIndex info : list){
        if(resultList !=null && resultList.size()>0){
//            count = getCount(filter.toString());
            count = jdbcTemplate.queryForObject(countSql+filter.toString(),Long.class);
            for (Map<String, Object> info : resultList){
                DeviceHealthIndexVO bean = new DeviceHealthIndexVO();
                BeanUtils.copyProperties(info, bean);
//                BeanUtils.copyProperties(bean, info);
                Patient patient = findPatient(bean.getUser());
                bean.setUserName(patient== null?"":patient.getName());
                bean.setId(Long.getLong(info.get("id")+""));
                bean.setCzrq(info.get("czrq")!=null?(Date)info.get("czrq"):null);
                bean.setDel(info.get("del")!=null?info.get("del")+"":null);
                bean.setDeviceSn(info.get("device_sn")!=null?info.get("device_sn")+"":null);
                bean.setIdcard(info.get("idcard")!=null?info.get("idcard")+"":null);
                bean.setIntervene(info.get("intervene")!=null?info.get("intervene")+"":null);
                bean.setRecordDate(info.get("record_date")!=null?(Date)info.get("record_date"):null);
                bean.setSortDate(info.get("sort_date")!=null?(Date)info.get("sort_date"):null);
                bean.setStatus(info.get("status")!=null?(Integer)info.get("status"):null);
                bean.setType(info.get("type")!=null?(Integer)info.get("type"):0);
                bean.setUser(info.get("user")!=null?info.get("user")+"":null);
                bean.setUserName(info.get("userName")!=null?info.get("userName")+"":null);
                bean.setValue1(info.get("value1")!=null?info.get("value1")+"":null);
                bean.setValue2(info.get("value2")!=null?info.get("value2")+"":null);
                bean.setValue3(info.get("value3")!=null?info.get("value3")+"":null);
                bean.setValue4(info.get("value4")!=null?info.get("value4")+"":null);
                bean.setValue5(info.get("value5")!=null?info.get("value5")+"":null);
                bean.setValue6(info.get("value6")!=null?info.get("value6")+"":null);
                bean.setValue7(info.get("value7")!=null?info.get("value7")+"":null);
//                BeanUtils.copyProperties(info, bean);
//                Patient patient = findPatient(bean.getUser());
//                bean.setUserName(patient== null?"":patient.getName());
                if(StringUtils.isNotBlank(bean.getIdcard())){
                    bean.setIdcard(bean.getIdcard().replaceAll(regex, "$1****$3"));
                }
                bean.setHealthStandard(gethealthStandard(info.getType(),info.getUser()).toString());
                bean.setHealthStandard(gethealthStandard(bean.getType(),bean.getUser()).toString());
                listTemp.add(bean);
            }
        }
@ -172,32 +191,31 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
        User loginUser = (User) request.getSession().getAttribute("userInfo");
        StringBuilder filter = new StringBuilder();
        String sql = "SELECT a.patient  FROM wlyy.wlyy_sign_family a, wlyy.wlyy_patient b WHERE a.status > 0 AND a.patient = b.code  ";
        String sql =" SELECT i.* ,s.name userName FROM device.wlyy_patient_health_index i , wlyy.wlyy_sign_family s WHERE s. STATUS > 0  and i.user=s.patient ";
        //1、管理员  2、医生 0、其他
        if(loginUser.getType()==2){
            Doctor doctor = doctorDao.findByCode(loginUser.getCode());
            if(doctor!=null &&StringUtils.isNotEmpty(doctor.getHospital())){
                sql += " AND a.hospital = '"+doctor.getHospital()+"' ";
                filter.append(" AND s.hospital = '"+doctor.getHospital()+"' ");
            }
        }
        //根据患者名称过滤
        if(!StringUtils.isEmpty(userName)){
            sql +=" AND b.NAME LIKE '%"+userName+"%'";
            filter.append(" AND s.NAME LIKE '%"+userName+"%' ");
        }
        //根据健管师或医生名称过滤
        if(!StringUtils.isEmpty(doctorName)){
            sql += " and (a.doctor_name like '%"+doctorName+"%' or a.doctor_health_name like '%"+doctorName+"%') ";
            filter.append(" and (s.doctor_name like '%"+doctorName+"%' or s.doctor_health_name like '%"+doctorName+"%') ");
        }
        List<String> patientList = jdbcTemplate.queryForList(sql,String.class);
        if(!StringUtils.isEmpty(deviceSn)){
            filter.append("deviceSn="+deviceSn+";");
            filter.append(" and i.deviceSn="+deviceSn);
        }
        if(!StringUtils.isEmpty(idcard)){
            filter.append("idcard="+idcard+";");
            filter.append(" and i.idcard="+idcard);
        }
        //体征数据创建时间
        if(!StringUtils.isEmpty(date)){
            Date startTimeTemp  =  DateTimeUtil.simpleDateParse(date);
            Calendar calendar = new GregorianCalendar();
@ -207,58 +225,72 @@ public class DeviceHealthIndexService extends BaseDeviceJpaService<DeviceHealthI
            calendar.set(Calendar.SECOND,59);
            calendar.set(Calendar.MILLISECOND,999);
            Date endTimeTemp = calendar.getTime();
            filter.append("czrq>=" + DateTimeUtil.utcDateTimeFormat(startTimeTemp)+ ";");
            filter.append("czrq<=" + DateTimeUtil.utcDateTimeFormat(endTimeTemp)+ ";");
            filter.append(" and i.czrq>=" + DateTimeUtil.utcDateTimeFormat(startTimeTemp));
            filter.append(" and i.czrq<=" + DateTimeUtil.utcDateTimeFormat(endTimeTemp));
        }
        if(patientList != null && patientList.size() >0){
            String temp = StringUtils.join(patientList, ",");
            filter.append("user="+temp+";");
        }
        //指标类型
        if(!StringUtils.isEmpty(indexType)){
            filter.append("type="+indexType+";");
            filter.append(" and i.type="+indexType);
        }
        //体征数据
        if("1".equals(indexType)||"2".equals(indexType)||"4".equals(indexType)){
            if(indexTypeMin1!=null){
                filter.append("value1>="+indexTypeMin1+";");
                filter.append(" and value1>="+indexTypeMin1);
            }
            if(indexTypeMax1!=null){
                filter.append("value1<="+indexTypeMax1+";");
                filter.append(" and value1<="+indexTypeMax1);
            }
            if(indexTypeMin2!=null){
                filter.append("value2>="+indexTypeMin2+";");
                filter.append(" and value2>="+indexTypeMin2);
            }
            if(indexTypeMax2!=null){
                filter.append("value2<="+indexTypeMax2+";");
                filter.append(" and value2<="+indexTypeMax2);
            }
        }else{
            if(indexTypeMin1!=null){
                filter.append("value3>="+indexTypeMin1+";");
                filter.append(" and value3>="+indexTypeMin1);
            }
            if(indexTypeMax1!=null){
                filter.append("value3<="+indexTypeMax1+";");
                filter.append(" and value3<="+indexTypeMax1);
            }
            if(indexTypeMin2!=null){
                filter.append("value4>="+indexTypeMin2+";");
                filter.append(" and value4>="+indexTypeMin2);
            }
            if(indexTypeMax2!=null){
                filter.append("value4<="+indexTypeMax2+";");
                filter.append(" and value4<="+indexTypeMax2);
            }
        }
        List<DeviceHealthIndex> list = (List<DeviceHealthIndex>)search(filter.toString());
        String f = filter.toString();
        List<Map<String, Object>> resultList = jdbcTemplate.queryForList(sql+f+" order by i.czrq desc ");
        String regex = "(\\w{3})(\\w+)(\\w{3})";
        List<DeviceHealthIndexVO> listTemp = new ArrayList<>();
        if(list !=null && list.size()>0){
            for (DeviceHealthIndex info : list){
        if(resultList !=null && resultList.size()>0){
            for (Map<String, Object> info : resultList){
                DeviceHealthIndexVO bean = new DeviceHealthIndexVO();
                BeanUtils.copyProperties(info, bean);
//                BeanUtils.copyProperties(bean, info);
                Patient patient = findPatient(bean.getUser());
                bean.setUserName(patient== null?"":patient.getName());
                bean.setId(Long.getLong(info.get("id")+""));
                bean.setCzrq(info.get("czrq")!=null?(Date)info.get("czrq"):null);
                bean.setDel(info.get("del")!=null?info.get("del")+"":null);
                bean.setDeviceSn(info.get("device_sn")!=null?info.get("device_sn")+"":null);
                bean.setIdcard(info.get("idcard")!=null?info.get("idcard")+"":null);
                bean.setIntervene(info.get("intervene")!=null?info.get("intervene")+"":null);
                bean.setRecordDate(info.get("record_date")!=null?(Date)info.get("record_date"):null);
                bean.setSortDate(info.get("sort_date")!=null?(Date)info.get("sort_date"):null);
                bean.setStatus(info.get("status")!=null?(Integer)info.get("status"):null);
                bean.setType(info.get("type")!=null?(Integer)info.get("type"):0);
                bean.setUser(info.get("user")!=null?info.get("user")+"":null);
                bean.setUserName(info.get("userName")!=null?info.get("userName")+"":null);
                bean.setValue1(info.get("value1")!=null?info.get("value1")+"":null);
                bean.setValue2(info.get("value2")!=null?info.get("value2")+"":null);
                bean.setValue3(info.get("value3")!=null?info.get("value3")+"":null);
                bean.setValue4(info.get("value4")!=null?info.get("value4")+"":null);
                bean.setValue5(info.get("value5")!=null?info.get("value5")+"":null);
                bean.setValue6(info.get("value6")!=null?info.get("value6")+"":null);
                bean.setValue7(info.get("value7")!=null?info.get("value7")+"":null);
                if(StringUtils.isNotBlank(bean.getIdcard())){
                    bean.setIdcard(bean.getIdcard().replaceAll(regex, "$1****$3"));
                }
                bean.setHealthStandard(gethealthStandard(info.getType(),info.getUser()).toString());
                bean.setHealthStandard(gethealthStandard(bean.getType(),bean.getUser()).toString());
                listTemp.add(bean);
            }
        }

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/service/manager/device/WlyyPatientDeviceService.java

@ -162,7 +162,7 @@ public class WlyyPatientDeviceService extends BaseJpaService<WlyyPatientDevice,W
        }
        
        if(StringUtils.isNotBlank(doctorName)){
            sql = sql + "AND s.doctor_name like '%"+doctorName+"%' ";
            sql = sql + "AND (s.doctor_name like '%"+doctorName+"%' or s.doctor_health_name like '%"+doctorName+"%') ";
        }
        
        if(StringUtils.isNotBlank(userName)){

+ 8 - 8
patient-co-manage/wlyy-manage/src/main/java/com/yihu/wlyy/util/SystemConf.java

@ -42,22 +42,22 @@ public class SystemConf {
	private static final String appSecret = "appSecret";
	// 血糖餐前最小值
	public static final double HEALTH_STANDARD_ST_MIN_BEFORE = 3.9;
	public static final double HEALTH_STANDARD_ST_MIN_BEFORE = 4;//3.9
	// 血糖餐前最大值
	public static final double HEALTH_STANDARD_ST_MAX_BEFORE = 6.1;
	public static final double HEALTH_STANDARD_ST_MAX_BEFORE = 7;//6.1
	// 血糖餐后最小值
	public static final double HEALTH_STANDARD_ST_MIN_AFTER = 4.4;
	public static final double HEALTH_STANDARD_ST_MIN_AFTER = 4;//4.4
	// 血糖餐后最大值
	public static final double HEALTH_STANDARD_ST_MAX_AFTER = 7.8;
	public static final double HEALTH_STANDARD_ST_MAX_AFTER = 11.1;//7.8
	// 舒张压最小值
	public static final double HEALTH_STANDARD_SZY_MIN = 60;
	public static final double HEALTH_STANDARD_SZY_MIN = 60;//60
	// 舒张压最大值
	public static final double HEALTH_STANDARD_SZY_MAX = 89;
	public static final double HEALTH_STANDARD_SZY_MAX = 90;//89
	// 收缩压最小值
	public static final double HEALTH_STANDARD_SSY_MIN = 90;
	public static final double HEALTH_STANDARD_SSY_MIN = 90;//90
	// 收缩压最大值
	public static final double HEALTH_STANDARD_SSY_MAX = 139;
	public static final double HEALTH_STANDARD_SSY_MAX = 140;//139
	// 短信接口地址
	public static final String SMS_URL = "https://smsapi.ums86.com:9600/sms/Api/Send.do";

+ 4 - 0
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/device/deviceHealthIndex_list_js.jsp

@ -211,6 +211,8 @@
                                        }else {
                                            return "<span style='color:red;'>"+row.value1+"</span>";
                                        }
                                    }else{
                                        return row.value1;
                                    }
                                }
                            },
@ -231,6 +233,8 @@
                                        }else {
                                            return "<span style='color:red;'>"+row.value2+"</span>";
                                        }
                                    }else{
                                        return row.value2;
                                    }
                                }
                            },

+ 1 - 1
patient-co-manage/wlyy-manage/src/main/webapp/WEB-INF/views/device/patientDevice_list.jsp

@ -33,7 +33,7 @@
				<input type="text" id="inp_user_name" placeholder="请输入居民姓名" class="f-ml10" data-attr-scan="userName"/>
			</div>
			<div class="m-form-control f-ml15">
				<input type="text" id="inp_doctor_name" placeholder="请输入医生姓名" class="f-ml10" data-attr-scan="doctorName"/>
				<input type="text" id="inp_doctor_name" placeholder="请输入医生/健管师姓名" class="f-ml10" data-attr-scan="doctorName"/>
			</div>
			<sec:authorize url="/admin/patientDevice/list">
				<div id="btn_search" class="l-button u-btn u-btn-primary u-btn-small f-ib f-vam  f-ml10" >

+ 2 - 1
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/convert/ConvertHelper.java

@ -45,7 +45,7 @@ public class ConvertHelper {
    public List<SaveModel> convert(List<DataModel> dataModels, FLlabelDictJob fLlabelDictJob) throws Exception {
        List<SaveModel> saveModels = new ArrayList<>();
            //不需要转换
            if(StringUtils.isEmpty(fLlabelDictJob.getConvertClazz()) || StringUtils.isEmpty(fLlabelDictJob.getSql())){
            if(fLlabelDictJob==null || StringUtils.isEmpty(fLlabelDictJob.getConvertClazz()) || StringUtils.isEmpty(fLlabelDictJob.getSql())){
                return generateSaveModleWithOutConvert(dataModels);
            }
            List<FLlabelDict> flLabelDictList = jdbcTemplate.query(fLlabelDictJob.getSql(),new BeanPropertyRowMapper(FLlabelDict.class));
@ -66,6 +66,7 @@ public class ConvertHelper {
                dataModel -> {
                    SaveModel saveModel = new SaveModel();
                    saveModel.setIdcard(dataModel.getIdcard());
                    saveModel.setModelId(MakeModelIDUtil.makeModelID(dataModel,""));
                    saveModel.setLabelType(dataModel.getParentCode());
                    saveModel.setLabelCode(dataModel.getLabelCode());
                    saveModel.setLabeName(dataModel.getLabelName());

+ 1 - 1
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/job/Mysql2ESJob.java

@ -79,7 +79,7 @@ public class Mysql2ESJob implements Job {
        //增量存储成功后,修改增量的czrq时间为当前时间
        if (bool) {
            this.flJobConfigDao.updateSqlFildeValue(this.flJobConfigId, DateFormatUtils.format(new Date(), ConstantUtil.date_format));
                this.flJobConfigDao.updateSqlFildeValue(this.flJobConfigId, DateFormatUtils.format(new Date(), ConstantUtil.date_format));
        }
    }

+ 9 - 5
patient-co/patient-co-figure-label/src/main/java/com/yihu/wlyy/figure/label/service/JobService.java

@ -103,9 +103,11 @@ public class JobService {
        params.put("jobConfig", flJobConfigVO.getId());
        //表里设置的增量查询类型和增量查询初始值,如果值没有配置,以当前时间为准
        if(!StringUtils.isEmpty(flJobConfigVO.getSqlFieldValue())){
            params.put(flJobConfigVO.getSqlField(),flJobConfigVO.getSqlFieldValue());
            params.put("sqlFiledValue",flJobConfigVO.getSqlFieldValue());
            //params.put(flJobConfigVO.getSqlField(),flJobConfigVO.getSqlFieldValue());
        }else{
            params.put(flJobConfigVO.getSqlField(), DateFormatUtils.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
            params.put("sqlFiledValue", DateFormatUtils.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
            //params.put(flJobConfigVO.getSqlField(), DateFormatUtils.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
        }
        params.put("sqlFiledCondition", ">");
        if (!StringUtils.isEmpty(FLJobConfig.getJobClass())) {
@ -116,7 +118,7 @@ public class JobService {
    }
    public void startNowById(String id) throws Exception {
        FLJobConfig FLJobConfig = flJobConfigDao.findOne(id);
        FLJobConfig FLJobConfig = flJobConfigDao.findById(Long.valueOf(id));
        FLJobConfig flJobConfigVO = new FLJobConfig();
        BeanUtils.copyProperties(FLJobConfig, flJobConfigVO);
@ -124,9 +126,11 @@ public class JobService {
        Map<String, Object> params = new HashMap<>();
        params.put("jobConfig", flJobConfigVO.getId());
        if(!StringUtils.isEmpty(flJobConfigVO.getSqlFieldValue())){
            params.put(flJobConfigVO.getSqlField(),flJobConfigVO.getSqlFieldValue());
            params.put("sqlFiledValue",flJobConfigVO.getSqlFieldValue());
            //params.put(flJobConfigVO.getSqlField(),flJobConfigVO.getSqlFieldValue());
        }else{
            params.put(flJobConfigVO.getSqlField(), DateFormatUtils.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
            params.put("sqlFiledValue", DateFormatUtils.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
            //params.put(flJobConfigVO.getSqlField(), DateFormatUtils.format(new Date(),"yyyy-MM-dd HH:mm:ss"));
        }
        params.put("sqlFiledCondition", ">");
        //往quartz框架添加任务

+ 1 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/DoctorInfoService.java

@ -1470,6 +1470,7 @@ public class DoctorInfoService extends BaseService {
                String data = responseObject.getString("data");
                if("0".equals(data)){
                    Doctor doctor = findDoctorByCode(doctorCode);
                    strNewCalledPasswd = Base64Utils.encryptBASE64(strNewCalledPasswd);
                    doctor.setCheckPassword(strNewCalledPasswd);//保存密码,以便忘记密码时候使用
                    doctor.setIscertified(1);//说明已经(线上认证,已修改密码)
                    doctorDao.save(doctor);

+ 6 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java

@ -1333,7 +1333,11 @@ public class StatisticsESService {
        if (resultList != null) {
            String signTaskNum = "";
            if ("3".equals(lowCode)) {
                signTaskNum = systemDictService.getDictValueNoRedis("SIGN_TASKNUM_17_65", year);//2017年65岁以上的目标量
                if ("2017".equals(year)){
                    signTaskNum = systemDictService.getDictValueNoRedis("SIGN_TASKNUM_17_65", year);//2017年65岁以上的目标量
                }else if ("2016".equals(year)){
                    signTaskNum = systemDictService.getDictValueNoRedis("SIGN_TASKNUM_16_65", year);
                }
            } else {
                signTaskNum = systemDictService.getDictValueNoRedis("SIGN_TASKNUM_17", year);//目标量
            }
@ -2258,7 +2262,7 @@ public class StatisticsESService {
            }
            resultMaps.add(rs);
        }
        if ((level == 3 && "5".equals(low_level)) || (level == 4) || (level == 3 && "5".equals(low_level))) {
        if (level == 4 ||"5".equals(low_level)) {
            Map<Integer, Map<String, Object>> leaders = getAllTeamLeaders();
            if (resultMaps != null && resultMaps.size() > 0) {
                for (Map<String, Object> r : resultMaps) {

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -1327,7 +1327,7 @@ public class JMJkEduArticleService extends BaseService {
            heapm.setLeaveWords(one.getLeaveWords());//医生留言
            doctor = doctorDao.findByCode(one.getDoctorCode());
            heapm.setPhoto(doctor.getPhoto());
//            heapm.setTotalData(total);
            heapm.setTotalData(total);
            result.add(heapm);
            // heapm.setTime();//时间  xx小时前  2017-10-11
        }

+ 21 - 7
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/Base64Utils.java

@ -1,14 +1,10 @@
package com.yihu.wlyy.util;
import org.apache.axis.encoding.Base64;
import sun.misc.BASE64Decoder;
import sun.misc.BASE64Encoder;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.*;
/**
@ -141,4 +137,22 @@ public class Base64Utils {
		in.close();
	}
	//加密
	public static String encryptBASE64(String key) {
		byte[] bt = key.getBytes();
		return (new BASE64Encoder()).encodeBuffer(bt);
	}
	//解密
	public static String decryptBASE64(String key) {
		byte[] bt;
		try {
			bt = (new BASE64Decoder()).decodeBuffer(key);
			return new String(bt, "utf-8");//如果出现乱码可以改成: String(bt, "utf-8")或 gbk
		} catch (IOException e) {
			e.printStackTrace();
			return "";
		}
	}
}

+ 23 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandingService.java

@ -11,6 +11,7 @@ import com.yihu.wlyy.repository.doctor.DoctorDao;
import com.yihu.wlyy.repository.manage.UserDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.PatientDeviceDao;
import com.yihu.wlyy.util.Base64Utils;
import com.yihu.wlyy.util.ElasticsearchUtil;
import com.yihu.wlyy.util.LatitudeUtils;
import com.yihu.wlyy.util.MD5;
@ -20,6 +21,7 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
@ -43,6 +45,8 @@ public class DataHandingService {
    private ElastricSearchSave elastricSearchSave;
    @Autowired
    private PatientDeviceDao patientDeviceDao;
    @Autowired
    private JdbcTemplate jdbcTemplate;
    @Transactional
    public String producePatientAndDoctorPassword() {
@ -190,4 +194,23 @@ public class DataHandingService {
        });
        return ja;
    }
    //原有CA的密码没有加密,清洗成加密密码
    public boolean updateCAPassword(){
        boolean flag = true;
        try {
            String sql = " select * from wlyy_doctor where check_password is not null and check_password <> ''";
            List<Doctor> list =  jdbcTemplate.queryForList(sql,Doctor.class);
            List<Doctor> result = new ArrayList<>();
            list.stream().forEach(one->{
                one.setCheckPassword(Base64Utils.encryptBASE64(one.getCheckPassword()));
                result.add(one);
            });
            doctorDao.save(result);
        }catch (Exception e){
            e.printStackTrace();
            flag = false;
        }
        return  flag;
    }
}

+ 12 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandlingController.java

@ -264,4 +264,16 @@ public class DataHandlingController extends BaseController {
        return write(200, jsonObject.toString());
    }
    @RequestMapping(value = "/updateCAPassword", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("CA密码加密")
    public String updateCAPassword() {
        boolean flag = dataHandingService.updateCAPassword();
        if (flag) {
            return write(200, "清洗数据成功!");
        } else {
            return write(0, "清洗数据失败!");
        }
    }
}

+ 15 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java

@ -24,10 +24,7 @@ import com.yihu.wlyy.service.app.sign.FamilyContractService;
import com.yihu.wlyy.service.app.team.DrHealthTeamService;
import com.yihu.wlyy.service.common.account.RoleService;
import com.yihu.wlyy.service.common.account.TokenService;
import com.yihu.wlyy.util.CommonUtil;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.IdcardValidator;
import com.yihu.wlyy.util.RSAUtils;
import com.yihu.wlyy.util.*;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -1987,7 +1984,8 @@ public class DoctorController extends BaseController {
    public String installAuthenticationPassword(@RequestParam(value = "strNewCalledPasswd",required = true) String strNewCalledPasswd){
        try {
            Doctor doctor = doctorInfoService.findDoctorByCode(getUID());
            String strOldCalledPasswd = StringUtils.isNotEmpty(doctor.getCheckPassword())?doctor.getCheckPassword():"11111111";
            String strOldCalledPasswd = StringUtils.isNotEmpty(doctor.getCheckPassword())?doctor.getCheckPassword():Base64Utils.encryptBASE64("11111111");
            strOldCalledPasswd = Base64Utils.decryptBASE64(strOldCalledPasswd);
            boolean b = doctorInfoService.updateAuthenticationPassword(doctor.getIdcard(),strOldCalledPasswd,strNewCalledPasswd,getUID());
            if(b){
                return write(200, "设置密码成功!", "data", b);
@ -2138,5 +2136,17 @@ public class DoctorController extends BaseController {
            return error(-1, "获取失败!");
        }
    }
    public static void main(String[] args) {
        String aa = "111111";
//        String bb= MD5.GetMD5Code(aa);
//        System.out.printf(bb);
//        String cc= MD5.GetMD5Code(bb);
//        System.out.printf(cc);
        String bb = Base64Utils.encryptBASE64(aa);
        System.out.println(bb);
        String cc = Base64Utils.decryptBASE64(bb);
        System.out.println(cc);
    }
}