瀏覽代碼

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

humingfen 7 年之前
父節點
當前提交
79dcf495bb
共有 28 個文件被更改,包括 599 次插入141 次删除
  1. 4 2
      edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java
  2. 18 9
      patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/DeviceService.java
  3. 4 2
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/job/business/MysqlToEsQuotaJob.java
  4. 4 4
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/service/JobService.java
  5. 5 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientDao.java
  6. 6 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientDeviceLogDao.java
  7. 4 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/DeviceDetailService.java
  8. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceLogService.java
  9. 2 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/express/SFExpressService.java
  10. 7 6
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/CreditLogService.java
  11. 63 8
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/TaskService.java
  12. 36 22
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java
  13. 190 10
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/statisticsES/StatisticsESService.java
  14. 11 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/PatientService.java
  15. 17 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/applets/AppletsService.java
  16. 121 30
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandingService.java
  17. 20 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandlingController.java
  18. 8 14
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/device/DoctorDeviceController.java
  19. 10 11
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/imm/DoctorImmController.java
  20. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java
  21. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/family/FamilyMemberController.java
  22. 4 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/bank/CreditsLogController.java
  23. 0 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/bank/TaskController.java
  24. 7 7
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java
  25. 27 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/health/bank/AccountController.java
  26. 26 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/process/WeiXinEventProcess.java
  27. 1 1
      patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml
  28. 1 1
      patient-co/patient-co-wlyy/src/main/resources/application-prod.yml

+ 4 - 2
edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java

@ -267,9 +267,11 @@ public class ArticleApi {
					array.add(jsonObj);
					array.add(jsonObj);
				}
				}
				rv.put("Result", array);
				return rv.toString();
			}else{
				return ApiUtil.getRespJSON(-10000, "找不到文章").toString();
			}
			}
			rv.put("Result", array);
			return rv.toString();
		} catch (SQLException e) {
		} catch (SQLException e) {
			e.printStackTrace();
			e.printStackTrace();
			return ApiUtil.getRespJSON(-14444, "获取数据异常:" + e.getMessage()).toString();
			return ApiUtil.getRespJSON(-14444, "获取数据异常:" + e.getMessage()).toString();

+ 18 - 9
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/DeviceService.java

@ -501,6 +501,13 @@ public class DeviceService extends BaseService{
                String patientCode = result.getUser();
                String patientCode = result.getUser();
                Patient patient = patientDao.findByCode(patientCode);
                Patient patient = patientDao.findByCode(patientCode);
                String flagStr = "";
                if (deviceType==1){
                    flagStr="BP_MEASURE";
                }else if (deviceType==2){
                    flagStr="GLU_MEASURE";
                }
                //增加积分
                //增加积分
                if (dataUoloadCount == 0 && "350205".equals(patient.getTown())){
                if (dataUoloadCount == 0 && "350205".equals(patient.getTown())){
                    String sql = "select count(*) num from device.wlyy_devices where device_code = '"+deviceSn+"'";
                    String sql = "select count(*) num from device.wlyy_devices where device_code = '"+deviceSn+"'";
@ -509,7 +516,7 @@ public class DeviceService extends BaseService{
                        String url = wlyyService + "healthBank/insertCredits";
                        String url = wlyyService + "healthBank/insertCredits";
                        List<NameValuePair> params = new ArrayList<>();
                        List<NameValuePair> params = new ArrayList<>();
                        params.add(new BasicNameValuePair("creditsDetail", "{\"tradeType\":\"HEALTH_TASK\",\"flag\":\"MEASURE\",\"tradeDirection\":1,\"status\":1,\"patientId\":\""+result.getUser()+"\",\"hospital\":\"350205\"}"));
                        params.add(new BasicNameValuePair("creditsDetail", "{\"tradeType\":\"HEALTH_TASK\",\"flag\":\""+flagStr+"\",\"tradeDirection\":1,\"status\":1,\"patientId\":\""+result.getUser()+"\",\"hospital\":\"350205\"}"));
                        String response = HttpClientUtil.post(url, params, "UTF-8");
                        String response = HttpClientUtil.post(url, params, "UTF-8");
                        System.out.println(response);
                        System.out.println(response);
@ -536,13 +543,10 @@ public class DeviceService extends BaseService{
                //增加活跃度
                //增加活跃度
                if (dataUoloadCount == 0){
                if (dataUoloadCount == 0){
                    String url1 = systemDictDao.findByDictNameAndCode("HEALTH_BANK_URL","HEALTH_BANK_URL");
                    String url = url1 + "/createActiveRecord";
                    String url = wlyyService + "healthBank/createActiveRecord";
                    List<NameValuePair> params = new ArrayList<>();
                    List<NameValuePair> params = new ArrayList<>();
                    params.add(new BasicNameValuePair("originalStatus", "0"));
                    params.add(new BasicNameValuePair("currentStatus","1"));
                    params.add(new BasicNameValuePair("patientId",patient.getCode()));
                    String response = HttpClientUtil.post(url,params,"UTF-8");
                    params.add(new BasicNameValuePair("activeRecord", "{\"taskCode\":\""+flagStr+"\",\"patientId\":\""+result.getUser()+"\"}"));
                    String response = HttpClientUtil.post(url, params, "UTF-8");
                    if (StringUtils.isNotEmpty(response)){
                    if (StringUtils.isNotEmpty(response)){
                        com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(response);
                        com.alibaba.fastjson.JSONObject jsonObject = JSON.parseObject(response);
                        if (!"200".equals(jsonObject.getString("status"))){
                        if (!"200".equals(jsonObject.getString("status"))){
@ -1131,14 +1135,16 @@ public class DeviceService extends BaseService{
        // 查询病人家庭签约的健康管理师
        // 查询病人家庭签约的健康管理师
        SignFamily signFamily = signFamilyDao.findByjiatingPatientYes(patientCode);
        SignFamily signFamily = signFamilyDao.findByjiatingPatientYes(patientCode);
        String healthDoctorFamily = "";
        String healthDoctorFamily = "";
        String doctorFamily = "";
        if (signFamily != null) {
        if (signFamily != null) {
            healthDoctorFamily = signFamily.getDoctorHealth();
            healthDoctorFamily = signFamily.getDoctorHealth();
            doctorFamily = signFamily.getDoctor();
            if (StringUtils.isNotEmpty(healthDoctorFamily)) {
            if (StringUtils.isNotEmpty(healthDoctorFamily)) {
                // 添加到消息接收人列表
                // 添加到消息接收人列表
                receivers.add(healthDoctorFamily);
                receivers.add(healthDoctorFamily);
            } else {
            } else if (StringUtils.isNotEmpty(doctorFamily)){
                // 添加到消息接收人列表
                // 添加到消息接收人列表
                receivers.add(signFamily.getDoctor());
                receivers.add(doctorFamily);
            }
            }
        }
        }
        // 查询病人三师签约中的健康管理师
        // 查询病人三师签约中的健康管理师
@ -1150,6 +1156,9 @@ public class DeviceService extends BaseService{
                // 添加到消息接收人列表
                // 添加到消息接收人列表
                receivers.add(healthDoctorTeam);
                receivers.add(healthDoctorTeam);
            }
            }
            if (StringUtils.isNotEmpty(signFamilySS.getDoctor())){
                receivers.add(signFamilySS.getDoctor());
            }
        }
        }
        List<Message> messages = new ArrayList<Message>();
        List<Message> messages = new ArrayList<Message>();

+ 4 - 2
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/job/business/MysqlToEsQuotaJob.java

@ -336,10 +336,12 @@ public class MysqlToEsQuotaJob implements Job {
            startTime = new LocalDate(new DateTime().minusDays(2)).toString("yyyy-MM-dd") + " 17:00:00";
            startTime = new LocalDate(new DateTime().minusDays(2)).toString("yyyy-MM-dd") + " 17:00:00";
        }else if("2".equals(this.incrementInterval)){//周
        }else if("2".equals(this.incrementInterval)){//周
            Date monday = DateUtil.getMondayOfThisDayToDate(sf.parse(endTime));
            Date monday = DateUtil.getMondayOfThisDayToDate(sf.parse(endTime));
            startTime =sf.format(monday)+ " 17:00:00";
//            startTime =sf.format(monday)+ " 17:00:00";
            startTime =DateUtil.getNextDay(monday,-1)+ " 17:00:00";
        }else if("3".equals(this.incrementInterval)){//月
        }else if("3".equals(this.incrementInterval)){//月
            Date fristDay = DateUtil.getFristDayOfMonthToDate(sf.parse(endTime));
            Date fristDay = DateUtil.getFristDayOfMonthToDate(sf.parse(endTime));
            startTime = sf.format(fristDay)+ " 17:00:00";
//            startTime = sf.format(fristDay)+ " 17:00:00";
            startTime =DateUtil.getNextDay(fristDay,-1)+ " 17:00:00";
        }
        }
    }
    }
}
}

+ 4 - 4
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/service/JobService.java

@ -501,8 +501,8 @@ public class JobService {
            int lastWeek = DateUtil.week(lastDate);
            int lastWeek = DateUtil.week(lastDate);
            for(int i=startWeek;i<=lastWeek;i++){
            for(int i=startWeek;i<=lastWeek;i++){
                start = getDate(startDate ,i,2);
                start = getDate(startDate ,i,2);
                end = getDate(startDate ,i+1,1);
                productDataByOneDay2(start,end,2,id);
                end = getDate(startDate ,i,7);
                productDataByOneDay2(DateUtil.getNextDay(sdf.parse(start),-1),DateUtil.getNextDay(sdf.parse(end),1),2,id);
            }
            }
            startDate =lastDate;
            startDate =lastDate;
        }
        }
@ -511,8 +511,8 @@ public class JobService {
        for(int i=startWeek;i<=endWeek;i++){
        for(int i=startWeek;i<=endWeek;i++){
            start = getDate(startDate ,i,2);
            start = getDate(startDate ,i,2);
            end = getDate(startDate ,i+1,1);
            productDataByOneDay2(start,end,2,id);
            end = getDate(startDate ,i,7);
            productDataByOneDay2(DateUtil.getNextDay(sdf.parse(start),-1),DateUtil.getNextDay(sdf.parse(end),1),2,id);
        }
        }
    }
    }

+ 5 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientDao.java

@ -52,6 +52,11 @@ public interface PatientDao extends PagingAndSortingRepository<Patient, Long> {
    @Modifying
    @Modifying
    @Query("update Patient p set p.openid = null where p.code <> ?1 and p.openid = ?2 and p.status=1")
    @Query("update Patient p set p.openid = null where p.code <> ?1 and p.openid = ?2 and p.status=1")
    int clearOpenid(String patient, String openid);
    int clearOpenid(String patient, String openid);
    
    //清空openid
    @Modifying
    @Query("update Patient p set p.openid = null where p.openid = ?1 and p.status=1")
    int clearOpenidByOpenid(String openid);
    @Query(" select p from Patient p,SignFamily s where p.code=s.patient and s.status > 0 ")
    @Query(" select p from Patient p,SignFamily s where p.code=s.patient and s.status > 0 ")
    List<Patient> findAllSignPatient();
    List<Patient> findAllSignPatient();

+ 6 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/patient/PatientDeviceLogDao.java

@ -14,4 +14,10 @@ public interface PatientDeviceLogDao extends PagingAndSortingRepository<PatientD
    @Query("select pdl from PatientDeviceLog pdl where pdl.patient=?1 and pdl.categoryCode=?2")
    @Query("select pdl from PatientDeviceLog pdl where pdl.patient=?1 and pdl.categoryCode=?2")
    List<PatientDeviceLog> findByPatientAndCategoryCode(String patient,String categoryCode);
    List<PatientDeviceLog> findByPatientAndCategoryCode(String patient,String categoryCode);
    
    @Query("select pdl from PatientDeviceLog pdl where pdl.patient=?1 group by deviceSn ")
    List<PatientDeviceLog> findByPatientGroupByDeviceSn(String patient);
    @Query("select a from PatientDeviceLog a")
    List<PatientDeviceLog> findAllList();
}
}

+ 4 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/DeviceDetailService.java

@ -90,16 +90,16 @@ public class DeviceDetailService extends BaseService {
		}
		}
		if (isFirst){
		if (isFirst){
			String updateFirstSql ="update device.wlyy_devices dd set dd.is_grant=1,dd.grant_admin_team=?,dd.grant_org_code=?,dd.binding_count=?,dd.grant_time = ?,dd.is_binding=1 where dd.device_code=?";
			jdbcTemplate.update(updateFirstSql,new Object[]{String.valueOf(adminTeam),hospital,isFirstBind,grantTime,patientDevice.getDeviceSn()});
			String updateFirstSql ="update device.wlyy_devices dd set dd.is_grant=1,dd.grant_admin_team=?,dd.grant_org_code=?,dd.binding_count=?,dd.grant_time = ?,dd.org_name=?,dd.is_binding=1 where dd.device_code=?";
			jdbcTemplate.update(updateFirstSql,new Object[]{String.valueOf(adminTeam),hospital,isFirstBind,grantTime,hospitalName,patientDevice.getDeviceSn()});
			//deviceDetailDao.updateAfterBindingFirst(String.valueOf(adminTeam),hospital,isFirstBind,grantTime,patientDevice.getDeviceSn());
			//deviceDetailDao.updateAfterBindingFirst(String.valueOf(adminTeam),hospital,isFirstBind,grantTime,patientDevice.getDeviceSn());
		}else {
		}else {
			List<PatientDevice> patientDeviceList = patientDeviceDao.findByDeviceSn(patientDevice.getDeviceSn());
			List<PatientDevice> patientDeviceList = patientDeviceDao.findByDeviceSn(patientDevice.getDeviceSn());
			int patientDeviceSize = patientDeviceList.size();
			int patientDeviceSize = patientDeviceList.size();
			String updateSql = "";
			String updateSql = "";
			if (bind == 0){
			if (bind == 0){
				updateSql ="update device.wlyy_devices dd set dd.is_grant=1,dd.grant_admin_team=?,dd.grant_org_code=?,dd.binding_count=?,dd.is_binding=? where dd.device_code=?";
				jdbcTemplate.update(updateSql,new Object[]{String.valueOf(adminTeam),hospital,isFirstBind,patientDeviceSize,patientDevice.getDeviceSn()});
				updateSql ="update device.wlyy_devices dd set dd.is_grant=1,dd.grant_admin_team=?,dd.grant_org_code=?,dd.binding_count=?,dd.is_binding=?,dd.org_name=?  where dd.device_code=?";
				jdbcTemplate.update(updateSql,new Object[]{String.valueOf(adminTeam),hospital,isFirstBind,patientDeviceSize,hospitalName,patientDevice.getDeviceSn()});
			}else if (bind>0){
			}else if (bind>0){
				updateSql ="update device.wlyy_devices dd set dd.is_grant=1,dd.binding_count=?,dd.is_binding=? where dd.device_code=?";
				updateSql ="update device.wlyy_devices dd set dd.is_grant=1,dd.binding_count=?,dd.is_binding=? where dd.device_code=?";
				jdbcTemplate.update(updateSql,new Object[]{isFirstBind,patientDeviceSize,patientDevice.getDeviceSn()});
				jdbcTemplate.update(updateSql,new Object[]{isFirstBind,patientDeviceSize,patientDevice.getDeviceSn()});

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceLogService.java

@ -103,7 +103,7 @@ public class PatientDeviceLogService extends BaseService {
        }
        }
        //筛选条件--超过一个月未测量
        //筛选条件--超过一个月未测量
        if (!StringUtils.isEmpty(noGaugeDay) && StringUtils.equals("4",noGaugeDay)){
        if (!StringUtils.isEmpty(noGaugeDay) && StringUtils.equals("4",noGaugeDay)){
            sql += " and b.patient NOT IN (SELECT user FROM device.wlyy_patient_health_index WHERE  DATE_SUB(CURDATE(), INTERVAL 1 MONTH) > DATE(record_date))";
            sql += " and b.patient NOT IN (SELECT user FROM device.wlyy_patient_health_index WHERE  DATE_SUB(DATE_SUB(CURDATE(), INTERVAL 1 MONTH),INTERVAL 1 DAY) <= DATE(record_date))";
        }
        }
        //发送消息要筛选未发送消息的设备
        //发送消息要筛选未发送消息的设备
        if (StringUtils.isNotEmpty(isSend)){
        if (StringUtils.isNotEmpty(isSend)){

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/express/SFExpressService.java

@ -193,10 +193,12 @@ public class SFExpressService extends BaseService {
        Hospital hospital = hospitalDao.findByCode(prescription.getHospital());
        Hospital hospital = hospitalDao.findByCode(prescription.getHospital());
        String xml = SFUtils.postSFOrderService(sfexpress_obj,hospital,sf_code);
        String xml = SFUtils.postSFOrderService(sfexpress_obj,hospital,sf_code);
        logger.info("顺丰快递下订单:xml"+xml);
        String re = this.SFExpressPost(xml);
        String re = this.SFExpressPost(xml);
//        String re = "<Response service=\"OrderService\"><Head>OK</Head><Body><OrderResponse filter_result=\"2\" destcode=\"592\" mailno=\"444844978335\" origincode=\"592\" orderid=\"6daa6baec5fd4b65a1b023a8b60e2e91\"/></Body></Response>";
//        String re = "<Response service=\"OrderService\"><Head>OK</Head><Body><OrderResponse filter_result=\"2\" destcode=\"592\" mailno=\"444844978335\" origincode=\"592\" orderid=\"6daa6baec5fd4b65a1b023a8b60e2e91\"/></Body></Response>";
        //xml验证
        //xml验证
        logger.info("顺丰快递下订单:re"+re);
        verificationResponXml(re,"向顺丰快递下订单失败!");
        verificationResponXml(re,"向顺丰快递下订单失败!");
        Document doc = DocumentHelper.parseText(re);
        Document doc = DocumentHelper.parseText(re);

+ 7 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/CreditLogService.java

@ -165,7 +165,7 @@ public class CreditLogService {
     */
     */
    public JSONObject selectByCondition(JSONObject object,Integer page,Integer size){
    public JSONObject selectByCondition(JSONObject object,Integer page,Integer size){
        String response = null;
        String response = null;
        String url =getBaseUrl() + "findCreditsLogInfo";
        String url=getBaseUrl() + "findCreditsLogInfo";
        Map<String,String> params = new HashMap<>();
        Map<String,String> params = new HashMap<>();
        params.put("creditsDetail",object.toJSONString());
        params.put("creditsDetail",object.toJSONString());
        params.put("page",page.toString());
        params.put("page",page.toString());
@ -303,11 +303,12 @@ public class CreditLogService {
     * @param size
     * @param size
     * @return
     * @return
     */
     */
    public JSONObject selectByActivityRanking1(String activityId,Integer page,Integer size){
    public JSONObject selectByActivityRanking1(String activityId,String patientId,Integer page,Integer size){
        String response = null;
        String response = null;
        String url =getBaseUrl() + "selectByActivityRanking1";
        String url =getBaseUrl() + "selectByActivityRanking1";
        Map<String,String> params = new HashMap<>();
        Map<String,String> params = new HashMap<>();
        params.put("activityId",activityId);
        params.put("activityId",activityId);
        params.put("patientId",patientId);
        params.put("page",page.toString());
        params.put("page",page.toString());
        params.put("size",size.toString());
        params.put("size",size.toString());
        JSONObject object1 = null;
        JSONObject object1 = null;
@ -317,8 +318,8 @@ public class CreditLogService {
            JSONArray array = object1.getJSONArray("detailModelList");
            JSONArray array = object1.getJSONArray("detailModelList");
            for (int i = 0;array != null && i<array.size();i++){
            for (int i = 0;array != null && i<array.size();i++){
                JSONObject object2 = array.getJSONObject(i);
                JSONObject object2 = array.getJSONObject(i);
                String patientId = object2.getString("patientId");
                Patient patient = patientDao.findByCode(patientId);
                String patientId1 = object2.getString("patientId");
                Patient patient = patientDao.findByCode(patientId1);
                object2.put("patient",patient);
                object2.put("patient",patient);
            }
            }
        }catch (Exception e){
        }catch (Exception e){
@ -347,7 +348,7 @@ public class CreditLogService {
        object.put("unionId",patient.getUnionid());
        object.put("unionId",patient.getUnionid());
        object.put("patientIdcard",patient.getIdcard());
        object.put("patientIdcard",patient.getIdcard());
        String response = null;
        String response = null;
        String url =getBaseUrl() + "selectByPatient";
        String url =getBaseUrl()+ "selectByPatient";
        Map<String,String> params = new HashMap<>();
        Map<String,String> params = new HashMap<>();
        params.put("activity",object.toJSONString());
        params.put("activity",object.toJSONString());
        params.put("page",page.toString());
        params.put("page",page.toString());
@ -473,7 +474,7 @@ public class CreditLogService {
                    ids.add(patientDevices.get(0).getUser());
                    ids.add(patientDevices.get(0).getUser());
                }
                }
            }else if (bindStatus == 1){
            }else if (bindStatus == 1){
                String sql1 = "select * from wlyy_patient_device where user = '"+patientIds.get(i)+"' AND category_code = "+deviceType+" AND del = " + bindStatus;
                String sql1 = "select * from wlyy_patient_device where user = '"+patientIds.get(i)+"' AND category_code = "+deviceType+" AND del = " + 0;
                List<PatientDevice> patientDevices = jdbcTemplate.query(sql1,new BeanPropertyRowMapper(PatientDevice.class));
                List<PatientDevice> patientDevices = jdbcTemplate.query(sql1,new BeanPropertyRowMapper(PatientDevice.class));
                if (patientDevices == null || patientDevices.size() ==0){
                if (patientDevices == null || patientDevices.size() ==0){
                    ids.add(patientIds.get(i));
                    ids.add(patientIds.get(i));

+ 63 - 8
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/TaskService.java

@ -6,9 +6,12 @@ import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.PatientFamilyMember;
import com.yihu.wlyy.entity.patient.PatientFamilyMember;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.PatientFamilyMemberDao;
import com.yihu.wlyy.repository.patient.PatientFamilyMemberDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.repository.statistics.WlyySignFamilyCodeDao;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.util.HttpClientUtil;
import org.slf4j.Logger;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.slf4j.LoggerFactory;
@ -19,7 +22,6 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.stereotype.Service;
import javax.transaction.Transactional;
import javax.transaction.Transactional;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashMap;
import java.util.List;
import java.util.List;
import java.util.Map;
import java.util.Map;
@ -49,6 +51,10 @@ public class TaskService {
    private PatientDao patientDao;
    private PatientDao patientDao;
    @Autowired
    @Autowired
    private PatientFamilyMemberDao patientFamilyMemberDao;
    private PatientFamilyMemberDao patientFamilyMemberDao;
    @Autowired
    private SignFamilyDao signFamilyDao;
    @Autowired
    private WlyySignFamilyCodeDao signFamilyCodeDao;
    /**
    /**
@ -124,16 +130,24 @@ public class TaskService {
     */
     */
    public JSONObject attendTask(JSONObject object) throws Exception {
    public JSONObject attendTask(JSONObject object) throws Exception {
        String response = null;
        String response = null;
        Patient patient = patientDao.findByCode(object.getString("patientId"));
        String unionId = "1";
        String patientId = object.getString("patientId");
        SignFamily signFamily = signFamilyDao.findByPatient(patientId);
        if (signFamily == null){
            throw new Exception("已签约居民,才能报名!");
        }else if (signFamily!=null&&!signFamily.getExpensesStatus().equalsIgnoreCase("1")){
            throw new Exception("已签约居民,才能报名!");
        }
        Patient patient = patientDao.findByCode(patientId);
        String unionId = object.getString("unionId");
        Patient patient1 = patientDao.findByUnionid(unionId);
        Patient patient1 = patientDao.findByUnionid(unionId);
        if (patient1 != null){
        if (patient1 != null){
            throw new Exception("该居民已报过名!");
            throw new Exception("该居民已报名!");
        }
        }
        patient.setUnionid(unionId);
        patient.setUnionid(unionId);
        patientDao.save(patient);
        patientDao.save(patient);
        object.put("unionId",unionId);
        object.put("unionId",unionId);
        object.put("patientIdcard",patient.getIdcard());
        object.put("patientIdcard",patient.getIdcard());
        object.put("patientOpenid",patient.getOpenid());
        String url =getBaseUrl() + "attendTask";
        String url =getBaseUrl() + "attendTask";
        Map<String,String> params = new HashMap<>();
        Map<String,String> params = new HashMap<>();
        params.put("taskPatientDetail",object.toJSONString());
        params.put("taskPatientDetail",object.toJSONString());
@ -161,20 +175,61 @@ public class TaskService {
        if (patients != null && patients.size()!=0){
        if (patients != null && patients.size()!=0){
            patient = patients.get(0);
            patient = patients.get(0);
        }
        }
        List<Patient> patientList = new ArrayList<>();
        JSONArray array = new JSONArray();
      /*  List<Patient> patientList = new ArrayList<>();*/
        JSONObject object = new JSONObject();
        JSONObject object = new JSONObject();
        if (patient != null){
        if (patient != null){
            patientList.add(patient);
            String sql1 = "select * from wlyy_sign_family a where a.patient = '"+patient.getCode()+"'";
            List<SignFamily> signFamilyList = jdbcTemplate.query(sql1,new BeanPropertyRowMapper(SignFamily.class));
            if (signFamilyList != null&&signFamilyList.size()!=0){
                SignFamily signFamily1 = signFamilyList.get(0);
                JSONObject object2 = (JSONObject) JSONObject.toJSON(patient);
                object2.put("hospital",signFamily1.getHospitalName());
                array.add(object2);
            }
            /*patientList.add(patient);*/
            List<PatientFamilyMember> patientFamilyMemberList = patientFamilyMemberDao.findByPatient(patient.getCode());
            List<PatientFamilyMember> patientFamilyMemberList = patientFamilyMemberDao.findByPatient(patient.getCode());
            for (PatientFamilyMember patientFamilyMember:patientFamilyMemberList){
            for (PatientFamilyMember patientFamilyMember:patientFamilyMemberList){
                Patient patient1 = patientDao.findByCode(patientFamilyMember.getFamilyMember());
                Patient patient1 = patientDao.findByCode(patientFamilyMember.getFamilyMember());
                patientList.add(patient1);
                String sql2 = "select * from wlyy_sign_family a where a.patient = '"+patient1.getCode()+"'";
                List<SignFamily> signFamilyList2 = jdbcTemplate.query(sql2,new BeanPropertyRowMapper(SignFamily.class));
                if(signFamilyList2 != null&&signFamilyList2.size()!=0){
                    SignFamily signFamily = signFamilyList2.get(0);
                    JSONObject object1 = (JSONObject) JSONObject.toJSON(patient1);
                    object1.put("hospital",signFamily.getHospitalName());
                    array.add(object1);
                }
                /*patientList.add(patient1);*/
            }
            }
            object.put("patientList",patientList);
            object.put("patientList",array);
            object.put("total",patientFamilyMemberList.size());
            object.put("total",patientFamilyMemberList.size());
            object.put("page",1);
            object.put("page",1);
            object.put("size",100);
            object.put("size",100);
        }
        }
        return object;
        return object;
    }
    }
    /**
     * 创建记录
     *
     * @param object{"patientId":"","taskCode":"","originalStatus","currentStatus":""}
     * @return
     * @throws Exception
     */
    public JSONObject createActiveRecord(JSONObject object) throws Exception {
        String response = null;
        Patient patient = patientDao.findByCode(object.getString("patientId"));
        object.put("unionId",patient.getUnionid());
        object.put("patientIdcard",patient.getIdcard());
        object.put("patientOpenid",patient.getOpenid());
        String url =getBaseUrl() + "createActiveRecord";
        try {
            response = httpClientUtil.iotPostBody(url,object.toString());
        }catch (Exception e){
            e.printStackTrace();
            logger.error(e.getMessage());
        }
        return JSONObject.parseObject(response);
    }
}
}

+ 36 - 22
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java

@ -1,11 +1,13 @@
package com.yihu.wlyy.service.app.sign;
package com.yihu.wlyy.service.app.sign;
import com.yihu.device.entity.DeviceDetail;
import com.yihu.wlyy.entity.address.Country;
import com.yihu.wlyy.entity.address.Country;
import com.yihu.wlyy.entity.address.Street;
import com.yihu.wlyy.entity.address.Street;
import com.yihu.wlyy.entity.address.Town;
import com.yihu.wlyy.entity.address.Town;
import com.yihu.wlyy.entity.charge.WlyyCharge;
import com.yihu.wlyy.entity.charge.WlyyCharge;
import com.yihu.wlyy.entity.consult.Consult;
import com.yihu.wlyy.entity.consult.Consult;
import com.yihu.wlyy.entity.device.PatientDevice;
import com.yihu.wlyy.entity.device.PatientDevice;
import com.yihu.wlyy.entity.device.PatientDeviceLog;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.profile.Doctor;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
import com.yihu.wlyy.entity.doctor.team.admin.AdminTeam;
@ -14,6 +16,7 @@ import com.yihu.wlyy.entity.doctor.team.sign.DoctorTeamMember;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.patient.*;
import com.yihu.wlyy.entity.patient.*;
import com.yihu.wlyy.entity.wechat.WechatTemplateConfig;
import com.yihu.wlyy.entity.wechat.WechatTemplateConfig;
import com.yihu.wlyy.health.repository.DeviceDetailDao;
import com.yihu.wlyy.repository.address.CountryDao;
import com.yihu.wlyy.repository.address.CountryDao;
import com.yihu.wlyy.repository.address.StreetDao;
import com.yihu.wlyy.repository.address.StreetDao;
import com.yihu.wlyy.repository.address.TownDao;
import com.yihu.wlyy.repository.address.TownDao;
@ -136,6 +139,10 @@ public class SignWebService extends BaseService {
    private WechatTemplateConfigDao templateConfigDao;
    private WechatTemplateConfigDao templateConfigDao;
    @Autowired
    @Autowired
    private PatientDeviceDao patientDeviceDao;
    private PatientDeviceDao patientDeviceDao;
    @Autowired
    private PatientDeviceLogDao patientDeviceLogDao;
    @Autowired
    private DeviceDetailDao deviceDetailDao;
    /**
    /**
     * 厦门市
     * 厦门市
     */
     */
@ -773,31 +780,38 @@ public class SignWebService extends BaseService {
            jsonObject.put("statusName", statusName);
            jsonObject.put("statusName", statusName);
            jsonArray.add(jsonObject);
            jsonArray.add(jsonObject);
        }
        }
        
        List<PatientDevice> patientDevices = patientDeviceDao.findByPatient(patient);
        for (PatientDevice patientDevice: patientDevices) {
        List<PatientDeviceLog> patientDeviceLogs = patientDeviceLogDao.findByPatientGroupByDeviceSn(patient);
//        List<PatientDevice> patientDevices = patientDeviceDao.findByPatient(patient);
        for (PatientDeviceLog patientDeviceLog: patientDeviceLogs) {
            JSONObject jsonObject = new JSONObject();
            JSONObject jsonObject = new JSONObject();
            SignFamily signFamily = signFamilyDao.findByPatient(patient);//签约社区
            if(StringUtils.isNotBlank(patientDevice.getDoctor())){
                Doctor deviceDoctor = doctorService.findDoctorByCode(patientDevice.getDoctor());
                jsonObject.put("doctor",patientDevice.getDoctor());//操作医生代码
                jsonObject.put("doctorName",deviceDoctor.getName());//操作医生姓名
//            SignFamily signFamily = signFamilyDao.findByPatient(patient);//签约社区
//            if(signFamily == null || signFamily.getCode() == null){
//                continue;
//            }
            if(1 == patientDeviceLog.getRole() ){
                Doctor deviceDoctor = doctorService.findDoctorByCode(patientDeviceLog.getOperator());
                jsonObject.put("doctor",patientDeviceLog.getOperator());//操作医生代码
                jsonObject.put("doctorName",patientDeviceLog.getOperatorName());//操作医生姓名
                jsonObject.put("hospitalName",deviceDoctor.getHospitalName());//社区名称
            }else{
                DeviceDetail deviceDetail = deviceDetailDao.findBySn(patientDeviceLog.getDeviceSn());
                jsonObject.put("hospitalName",deviceDetail.getOrgName());//社区名称
            }
            }
            
            jsonObject.put("dataType","device");//家庭医生签约服务包
            jsonObject.put("dataType","device");//家庭医生签约服务包
            jsonObject.put("deviceId",patientDevice.getDeviceId());//设备ID
            jsonObject.put("deviceSn",patientDevice.getDeviceSn());//设备SN码
            jsonObject.put("sim",patientDevice.getSim());//设备SIM卡号
            jsonObject.put("deviceName",patientDevice.getDeviceName());//设备名称
            jsonObject.put("user",patientDevice.getUser());//居民CODE
            jsonObject.put("categoryCode",patientDevice.getCategoryCode());//1血糖仪,2.血压计
            jsonObject.put("userType",patientDevice.getUserType());//-1代表单用户
            jsonObject.put("userIdcard",patientDevice.getUserIdcard());//用户身份证号
            jsonObject.put("agent",patientDevice.getAgent());//代绑人代码(家人)
            jsonObject.put("agentName",patientDevice.getAgentName());//代绑人姓名
            jsonObject.put("createTime",patientDevice.getCzrq());//操作时间
            jsonObject.put("agreementPhoto",patientDevice.getAgreementPhoto());//上传的协议图片地址
            jsonObject.put("hospitalName",signFamily.getHospitalName());//社区名称
            jsonObject.put("deviceId",patientDeviceLog.getDeviceId());//设备ID
            jsonObject.put("deviceSn",patientDeviceLog.getDeviceSn());//设备SN码
            jsonObject.put("deviceName",patientDeviceLog.getDeviceName());//设备名称
            jsonObject.put("user",patient);//居民CODE
            jsonObject.put("categoryCode",patientDeviceLog.getCategoryCode());//1血糖仪,2.血压计
//            jsonObject.put("userType",patientDevice.getUserType());//-1代表单用户
//            jsonObject.put("userIdcard",patientDevice.getUserIdcard());//用户身份证号
//            jsonObject.put("agent",patientDevice.getAgent());//代绑人代码(家人)
//            jsonObject.put("agentName",patientDevice.getAgentName());//代绑人姓名
            jsonObject.put("createTime",patientDeviceLog.getCreateTime());//操作时间
            jsonObject.put("agreementPhoto",patientDeviceLog.getAgreementPhoto());//上传的协议图片地址
            
            jsonArray.add(jsonObject);
            jsonArray.add(jsonObject);
        }
        }
        
        

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

@ -906,7 +906,12 @@ public class StatisticsESService {
            json.put("data", jsonArray);
            json.put("data", jsonArray);
            return json;
            return json;
        } else if (interval == 2) {
        } else if (interval == 2) {
            JSONArray jsonArray = weekTotalStatistics(startDate, endDate, area, level, index, lowCode, timelevel);
            JSONArray jsonArray = null;
            if("90".equals(index)){
                jsonArray = weekTotalStatistics_90(startDate, endDate, area, level, index, lowCode, timelevel);
            }else {
                jsonArray = weekTotalStatistics(startDate, endDate, area, level, index, lowCode, timelevel);
            }
            json.put("data", jsonArray);
            json.put("data", jsonArray);
            return json;
            return json;
        } else if (interval == 3) {
        } else if (interval == 3) {
@ -1016,6 +1021,7 @@ public class StatisticsESService {
        }
        }
    }
    }
    /**
    /**
     * 按周统计 折线图
     * 按周统计 折线图
     *
     *
@ -1041,7 +1047,7 @@ public class StatisticsESService {
        //因为统计时间是统计到当前时间的前一天,所以这里的时间是提前一天
        //因为统计时间是统计到当前时间的前一天,所以这里的时间是提前一天
        Calendar temp = Calendar.getInstance();
        Calendar temp = Calendar.getInstance();
        temp.setTime(DateUtil.strToDate(endDate, DateUtil.YYYY_MM_DD));
        temp.setTime(DateUtil.strToDate(endDate, DateUtil.YYYY_MM_DD));
        temp.add(Calendar.DAY_OF_MONTH, -1);
//        temp.add(Calendar.DAY_OF_MONTH, -1);
        end.setTime(temp.getTime());
        end.setTime(temp.getTime());
        // 起始日期为周几
        // 起始日期为周几
        int week = start.get(Calendar.DAY_OF_WEEK);
        int week = start.get(Calendar.DAY_OF_WEEK);
@ -1090,6 +1096,8 @@ public class StatisticsESService {
        // 结果集
        // 结果集
        Map<String, JSONObject> countResult = new HashMap<>();
        Map<String, JSONObject> countResult = new HashMap<>();
//        Date dd = df.parse();
        // 算出每个查询周期
        // 算出每个查询周期
        for (int j = 0; j < days.size() - 1; j++) {
        for (int j = 0; j < days.size() - 1; j++) {
            String startStr = "";
            String startStr = "";
@ -1109,6 +1117,14 @@ public class StatisticsESService {
            range.put("range", endStr);
            range.put("range", endStr);
            range.put("amount", 0);
            range.put("amount", 0);
            countResult.put(endStr, range);
            countResult.put(endStr, range);
//            if(!DateUtil.getSundayOfThisDate(new Date()).equals(df.format(new Date()))){
//                JSONObject range2 = new JSONObject();
//                range2.put("range", endDate);
//                range2.put("amount", 0);
//                countResult.put(df.format(new Date()), range2);
//            };
        }
        }
        if (startDate.equals(df.format(new Date()))) {
        if (startDate.equals(df.format(new Date()))) {
@ -1135,10 +1151,173 @@ public class StatisticsESService {
                    range = df.format(saveModel.getQuotaDate());
                    range = df.format(saveModel.getQuotaDate());
                }
                }
                JSONObject json = countResult.get(range);
                JSONObject json = countResult.get(range);
                //因为上述时间集提前一天  但是前端是显示当前时间,所以这里给调整回去
                if (range.equals(df.format(temp.getTime()))) {
                    json.put("range", endDate);
//                //因为上述时间集提前一天  但是前端是显示当前时间,所以这里给调整回去
//                if (range.equals(df.format(temp.getTime()))) {
//                    json.put("range", endDate);
//                }
                if (json != null) {
                    long amount = saveModel.getResult2().longValue();
                    json.put("amount", amount);
                }
            }
            List<JSONObject> result = new ArrayList<>(countResult.values());
            // 排序
            result.sort(new Comparator<JSONObject>() {
                @Override
                public int compare(JSONObject o1, JSONObject o2) {
                    if (o1.getString("range").compareTo(o2.getString("range")) > 0) {
                        return 1;
                    } else if (o1.getString("range").compareTo(o2.getString("range")) < 0) {
                        return -1;
                    } else {
                        return 0;
                    }
                }
            });
            return new JSONArray(result);
        } else {
            return new JSONArray();
        }
    }
    /**
     * 按周统计 折线图 90指标,es统计生成数据规则是按周去重
     *
     * @param startDate
     * @param endDate
     * @param area
     * @param level
     * @param index
     * @param lowCode
     * @return
     * @throws Exception
     */
    private JSONArray weekTotalStatistics_90(String startDate, String endDate, String area, int level, String index, String lowCode, String timelevel) throws Exception {
        SimpleDateFormat df = new SimpleDateFormat("yyyy-MM-dd");
        // 起始日期
        Calendar start = Calendar.getInstance();
        start.setTime(DateUtil.strToDate(startDate, DateUtil.YYYY_MM_DD));
        // 第一个统计周期结束日期
        String firstEnd = "";
        // 结束日期
        Calendar end = Calendar.getInstance();
        //因为统计时间是统计到当前时间的前一天,所以这里的时间是提前一天
        Calendar temp = Calendar.getInstance();
        temp.setTime(DateUtil.strToDate(endDate, DateUtil.YYYY_MM_DD));
//        temp.add(Calendar.DAY_OF_MONTH, -1);
        end.setTime(temp.getTime());
        // 起始日期为周几
        int week = start.get(Calendar.DAY_OF_WEEK);
        int incre = 7 - week + 1;
        // 日期集合
        List<Calendar> days = new ArrayList<>();
        days.add(start);
        boolean flag = true;
        int i = 0;
        if (startDate.compareTo(endDate) == 0) {
            flag = false;
            days.add(end);
            firstEnd = df.format(end.getTime());
        }
        // 计算统计日期
        while (flag) {
            Calendar next = Calendar.getInstance();
            next.setTime(days.get(days.size() - 1).getTime());
            if (i == 0) {
                if (incre != 7) {
                    next.add(Calendar.DATE, incre);
                }
            } else {
                next.add(Calendar.DATE, 7);
            }
            if (next.getTime().before(DateUtil.strToDate(endDate, "yyyy-MM-dd"))) {
                days.add(next);
                if (i == 0) {
                    firstEnd = df.format(next.getTime());
                }
            } else {
                days.add(end);
                flag = false;
                if (i == 0) {
                    firstEnd = df.format(end.getTime());
                }
                }
            }
            i++;
        }
        // 结果集
        Map<String, JSONObject> countResult = new HashMap<>();
        // 算出每个查询周期
        for (int j = 0; j < days.size() - 1; j++) {
            String startStr = "";
            String endStr = df.format(days.get(j + 1).getTime());
            // 起始、截止日期
            if (j == 0) {
                startStr = df.format(days.get(j).getTime());
            } else {
                Calendar cal = Calendar.getInstance();
                cal.setTime(days.get(j).getTime());
                cal.add(Calendar.DATE, 1);
                startStr = df.format(cal.getTime());
            }
            JSONObject range = new JSONObject();
            range.put("range", endStr);
            range.put("amount", 0);
            countResult.put(endStr, range);
//            if(!DateUtil.getSundayOfThisDate(df.parse(endDate)).equals(df.parse(endDate))){
//                JSONObject range2 = countResult.get(DateUtil.getSundayOfThisDate(df.parse(endDate)));
//                range2.put("range",endDate);
////                countResult.put(df.format(new Date()), range2);
//            };
        }
        if (startDate.equals(df.format(new Date()))) {
            Calendar preDate = Calendar.getInstance();
            preDate.setTime(df.parse(endDate));
            preDate.add(Calendar.DATE, -1);
            startDate = df.format(preDate.getTime());
        }
        List<SaveModel> saveModels = new ArrayList<>();
        if (StringUtils.isNotBlank(lowCode)) {
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel1(startDate, DateUtil.getSundayOfThisDate(df.parse(endDate)), area, level, index, timelevel, SaveModel.interval_day, lowCode);
        } else {
            saveModels = elasticsearchUtil.findLineChartDateQuotaLevel0(startDate, DateUtil.getSundayOfThisDate(df.parse(endDate)), area, level, index, timelevel, SaveModel.interval_day);
        }
        if (saveModels != null) {
            // 计算结果
            for (SaveModel saveModel : saveModels) {
                String range = "";
                if (saveModel.getQuotaDate() != null) {
                    range = df.format(saveModel.getQuotaDate());
                }
                JSONObject json = countResult.get(range);
                if(range.equals(DateUtil.getSundayOfThisDate(df.parse(endDate)))){
                    json = countResult.get(endDate);
                }
//                //因为上述时间集提前一天  但是前端是显示当前时间,所以这里给调整回去
//                if (range.equals(df.format(temp.getTime()))) {
//                    json.put("range", endDate);
//                }
                if (json != null) {
                if (json != null) {
                    long amount = saveModel.getResult2().longValue();
                    long amount = saveModel.getResult2().longValue();
                    json.put("amount", amount);
                    json.put("amount", amount);
@ -5429,7 +5608,7 @@ public class StatisticsESService {
            areaCondition = " and d.area like '" + area.substring(0, 4) + "%' ";
            areaCondition = " and d.area like '" + area.substring(0, 4) + "%' ";
//            areaCondition2 = " and t.org_code like '" + area.substring(0, 2) + "%' ";
//            areaCondition2 = " and t.org_code like '" + area.substring(0, 2) + "%' ";
        }
        }
        String activitySql = "select count(1) from wlyy_health_bank.wlyy_health_bank_activity d where d.status=1  " + areaCondition;
        String activitySql = "select count(1) from wlyy_health_bank.wlyy_health_bank_activity d where 1=1  " + areaCondition;
        Integer activityCount = jdbcTemplate.queryForObject(activitySql, Integer.class);//发布活动数
        Integer activityCount = jdbcTemplate.queryForObject(activitySql, Integer.class);//发布活动数
@ -5481,7 +5660,7 @@ public class StatisticsESService {
    }
    }
    /**
    /**
     * 获取活动信息
     * 获取活动的信息
     *
     *
     * @param id
     * @param id
     * @param area
     * @param area
@ -5500,7 +5679,7 @@ public class StatisticsESService {
        if (StringUtils.isNotEmpty(id)) {
        if (StringUtils.isNotEmpty(id)) {
            condition += " and a.id='" + id+"'";
            condition += " and a.id='" + id+"'";
        }
        }
        String sql = " select * from wlyy_health_bank.wlyy_health_bank_activity a where a.status=1 " + condition;
        String sql = " select * from wlyy_health_bank.wlyy_health_bank_activity a where 1=1 " + condition;
        return jdbcTemplate.queryForList(sql);
        return jdbcTemplate.queryForList(sql);
    }
    }
@ -5515,11 +5694,11 @@ public class StatisticsESService {
//        Map<String, Object> resultMap = new HashedMap();//返回的结果
//        Map<String, Object> resultMap = new HashedMap();//返回的结果
        List<SaveModel> allAmountList = null;//签约已缴费人数列表
        List<SaveModel> allAmountList = null;//签约已缴费人数列表
        List<SaveModel> applyAmountList = null;//报名人数列表
        List<SaveModel> applyAmountList = null;//报名人数列表
        allAmountList = elasticsearchUtil.findDateQuotaLevel0(timeKey, timeKey, area, level, index_all, SaveModel.timeLevel_DDL, "", low_level);
        if (StringUtils.isNotEmpty(slaveKey1)) {
        if (StringUtils.isNotEmpty(slaveKey1)) {
            allAmountList = elasticsearchUtil.findDateQuotaLevel1(timeKey, timeKey, area, level, index_all, SaveModel.timeLevel_DDL, slaveKey1, "", low_level);
//            allAmountList = elasticsearchUtil.findDateQuotaLevel1(timeKey, timeKey, area, level, index_all, SaveModel.timeLevel_DDL, null, "", low_level);
            applyAmountList = elasticsearchUtil.findDateQuotaLevel1(timeKey, timeKey, area, level, index_part, SaveModel.timeLevel_DDL, slaveKey1, "", low_level);
            applyAmountList = elasticsearchUtil.findDateQuotaLevel1(timeKey, timeKey, area, level, index_part, SaveModel.timeLevel_DDL, slaveKey1, "", low_level);
        } else {
        } else {
            allAmountList = elasticsearchUtil.findDateQuotaLevel0(timeKey, timeKey, area, level, index_all, SaveModel.timeLevel_DDL, "", low_level);
            applyAmountList = elasticsearchUtil.findDateQuotaLevel0(timeKey, timeKey, area, level, index_part, SaveModel.timeLevel_DDL, "", low_level);
            applyAmountList = elasticsearchUtil.findDateQuotaLevel0(timeKey, timeKey, area, level, index_part, SaveModel.timeLevel_DDL, "", low_level);
        }
        }
        Map<String, Integer> allMap = new HashMap<>(); //签约人数的的列表转map
        Map<String, Integer> allMap = new HashMap<>(); //签约人数的的列表转map
@ -5745,4 +5924,5 @@ public class StatisticsESService {
        JSONArray rsJs = new JSONArray(rs);
        JSONArray rsJs = new JSONArray(rs);
        return rsJs;
        return rsJs;
    }*/
    }*/
}
}

+ 11 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/common/account/PatientService.java

@ -1126,4 +1126,15 @@ public class PatientService extends TokenService {
        }
        }
        return true;
        return true;
    }
    }
    
    /**
     * 根据Openid清除openid
     * @param openid
     * @return
     */
    @Transactional
    public String clearOpenidByOpenid (String openid)  throws Exception{
        patientDao.clearOpenidByOpenid(openid);
        return "";
    }
}
}

+ 17 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/applets/AppletsService.java

@ -5,12 +5,15 @@ import com.yihu.wlyy.entity.patient.PatientAimSports;
import com.yihu.wlyy.repository.patient.PatientAimSportsDao;
import com.yihu.wlyy.repository.patient.PatientAimSportsDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.health.bank.TaskService;
import com.yihu.wlyy.util.SecretUtils;
import com.yihu.wlyy.util.SecretUtils;
import com.yihu.wlyy.util.http.HttpResponse;
import com.yihu.wlyy.util.http.HttpResponse;
import com.yihu.wlyy.util.http.HttpUtils;
import com.yihu.wlyy.util.http.HttpUtils;
import org.apache.commons.collections.map.HashedMap;
import org.apache.commons.collections.map.HashedMap;
import org.json.JSONArray;
import org.json.JSONArray;
import org.json.JSONObject;
import org.json.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.JdbcTemplate;
@ -28,6 +31,7 @@ import java.util.Map;
@Transactional
@Transactional
public class AppletsService extends BaseService {
public class AppletsService extends BaseService {
    private static Logger logger = LoggerFactory.getLogger(AppletsService.class);
    @Value("${applets.appId}")
    @Value("${applets.appId}")
    private String appid;
    private String appid;
    @Value("${applets.appSecret}")
    @Value("${applets.appSecret}")
@ -38,6 +42,8 @@ public class AppletsService extends BaseService {
    private PatientDao patientDao;
    private PatientDao patientDao;
    @Autowired
    @Autowired
    private PatientAimSportsDao patientAimSportsDao;
    private PatientAimSportsDao patientAimSportsDao;
    @Autowired
    private TaskService taskService;
    public Map<String, Object> checkApplets(String code) throws Exception {
    public Map<String, Object> checkApplets(String code) throws Exception {
        HttpUtils httpUtils = new HttpUtils();
        HttpUtils httpUtils = new HttpUtils();
@ -50,6 +56,8 @@ public class AppletsService extends BaseService {
        HttpResponse response = httpUtils.doGet("https://api.weixin.qq.com/sns/jscode2session", param);
        HttpResponse response = httpUtils.doGet("https://api.weixin.qq.com/sns/jscode2session", param);
        JSONObject rs = new JSONObject(response.getContent());
        JSONObject rs = new JSONObject(response.getContent());
        Map<String, Object> res = new HashedMap();
        Map<String, Object> res = new HashedMap();
        logger.info("checkApplets:"+response.getContent());
        res.put("openid", rs.getString("openid"));
        res.put("openid", rs.getString("openid"));
        res.put("sessionKey", rs.getString("session_key"));
        res.put("sessionKey", rs.getString("session_key"));
        res.put("unionid", rs.getString("unionid"));
        res.put("unionid", rs.getString("unionid"));
@ -133,6 +141,15 @@ public class AppletsService extends BaseService {
            patientAimSportsDao.save(patientAimSports);
            patientAimSportsDao.save(patientAimSports);
        }
        }
        //上传步数记录
        try{
            com.alibaba.fastjson.JSONObject json  = new com.alibaba.fastjson.JSONObject();
            json.put("patientId",patient);
            json.put("taskCode","ACTIVITY_STEP");
            taskService.createActiveRecord(json);
        }catch (Exception e){
            logger.info(e.toString());
        }
        return true;
        return true;
    }
    }

+ 121 - 30
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandingService.java

@ -248,63 +248,125 @@ public class DataHandingService {
    @Transactional(rollbackFor = Exception.class)
    @Transactional(rollbackFor = Exception.class)
    public void updateToPaitentDevcieLog()throws Exception{
    public void updateToPaitentDevcieLog()throws Exception{
        List<PatientDevice> patientDeviceList = patientDeviceDao.findAll();
        List<PatientDevice> patientDeviceList = patientDeviceDao.findAll();
        String sql = "SELECT * FROM `wlyy_patient_device_log` where operate_code = 1";
        List<PatientDeviceLog> patientDeviceLogs = jdbcTemplate.query(sql,new BeanPropertyRowMapper<>(PatientDeviceLog.class));
        List<PatientDeviceLog> patientDeviceLogList = new ArrayList<>();
        List<PatientDeviceLog> patientDeviceLogList = new ArrayList<>();
        for (PatientDevice patientDevice : patientDeviceList){
        for (PatientDevice patientDevice : patientDeviceList){
            PatientDeviceLog patientDeviceLog = new PatientDeviceLog();
            patientDeviceLog.setDeviceId(patientDevice.getDeviceId());
            patientDeviceLog.setAgreementPhoto(patientDevice.getAgreementPhoto());
            if (!StringUtils.isEmpty(patientDevice.getDoctor())){
                patientDeviceLog.setOperator(patientDevice.getDoctor());
                patientDeviceLog.setOperatorName(patientDevice.getDoctorName());
                patientDeviceLog.setRole(1);
            }else if (!StringUtils.isEmpty(patientDevice.getAgent())){
                patientDeviceLog.setOperator(patientDevice.getAgent());
                patientDeviceLog.setOperatorName(patientDevice.getAgentName());
                patientDeviceLog.setRole(2);
            int i = 0 ;
            for (PatientDeviceLog patientDeviceLog : patientDeviceLogs){
                if (patientDevice.getDeviceSn().equals(patientDeviceLog.getDeviceSn()) && patientDevice.getUser().equals(patientDeviceLog.getPatient())){
                    i++;
                }
            }
            if (i==0){
                PatientDeviceLog patientDeviceLog = new PatientDeviceLog();
                patientDeviceLog.setDeviceId(patientDevice.getDeviceId());
                patientDeviceLog.setAgreementPhoto(patientDevice.getAgreementPhoto());
                if (!StringUtils.isEmpty(patientDevice.getDoctor())){
                    patientDeviceLog.setOperator(patientDevice.getDoctor());
                    patientDeviceLog.setOperatorName(patientDevice.getDoctorName());
                    patientDeviceLog.setRole(1);
                }else if (!StringUtils.isEmpty(patientDevice.getAgent())){
                    patientDeviceLog.setOperator(patientDevice.getAgent());
                    patientDeviceLog.setOperatorName(patientDevice.getAgentName());
                    patientDeviceLog.setRole(2);
                }else {
                    patientDeviceLog.setRole(2);
                    patientDeviceLog.setOperator(patientDevice.getUser());
                    Patient pa = patientDao.findByCode(patientDevice.getUser());
                    if (pa!=null){
                        patientDeviceLog.setOperatorName(pa.getName());
                    }
                }
                patientDeviceLog.setCreateTime(patientDevice.getCzrq());
                patientDeviceLog.setDeviceSn(patientDevice.getDeviceSn());
                patientDeviceLog.setDeviceName(patientDevice.getDeviceName());
                patientDeviceLog.setCategoryCode(patientDevice.getCategoryCode());
                patientDeviceLog.setPatient(patientDevice.getUser());
                patientDeviceLog.setOperateCode(1);
                patientDeviceLog.setIsDel(1);
                patientDeviceLogList.add(patientDeviceLog);
            }
            }
            patientDeviceLog.setCreateTime(patientDevice.getCzrq());
            patientDeviceLog.setDeviceSn(patientDevice.getDeviceSn());
            patientDeviceLog.setDeviceName(patientDevice.getDeviceName());
            patientDeviceLog.setCategoryCode(patientDevice.getCategoryCode());
            patientDeviceLog.setPatient(patientDevice.getUser());
            patientDeviceLog.setOperateCode(1);
            patientDeviceLog.setIsDel(1);
            patientDeviceLogList.add(patientDeviceLog);
        }
        }
        patientDeviceLogDao.save(patientDeviceLogList);
        patientDeviceLogDao.save(patientDeviceLogList);
    }
    }
    @Transactional(rollbackFor = Exception.class)
    public boolean updateDeviceDefalut(){
        boolean flag = true;
        try{
            String deviceSql = "SELECT wd.*,dd.category_code,dd.is_multi_user FROM device.wlyy_devices wd LEFT JOIN wlyy.dm_device dd ON wd.device_model = dd.model";
            List<Map<String,Object>> deviceDetailList = jdbcTemplate.queryForList(deviceSql);
            //把wlyy_devices库里bindCount先补充默认值
            List<String> deviceSqlList = new ArrayList<>();
            for (Map<String,Object> deviceMap : deviceDetailList){
                String bindingCount="";
                if (StringUtils.isEmpty(String.valueOf(deviceMap.get("binding_count"))) || StringUtils.pathEquals("null",String.valueOf(deviceMap.get("binding_count")))){
                    if (org.apache.commons.lang3.StringUtils.isNotEmpty(String.valueOf(deviceMap.get("is_multi_user"))) && StringUtils.pathEquals("0",String.valueOf(deviceMap.get("is_multi_user")))){
                        bindingCount="{\"1\":\"0\"}";
                    }else if (org.apache.commons.lang3.StringUtils.isNotEmpty(String.valueOf(deviceMap.get("is_multi_user"))) && StringUtils.pathEquals("1",String.valueOf(deviceMap.get("is_multi_user")))){
                        bindingCount="{\"1\":\"0\",\"2\":\"0\"}";
                    }else if (StringUtils.isEmpty(String.valueOf(deviceMap.get("is_multi_user"))) || StringUtils.pathEquals("null",String.valueOf(deviceMap.get("is_multi_user")))){
                        if (String.valueOf(deviceMap.get("device_name")).contains("血糖")){
                            bindingCount="{\"1\":\"0\"}";
                        }
                        if (String.valueOf(deviceMap.get("device_name")).contains("血压")){
                            bindingCount="{\"1\":\"0\",\"2\":\"0\"}";
                        }
                    }
                    //String updateDeviceSql = ;
                    deviceSqlList.add("UPDATE device.wlyy_devices SET binding_count='"+bindingCount +"' where device_code='"+String.valueOf(deviceMap.get("device_code"))+"'");
                }
            }
            String deviceStr[] = new String[deviceSqlList.size()];
            deviceStr = deviceSqlList.toArray(deviceStr);
            jdbcTemplate.batchUpdate(deviceStr);
        }catch (Exception e){
            flag = false;
            e.printStackTrace();
        }
        return flag;
    }
    @Transactional(rollbackFor = Exception.class)
    @Transactional(rollbackFor = Exception.class)
    public void updateDevice()throws Exception{
    public void updateDevice()throws Exception{
        String patientDeviceSql = "SELECT pd.*,sf.admin_team_code,sf.hospital FROM wlyy_patient_device pd LEFT JOIN wlyy_sign_family sf ON pd.`user` = sf.patient where sf.`status`>0 GROUP BY pd.id";
        //String patientDeviceSql = "SELECT pd.*,sf.admin_team_code,sf.hospital FROM wlyy_patient_device pd LEFT JOIN wlyy_sign_family sf ON pd.`user` = sf.patient where sf.`status`>0 GROUP BY pd.id";
        String patientDeviceSql = "SELECT pd.id,pd.device_id AS deviceId,pd.category_code categoryCode,pd.device_name deviceName,pd.device_sn deviceSn,pd.`user`,pd.user_type userType,pd.czrq,sf.admin_team_code,sf.hospital,sf.hospital_name orgName FROM wlyy_patient_device pd LEFT JOIN wlyy_sign_family sf ON pd.`user` = sf.patient where sf.`status`>0 GROUP BY pd.id";
        List<Map<String,Object>> patientDeviceList = jdbcTemplate.queryForList(patientDeviceSql);
        List<Map<String,Object>> patientDeviceList = jdbcTemplate.queryForList(patientDeviceSql);
        String deviceSql = "SELECT * FROM device.wlyy_devices";
        String deviceSql = "SELECT * FROM device.wlyy_devices";
        List<DeviceDetail> deviceDetailList = jdbcTemplate.query(deviceSql,new BeanPropertyRowMapper<>(DeviceDetail.class));
        List<DeviceDetail> deviceDetailList = jdbcTemplate.query(deviceSql,new BeanPropertyRowMapper<>(DeviceDetail.class));
        //封装设备与患者表的数据,一个设备多键
        Map<String,List<String>> map = new HashedMap();
        Map<String,List<String>> map = new HashedMap();
        for (Map<String,Object> patientDeviceMap : patientDeviceList) {
        for (Map<String,Object> patientDeviceMap : patientDeviceList) {
            List<String> userTypeList = null;
            List<String> userTypeList = null;
            if (map.containsKey(String.valueOf(patientDeviceMap.get("device_sn")))) {
                userTypeList = map.get(String.valueOf(patientDeviceMap.get("device_sn")));
            if (map.containsKey(String.valueOf(patientDeviceMap.get("deviceSn")))) {
                userTypeList = map.get(String.valueOf(patientDeviceMap.get("deviceSn")));
                if (userTypeList == null) {
                if (userTypeList == null) {
                    userTypeList = new ArrayList<>();
                    userTypeList = new ArrayList<>();
                    userTypeList.add(String.valueOf(patientDeviceMap.get("user_type")));
                    map.put(String.valueOf(patientDeviceMap.get("device_sn")), userTypeList);
                    userTypeList.add(String.valueOf(patientDeviceMap.get("userType")));
                    map.put(String.valueOf(patientDeviceMap.get("deviceSn")), userTypeList);
                } else {
                } else {
                    boolean flag = false;
                    boolean flag = false;
                    if (!userTypeList.contains(String.valueOf(patientDeviceMap.get("user_type")))) {
                    if (!userTypeList.contains(String.valueOf(patientDeviceMap.get("userType")))) {
                        flag = true;
                        flag = true;
                    }
                    }
                    if (flag) {
                    if (flag) {
                        userTypeList.add(String.valueOf(patientDeviceMap.get("user_type")));
                        map.put(String.valueOf(patientDeviceMap.get("device_sn")), userTypeList);
                        userTypeList.add(String.valueOf(patientDeviceMap.get("userType")));
                        map.put(String.valueOf(patientDeviceMap.get("deviceSn")), userTypeList);
                    }
                    }
                }
                }
            }else {
                userTypeList = new ArrayList<>();
                userTypeList.add(String.valueOf(patientDeviceMap.get("userType")));
                map.put(String.valueOf(patientDeviceMap.get("deviceSn")), userTypeList);
            }
            }
        }
        }
        List<String> sqlList = new ArrayList<>();
        for (Map<String,Object> patientDeviceMap : patientDeviceList) {
        for (Map<String,Object> patientDeviceMap : patientDeviceList) {
            String deviceSn = String.valueOf(patientDeviceMap.get("device_sn"));
            String deviceSn = String.valueOf(patientDeviceMap.get("deviceSn"));
            int i = 0;
            int i = 0;
            for (DeviceDetail deviceDetail: deviceDetailList){
            for (DeviceDetail deviceDetail: deviceDetailList){
                if (deviceDetail.getDeviceCode().equals(deviceSn)){
                if (deviceDetail.getDeviceCode().equals(deviceSn)){
@ -334,8 +396,8 @@ public class DataHandingService {
                }
                }
                String sql = "UPDATE device.wlyy_devices SET is_grant=1,grant_admin_team='"+String.valueOf(patientDeviceMap.get
                String sql = "UPDATE device.wlyy_devices SET is_grant=1,grant_admin_team='"+String.valueOf(patientDeviceMap.get
                        ("admin_team_code"))+"',grant_org_code='"+String.valueOf(patientDeviceMap.get("hospital"))+"',is_binding="+size+",binding_count='"+bindCount
                        ("admin_team_code"))+"',grant_org_code='"+String.valueOf(patientDeviceMap.get("hospital"))+"',is_binding="+size+",binding_count='"+bindCount
                        +"',grant_time="+patientDevice.getCzrq()+" where device_code='"+patientDevice.getDeviceSn()+"'";
                jdbcTemplate.update(sql);
                        +"',grant_time='"+DateUtil.dateToStr(patientDevice.getCzrq(),"yyyy-MM-dd HH:mm:ss")+"',org_name='"+String.valueOf(patientDeviceMap.get("orgName"))+"' where device_code='"+patientDevice.getDeviceSn()+"'";
                sqlList.add(sql);
            }
            }
            //如果wlyy_devices表里没有对应的数据 则增加一条。
            //如果wlyy_devices表里没有对应的数据 则增加一条。
            if (i==0){
            if (i==0){
@ -350,6 +412,9 @@ public class DataHandingService {
                deviceDetailService.insertDevice(patientDevice,String.valueOf(patientDeviceMap.get("admin_team_code")),String.valueOf(patientDeviceMap.get("hospital_name")),String.valueOf(patientDeviceMap.get("hospital")),bindCount);
                deviceDetailService.insertDevice(patientDevice,String.valueOf(patientDeviceMap.get("admin_team_code")),String.valueOf(patientDeviceMap.get("hospital_name")),String.valueOf(patientDeviceMap.get("hospital")),bindCount);
            }
            }
        }
        }
        String[] sqlStr = new String[sqlList.size()];
        sqlStr = sqlList.toArray(sqlStr);
        jdbcTemplate.batchUpdate(sqlStr);
    }
    }
    public void addPointOldDeviceBind()throws Exception{
    public void addPointOldDeviceBind()throws Exception{
@ -385,4 +450,30 @@ public class DataHandingService {
            }
            }
        }
        }
    }
    }
    public void addPointOldHealth()throws Exception{
        String sql ="SELECT ph.`user`,sf.`name`,DATE(ph.record_date),ph.type " +
                " FROM device.`wlyy_patient_health_index` ph LEFT JOIN wlyy.wlyy_sign_family sf ON ph.`user` = sf.patient " +
                " WHERE ph.del=1 AND ph.record_date >'2017-07-01 00:00:00' AND ph.record_date <='2018-06-30 23:59:59' " +
                " and LEFT(sf.hospital,6)='350205' GROUP BY DATE(ph.record_date),ph.`user`";
        List<Map<String,Object>> mapList = jdbcTemplate.queryForList(sql);
        String flagStr = "";
        for (Map<String,Object> map : mapList){
            String type = String.valueOf(map.get("type"));
            String user = String.valueOf(map.get("user"));
            if (!StringUtils.isEmpty(type) && StringUtils.pathEquals("1",type)){
                flagStr = "GLU_MEASURE";
            }else if (StringUtils.pathEquals("2",type)){
                flagStr = "BP_MEASURE";
            }
            String creditDetail = "{\"tradeType\":\"HEALTH_TASK\",\"flag\":\""+flagStr+"\",\"tradeDirection\":1,\"status\":1,\"patientId\":\""+user+"\",\"hospital\":\"350205\"}";
            com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(creditDetail);
            com.alibaba.fastjson.JSONObject response = creditLogService.insert(jsonObject);
            String status = response.getString("status");
            if (!"200".equals(status)){
                logger.info("添加积分失败!");
            }
        }
    }
}
}

+ 20 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandlingController.java

@ -286,6 +286,7 @@ public class DataHandlingController extends BaseController {
            dataHandingService.updateToPaitentDevcieLog();
            dataHandingService.updateToPaitentDevcieLog();
            return write(200,"清洗数据成功!");
            return write(200,"清洗数据成功!");
        }catch (Exception e){
        }catch (Exception e){
            e.printStackTrace();
            System.out.println("将wlyy_patient_device的数据清洗至wlyy_patietn_devcie_log失败:--->"+e.getMessage());
            System.out.println("将wlyy_patient_device的数据清洗至wlyy_patietn_devcie_log失败:--->"+e.getMessage());
            return write(-1,"清洗数据失败");
            return write(-1,"清洗数据失败");
        }
        }
@ -298,9 +299,13 @@ public class DataHandlingController extends BaseController {
    @ApiOperation("将devcie库中wlyy_device新增的字段补充完整")
    @ApiOperation("将devcie库中wlyy_device新增的字段补充完整")
    public String updateDevice(){
    public String updateDevice(){
        try {
        try {
            dataHandingService.updateDevice();
            boolean flag = dataHandingService.updateDeviceDefalut();
            if (flag){
                dataHandingService.updateDevice();
            }
            return write(200,"清洗数据成功!");
            return write(200,"清洗数据成功!");
        }catch (Exception e){
        }catch (Exception e){
            e.printStackTrace();
            System.out.println("将devcie库中wlyy_device新增的字段补充完整失败:--->"+e.getMessage());
            System.out.println("将devcie库中wlyy_device新增的字段补充完整失败:--->"+e.getMessage());
            return write(-1,"清洗数据失败");
            return write(-1,"清洗数据失败");
        }
        }
@ -319,4 +324,18 @@ public class DataHandlingController extends BaseController {
            return write(-1,"清洗数据失败");
            return write(-1,"清洗数据失败");
        }
        }
    }
    }
    //
    @RequestMapping(value = "/addPointOldHealth",method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("之前上传体征数据的加分")
    public String addPointOldHealth(){
        try{
            dataHandingService.addPointOldHealth();
            return write(200,"请洗数据成功!");
        }catch (Exception e){
            e.printStackTrace();
            return write(-1,"请洗数据失败!");
        }
    }
}
}

+ 8 - 14
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/device/DoctorDeviceController.java

@ -21,6 +21,7 @@ import com.yihu.wlyy.service.app.device.DeviceWxMessageService;
import com.yihu.wlyy.service.app.device.PatientDeviceLogService;
import com.yihu.wlyy.service.app.device.PatientDeviceLogService;
import com.yihu.wlyy.service.app.device.PatientDeviceService;
import com.yihu.wlyy.service.app.device.PatientDeviceService;
import com.yihu.wlyy.service.app.health.bank.CreditLogService;
import com.yihu.wlyy.service.app.health.bank.CreditLogService;
import com.yihu.wlyy.service.app.health.bank.TaskService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.service.app.team.AdminTeamService;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.service.common.account.DoctorService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.task.PushMsgTask;
@ -101,6 +102,8 @@ public class DoctorDeviceController extends BaseController {
	private SystemDictDao systemDictDao;
	private SystemDictDao systemDictDao;
	@Autowired
	@Autowired
	private HttpClientUtil httpClientUtil;
	private HttpClientUtil httpClientUtil;
	@Autowired
	private TaskService taskService;
	@Autowired
	@Autowired
	private JmsTemplate jmsTemplate;
	private JmsTemplate jmsTemplate;
@ -160,8 +163,8 @@ public class DoctorDeviceController extends BaseController {
			Patient patient = patientDao.findByCode(device.getUser());
			Patient patient = patientDao.findByCode(device.getUser());
			SignFamily signFamily = signFamilyDao.findSignByPatient(patient.getCode(),2);
			SignFamily signFamily = signFamilyDao.findSignByPatient(patient.getCode(),2);
			//调用增加积分接口  海沧区的居民才能添加积分
			//调用增加积分接口  海沧区的居民才能添加积分
			String flagStr ="";
			if (flag && "350205".equals(signFamily.getHospital().substring(0,6))){
			if (flag && "350205".equals(signFamily.getHospital().substring(0,6))){
				String flagStr ="";
				if ("1".equals(device.getCategoryCode())){
				if ("1".equals(device.getCategoryCode())){
					flagStr="GLU_BIND";
					flagStr="GLU_BIND";
				}else if ("2".equals(device.getCategoryCode())){
				}else if ("2".equals(device.getCategoryCode())){
@ -177,19 +180,10 @@ public class DoctorDeviceController extends BaseController {
			}
			}
			//活动的活跃度
			//活动的活跃度
			if (flag){
			if (flag){
				String url1 = systemDictDao.findByDictNameAndCode("HEALTH_BANK_URL","HEALTH_BANK_URL");
				String url = url1 + "/createActiveRecord";
				List<NameValuePair> params = new ArrayList<>();
				params.add(new BasicNameValuePair("originalStatus", "0"));
				params.add(new BasicNameValuePair("currentStatus","1"));
				params.add(new BasicNameValuePair("patientId",patient.getCode()));
				String response = httpClientUtil.post(url,params,"UTF-8");
				if (StringUtils.isNotEmpty(response)){
					JSONObject jsonObject = JSON.parseObject(response);
					if (!"200".equals(jsonObject.getString("status"))){
						logger.info("添加活跃度失败!");
					}
				}
				JSONObject jsonObject = new JSONObject();
				jsonObject.put("patientId",patient.getCode());
				jsonObject.put("taskCode",flagStr);
				taskService.createActiveRecord(jsonObject);
			}
			}
			try {
			try {
				String openId = patient.getOpenid();
				String openId = patient.getOpenid();

+ 10 - 11
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/imm/DoctorImmController.java

@ -96,14 +96,13 @@ public class DoctorImmController extends BaseController {
			if (immrs != null) {
			if (immrs != null) {
				for (Map<String, Object> map : immrs) {
				for (Map<String, Object> map : immrs) {
					JSONObject json = new JSONObject();
					JSONObject json = new JSONObject();
					json.put("child_code", map.get("child_code"));//儿童编码
					json.put("name", map.get("name"));//儿童姓名
					json.put("photo", map.get("photo"));//头像
					json.put("idcard", map.get("idcard"));//新生儿身份证号
					json.put("barcode", map.get("barcode"));//新生儿条码
					json.put("family_code", map.get("family_code"));//家人CODE
					json.put("relation", map.get("relation"));//---1父亲 2母亲 3老公 4老婆 5儿子 6女儿 7其他
					json.put("del", map.get("del"));//0为有效,1为删除状态
					json.put("family_name", map.get("family_name"));//关联居民
					json.put("child_name", map.get("child_name"));//儿童姓名
					json.put("birthday", map.get("birthday"));//儿童生日
					json.put("ymmc", map.get("ymmc"));//疫苗名称
					json.put("ymkc", map.get("ymkc"));//true:可约,false:不可约
					json.put("alert_tag", map.get("alert_tag"));//0待提醒,1已提醒
					json.put("barcode", map.get("barcode"));//儿童免疫条码
					jsonArray.put(json);
					jsonArray.put(json);
				}
				}
			}
			}
@ -129,8 +128,8 @@ public class DoctorImmController extends BaseController {
	
	
	@RequestMapping(value = "/alertImmVacclinByPatient", method = RequestMethod.POST)
	@RequestMapping(value = "/alertImmVacclinByPatient", method = RequestMethod.POST)
	@ApiOperation(value = "医生提醒单个居民疫苗接种")
	@ApiOperation(value = "医生提醒单个居民疫苗接种")
	public String alertImmVacclinByPatient(@ApiParam(name = "code", value = "待接种记录CODE", defaultValue = "")
	                                      @RequestParam(value = "待接种记录CODE", required = true) String code){
	public String alertImmVacclinByPatient(@ApiParam(name = "barcode", value = "儿童免疫条码", defaultValue = "")
	                                      @RequestParam(value = "barcode", required = true) String barcode){
		try {
		try {
			// TODO: 2018/6/21
			// TODO: 2018/6/21
			return write(200, "请求成功");
			return write(200, "请求成功");
@ -143,7 +142,7 @@ public class DoctorImmController extends BaseController {
	@RequestMapping(value = "/getPatientImmVacclin", method = RequestMethod.GET)
	@RequestMapping(value = "/getPatientImmVacclin", method = RequestMethod.GET)
	@ApiOperation(value = "根据儿童免疫条码获取待接种疫苗")
	@ApiOperation(value = "根据儿童免疫条码获取待接种疫苗")
	public String getPatientImmVacclin(@ApiParam(name = "barcode", value = "儿童免疫编码", defaultValue = "")
	public String getPatientImmVacclin(@ApiParam(name = "barcode", value = "儿童免疫编码", defaultValue = "")
	                                       @RequestParam(value = "儿童免疫编码", required = true) String barcode){
	                                       @RequestParam(value = "barcode", required = true) String barcode){
		try {
		try {
			ChildImmuneVaccin childImmuneVaccin = childFamilyImmuneService.getChildImmuneVaccinByBarcode(barcode);
			ChildImmuneVaccin childImmuneVaccin = childFamilyImmuneService.getChildImmuneVaccinByBarcode(barcode);
			return write(200, "请求成功","data",childImmuneVaccin);
			return write(200, "请求成功","data",childImmuneVaccin);

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/consult/ConsultController.java

@ -1335,7 +1335,7 @@ public class ConsultController extends WeixinBaseController {
            if (result.has("count") && result.has("amount")){
            if (result.has("count") && result.has("amount")){
                return write(200, "查询成功!", "data", result);
                return write(200, "查询成功!", "data", result);
            }else if (result.has("count") && !result.has("amount")){
            }else if (result.has("count") && !result.has("amount")){
                return error(-1, "查询已签约记录失败!");
                return error(-1, "您的签约已到期,请重新申请");
            }else {
            }else {
                return error(-1, "查询失败!");
                return error(-1, "查询失败!");
            }
            }

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/family/FamilyMemberController.java

@ -548,7 +548,7 @@ public class FamilyMemberController extends WeixinBaseController {
    @RequestMapping(value = "/getPatientImmVacclin", method = RequestMethod.GET)
    @RequestMapping(value = "/getPatientImmVacclin", method = RequestMethod.GET)
    @ApiOperation(value = "根据儿童免疫条码获取待接种疫苗")
    @ApiOperation(value = "根据儿童免疫条码获取待接种疫苗")
    public String getPatientImmVacclin(@ApiParam(name = "barcode", value = "儿童免疫编码", defaultValue = "")
    public String getPatientImmVacclin(@ApiParam(name = "barcode", value = "儿童免疫编码", defaultValue = "")
                                       @RequestParam(value = "儿童免疫编码", required = true) String barcode){
                                       @RequestParam(value = "barcode", required = true) String barcode){
        try {
        try {
            ChildImmuneVaccin childImmuneVaccin = childFamilyImmuneService.getChildImmuneVaccinByBarcode(barcode);
            ChildImmuneVaccin childImmuneVaccin = childFamilyImmuneService.getChildImmuneVaccinByBarcode(barcode);
            return write(200, "请求成功","data",childImmuneVaccin);
            return write(200, "请求成功","data",childImmuneVaccin);

+ 4 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/bank/CreditsLogController.java

@ -235,13 +235,15 @@ public class CreditsLogController extends BaseController {
    @ApiOperation("获取活动所有排名")
    @ApiOperation("获取活动所有排名")
    public String selectByActivityRanking1(@ApiParam(name = "activityId",value = "活动id")
    public String selectByActivityRanking1(@ApiParam(name = "activityId",value = "活动id")
                                  @RequestParam(name = "activityId") String activityId,
                                  @RequestParam(name = "activityId") String activityId,
                                   @ApiParam(name = "patientId",value = "居民id")
                                   @RequestParam(value = "patientId",required = true)String patientId,
                                  @ApiParam(name = "page", value = "第几页,从1开始")
                                  @ApiParam(name = "page", value = "第几页,从1开始")
                                  @RequestParam(value = "page", defaultValue = "1",required = false)Integer page,
                                  @RequestParam(value = "page", defaultValue = "1",required = false)Integer page,
                                  @ApiParam(name = "size",defaultValue = "10",value = ",每页分页大小")
                                  @ApiParam(name = "size",defaultValue = "10",value = ",每页分页大小")
                                  @RequestParam(value = "size", required = false)Integer size){
                                  @RequestParam(value = "size", required = false)Integer size){
        try {
        try {
            return write(200,"查询成功","data",service.selectByActivityRanking1(activityId,page,size));
            return write(200,"查询成功","data",service.selectByActivityRanking1(activityId,patientId,page,size));
        }catch (Exception e){
        }catch (Exception e){
            error(e);
            error(e);
            return error(-1,e.getMessage());
            return error(-1,e.getMessage());
@ -266,7 +268,7 @@ public class CreditsLogController extends BaseController {
                                    @RequestParam(value = "size", required = false)Integer size){
                                    @RequestParam(value = "size", required = false)Integer size){
        try {
        try {
            JSONObject object = new JSONObject();
            JSONObject object = new JSONObject();
            object.put("openId",getOpenid());
            object.put("patientId",getUID());
            return write(200,"查询成功","data",service.selectByPatient(object,page,size));
            return write(200,"查询成功","data",service.selectByPatient(object,page,size));
        }catch (Exception e){
        }catch (Exception e){
            error(e);
            error(e);

+ 0 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/bank/TaskController.java

@ -95,7 +95,6 @@ public class TaskController extends BaseController{
                             @RequestParam(name = "taskPatientDetail")String taskPatientDetail){
                             @RequestParam(name = "taskPatientDetail")String taskPatientDetail){
        try {
        try {
            JSONObject object = JSONObject.parseObject(taskPatientDetail);
            JSONObject object = JSONObject.parseObject(taskPatientDetail);
            object.put("patientOpenid",getOpenid());
            return write(200,"报名成功","data",service.attendTask(object));
            return write(200,"报名成功","data",service.attendTask(object));
        }catch (Exception e){
        }catch (Exception e){
            error(e);
            error(e);

+ 7 - 7
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/statistic/EsStatisticsController.java

@ -2204,7 +2204,7 @@ public class EsStatisticsController extends BaseController {
    @RequestMapping("/lowlevel_activity")
    @RequestMapping("/lowlevel_activity")
    @ApiOperation("健康银行活动统计")
    @ApiOperation("健康银行活动统计")
    @ResponseBody
    @ResponseBody
    public String lowlevel_activity(@ApiParam(name = "id", value = "活动id") @RequestParam(required = false) String activityCode,
    public String lowlevel_activity(@ApiParam(name = "activityCode", value = "活动id") @RequestParam(required = false) String activityCode,
                                    @ApiParam(name = "area", value = "地区code") @RequestParam(required = true) String area,
                                    @ApiParam(name = "area", value = "地区code") @RequestParam(required = true) String area,
                                    @ApiParam(name = "level", value = "地区级别,1 团队,2 机构,3 区,4 市") @RequestParam(required = true) int level,
                                    @ApiParam(name = "level", value = "地区级别,1 团队,2 机构,3 区,4 市") @RequestParam(required = true) int level,
                                    @ApiParam(name = "sort", value = "排序 1倒叙 2是 正序")@RequestParam(required = true) int sort,
                                    @ApiParam(name = "sort", value = "排序 1倒叙 2是 正序")@RequestParam(required = true) int sort,
@ -2226,7 +2226,7 @@ public class EsStatisticsController extends BaseController {
    }
    }
    @RequestMapping(value = "/getAllAtivity",method = RequestMethod.GET)
    @RequestMapping(value = "/getAllAtivity",method = RequestMethod.GET)
    @ApiOperation("获取所有活动信息")
    @ApiOperation("获取所有活动的信息")
    @ResponseBody
    @ResponseBody
    public String getAllAtivity(@ApiParam(name = "id", value = "活动id")
    public String getAllAtivity(@ApiParam(name = "id", value = "活动id")
                                @RequestParam(value = "id", required = false)String id,
                                @RequestParam(value = "id", required = false)String id,
@ -2354,11 +2354,11 @@ public class EsStatisticsController extends BaseController {
//            result.put("index_89", json);
//            result.put("index_89", json);
            String index = "";
            String index = "";
            if(interval==1){
            if(interval==1){
                index="91,95";
                index="89,95";
            }else if(interval==2){
            }else if(interval==2){
                index="91,90";
                index="89,90";
            }else if(interval==2){
            }else if(interval==2){
                index="91,94";
                index="89,94";
            }
            }
            if (index != null) {
            if (index != null) {
                if (org.springframework.util.StringUtils.isEmpty(year)) {
                if (org.springframework.util.StringUtils.isEmpty(year)) {
@ -2369,10 +2369,10 @@ public class EsStatisticsController extends BaseController {
                for (String idx : indexes) {
                for (String idx : indexes) {
                    if("91".equals(idx)){
                    if("89".equals(idx)){
                        JSONObject json = statisticsESService.getDateTotal(startDate, endDate, interval, area, level, idx, activityCode, year,SaveModel.timeLevel_DDL);
                        JSONObject json = statisticsESService.getDateTotal(startDate, endDate, interval, area, level, idx, activityCode, year,SaveModel.timeLevel_DDL);
                        result.put("index_"+idx, json);
                        result.put("index_91", json);
                    }else{
                    }else{
                        JSONObject json = statisticsESService.getDateTotal(startDate, endDate, interval, area, level, idx, activityCode, year,SaveModel.timeLevel_ZL);
                        JSONObject json = statisticsESService.getDateTotal(startDate, endDate, interval, area, level, idx, activityCode, year,SaveModel.timeLevel_ZL);
                        result.put("index_90", json);
                        result.put("index_90", json);

+ 27 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/health/bank/AccountController.java

@ -5,6 +5,7 @@ package com.yihu.wlyy.web.third.health.bank;
import com.alibaba.fastjson.JSONObject;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.service.app.health.bank.CreditLogService;
import com.yihu.wlyy.service.app.health.bank.CreditLogService;
import com.yihu.wlyy.service.app.health.bank.TaskService;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperation;
@ -31,6 +32,8 @@ public class AccountController extends BaseController {
    @Autowired
    @Autowired
    private CreditLogService service;
    private CreditLogService service;
    @Autowired
    private TaskService taskService;
@ -46,13 +49,13 @@ public class AccountController extends BaseController {
    @RequestMapping(value = "/findAccount",method = RequestMethod.POST)
    @RequestMapping(value = "/findAccount",method = RequestMethod.POST)
    @ApiOperation("银行账户信息")
    @ApiOperation("银行账户信息")
    public String selectByAccount(@ApiParam(name = "account",value = "任务JSON")
    public String selectByAccount(@ApiParam(name = "account",value = "任务JSON")
                               @RequestParam(name = "account") String account,
                               @RequestParam(name = "account",required =true) String account,
                               @ApiParam(name = "page", value = "第几页,从1开始")
                               @ApiParam(name = "page", value = "第几页,从1开始")
                               @RequestParam(value = "page", defaultValue = "1",required = false)Integer page,
                               @RequestParam(value = "page", defaultValue = "1",required = false)Integer page,
                               @ApiParam(name = "size",defaultValue = "10",value = ",每页分页大小")
                               @ApiParam(name = "size",defaultValue = "10",value = ",每页分页大小")
                               @RequestParam(value = "size", required = false)Integer size){
                               @RequestParam(value = "size", required = false)Integer size){
        try {
        try {
            logger.info("findAccount!!!");
            JSONObject object = JSONObject.parseObject(account);
            JSONObject object = JSONObject.parseObject(account);
            return write(200,"查询成功","data",service.selectByAccount(object,page,size));
            return write(200,"查询成功","data",service.selectByAccount(object,page,size));
        }catch (Exception e){
        }catch (Exception e){
@ -66,13 +69,15 @@ public class AccountController extends BaseController {
    @ApiOperation("获取活动所有排名")
    @ApiOperation("获取活动所有排名")
    public String selectByActivityRanking1(@ApiParam(name = "activityId",value = "活动id")
    public String selectByActivityRanking1(@ApiParam(name = "activityId",value = "活动id")
                                  @RequestParam(name = "activityId") String activityId,
                                  @RequestParam(name = "activityId") String activityId,
                                   @ApiParam(name = "patientId",value = "居民id")
                                   @RequestParam(value = "patientId",required = true)String patientId,
                                  @ApiParam(name = "page", value = "第几页,从1开始")
                                  @ApiParam(name = "page", value = "第几页,从1开始")
                                  @RequestParam(value = "page", defaultValue = "1",required = false)Integer page,
                                  @RequestParam(value = "page", defaultValue = "1",required = false)Integer page,
                                  @ApiParam(name = "size",defaultValue = "10",value = ",每页分页大小")
                                  @ApiParam(name = "size",defaultValue = "10",value = ",每页分页大小")
                                  @RequestParam(value = "size", required = false)Integer size){
                                  @RequestParam(value = "size", required = false)Integer size){
        try {
        try {
            return write(200,"查询成功","data",service.selectByActivityRanking1(activityId,page,size));
            return write(200,"查询成功","data",service.selectByActivityRanking1(activityId,patientId,page,size));
        }catch (Exception e){
        }catch (Exception e){
            error(e);
            error(e);
            return error(-1,e.getMessage());
            return error(-1,e.getMessage());
@ -100,4 +105,23 @@ public class AccountController extends BaseController {
    }
    }
    /**
     *  添加历史记录
     *
     * @param activeRecord {"patientId":"","taskCode":"","originalStatus","currentStatus":""}
     * @return
     */
    @RequestMapping(value = "/createActiveRecord",method = RequestMethod.POST)
    @ApiOperation("添加记录")
    public String createActiveRecord(@ApiParam(name = "activeRecord",value = "对象JSON")
                                   @RequestParam(name = "activeRecord") String activeRecord){
        try {
            JSONObject object = JSONObject.parseObject(activeRecord);
            JSONObject result = taskService.createActiveRecord(object);
            return write(200,"获取成功","data",result);
        }catch (Exception e){
            error(e);
            return error(-1,e.getMessage());
        }
    }
}
}

+ 26 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/process/WeiXinEventProcess.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.wechat.process;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.entity.dict.SystemDict;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.SystemConf;
import com.yihu.wlyy.util.SystemConf;
import com.yihu.wlyy.wechat.util.WeiXinMessageReplyUtils;
import com.yihu.wlyy.wechat.util.WeiXinMessageReplyUtils;
@ -41,6 +42,9 @@ public class WeiXinEventProcess {
    @Autowired
    @Autowired
    private SystemDictDao systemDictDao;
    private SystemDictDao systemDictDao;
    
    @Autowired
    private PatientService patientService;
    /**
    /**
     * 微信推送事件处理
     * 微信推送事件处理
@ -64,6 +68,9 @@ public class WeiXinEventProcess {
                    result = subscribeEventProcess(message);
                    result = subscribeEventProcess(message);
                }
                }
                break;
                break;
            case WeiXinMessageUtils.EVENT_TYPE_UNSUBSCRIBE: // 取消订阅事件
                 result = unsubscribeEventProcess(message);
                break;
            case WeiXinMessageUtils.EVENT_TYPE_CLICK: //菜单点击
            case WeiXinMessageUtils.EVENT_TYPE_CLICK: //菜单点击
                result = this.clickProcess(message);
                result = this.clickProcess(message);
            default:
            default:
@ -342,6 +349,25 @@ public class WeiXinEventProcess {
        return result;
        return result;
    }
    }
    
    /**
     * 取消关注事件
     * @param message
     * @return
     * @throws Exception
     */
    private String unsubscribeEventProcess(Map<String, String> message)throws Exception{
        String result = "";
    
        //居民openid
        String patient_openid = message.get("FromUserName");
        
        //如果居民取消关注,则清空该openid相关联的所有账号的Openid
        if(StringUtils.isNotBlank(patient_openid)){
            patientService.clearOpenidByOpenid(patient_openid);
        }
        return result;
    }
    /**
    /**

+ 1 - 1
patient-co/patient-co-wlyy/src/main/resources/application-devtest.yml

@ -115,7 +115,7 @@ images:
sign:
sign:
  #check_upload: http://172.19.103.88:8011/wlyy_service
  #check_upload: http://172.19.103.88:8011/wlyy_service
  check_upload: localhost:8070/wlyy_service
  check_upload: http://localhost:8070/
express:
express:

+ 1 - 1
patient-co/patient-co-wlyy/src/main/resources/application-prod.yml

@ -34,7 +34,7 @@ im:
#专病配置
#专病配置
specialist:
specialist:
  url: http://127.0.0.1:10051/svr-wlyy-specialist/
  url: http://192.168.120.167:8661/svr-wlyy-specialist/
#物联网配置
#物联网配置
iot:
iot:
  url: http://192.168.131.24:8088/svr-iot/
  url: http://192.168.131.24:8088/svr-iot/