Forráskód Böngészése

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

trick9191 7 éve
szülő
commit
591613eb9c
19 módosított fájl, 163 hozzáadás és 49 törlés
  1. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java
  2. 9 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/DeviceDetailService.java
  3. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthGuidanceService.java
  4. 29 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java
  5. 40 10
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/CreditLogService.java
  6. 26 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/TaskService.java
  7. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java
  8. 3 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/sign/SignWebService.java
  9. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorTeamGuidanceService.java
  10. 4 7
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/device/DoctorDeviceController.java
  11. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/bank/ActivityController.java
  12. 10 11
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/imm/DoctorImmController.java
  13. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PatientInfoController.java
  14. 4 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorTeamGuidanceController.java
  15. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/family/FamilyMemberController.java
  16. 3 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/bank/CreditsLogController.java
  17. 0 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/bank/TaskController.java
  18. 25 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/health/bank/AccountController.java
  19. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/util/WeiXinOpenIdUtils.java

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java

@ -49,7 +49,7 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query(" from Message a where a.read = 1 and over ='1' and a.sender = ?1 and a.receiver=?2 ")
    List<Message> findByPatientRenew(String patient, String doctor);
    @Query("select a from Message a where a.receiver = ?1 and a.sender=?2 and a.tzType=?3 order by a.createTime desc")
    @Query("select a from Message a where a.receiver = ?1 and a.sender=?2 and a.tzType=?3 and a.del=1 and a.over=1 order by a.createTime desc")
    List<Message> getHealthIndexMessageByPatient(String doctor, String patient, String type, Pageable pageRequest);
    //查询医生下的签约居民未读体征异常消息

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

@ -59,6 +59,7 @@ public class DeviceDetailService extends BaseService {
	@Transactional
	public void updateAfterBinding(PatientDevice patientDevice, Date grantTime,boolean isFirst)throws Exception{
		DeviceDetail deviceDetail = deviceDetailDao.findBySn(patientDevice.getDeviceSn());
		int bind = deviceDetail.getIsBinding();
		SignFamily signFamily = signFamilyDao.findByIdcard(patientDevice.getUserIdcard());
		/*List<SignFamily> signFamilyList = signFamilyDao.findSSandJTByIdcard(patientDevice.getUserIdcard());*/
		long adminTeam=0L;
@ -95,8 +96,14 @@ public class DeviceDetailService extends BaseService {
		}else {
			List<PatientDevice> patientDeviceList = patientDeviceDao.findByDeviceSn(patientDevice.getDeviceSn());
			int patientDeviceSize = patientDeviceList.size();
			String 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()});
			String updateSql = "";
			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()});
			}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=?";
				jdbcTemplate.update(updateSql,new Object[]{isFirstBind,patientDeviceSize,patientDevice.getDeviceSn()});
			}
			//deviceDetailDao.updateAfterBinding(String.valueOf(adminTeam),hospital,isFirstBind,patientDevice.getDeviceSn(),patientDeviceSize);
		}
	}

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthGuidanceService.java

@ -174,11 +174,11 @@ public class PatientHealthGuidanceService extends BaseService {
				}
			}
		}
		if(StringUtils.isNotEmpty(tzCode)){
		if(StringUtils.isNotEmpty(tzCode)&&!"undefined".equals(tzCode)){
			String sql = " select * from device.wlyy_patient_health_index where id in ("+tzCode+")";
			List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
			Date currentTime = new Date();
			long h24 = 60*60*24;
			long h24 = 60*60*60*24;
			for(Map<String, Object> one :list){
				if(one.get("manage_result")!=null&&((Integer)one.get("manage_result")==1||(Integer)one.get("manage_result")==2))continue;
				String tempSql="";

+ 29 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthIndexService.java

@ -284,6 +284,17 @@ public class PatientHealthIndexService extends BaseService {
        }
        return true;
    }
    /**
     * 判断当前指标偏高或偏低
     */
    private int checkHealthIndexDetail(Double current, Double max, Double min) {
        if (current > max ) {
            return 1;
        }else if(current < min || current < 0){
            return 2;
        }
        return 0;
    }
    /**
     * 推送信息
@ -540,13 +551,23 @@ public class PatientHealthIndexService extends BaseService {
            // 餐后
            if (index % 2 == 0) {
                if (!checkHealthIndex(NumberUtils.toDouble(value1), maxValueAfter, minValueAfter)) {
                    msgContent += patient.getName() + "血糖异常(" + value1 + "mmol/L)";
//                    msgContent += patient.getName() + "血糖异常(" + value1 + "mmol/L)";
                    if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueAfter ,minValueAfter)==1){
                        msgContent = "<a>"+patient.getName()+"</a><span style=\"color: #FF4C4C;\">血糖偏高</span>";
                    }else if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueAfter ,minValueAfter)==2){
                        msgContent = "<a>"+patient.getName()+"</a><span style=\"color: #FF4C4C;\">血糖偏低</span>";
                    }
                    //体征异常,更新体征数据状态
                    updateStatus(data);
                }
            } else { //餐前
                if (!checkHealthIndex(NumberUtils.toDouble(value1), maxValueBefore, minValueBefore)) {
                    msgContent += patient.getName() + "血糖异常(" + value1 + "mmol/L)";
//                    msgContent += patient.getName() + "血糖异常(" + value1 + "mmol/L)";
                    if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueAfter ,minValueAfter)==1){
                        msgContent = "<a>"+patient.getName()+"</a><span style=\"color: #FF4C4C;\">血糖偏高</span>";
                    }else if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueAfter ,minValueAfter)==2){
                        msgContent = "<a>"+patient.getName()+"</a><span style=\"color: #FF4C4C;\">血糖偏低</span>";
                    }
                    updateStatus(data);
                }
            }
@ -577,7 +598,12 @@ public class PatientHealthIndexService extends BaseService {
            }
            // 收缩压/舒张压校验
            if (!checkHealthIndex(NumberUtils.toDouble(value1), maxValueSSY, minValueSSY) || !checkHealthIndex(NumberUtils.toDouble(value2), maxValueSZY, minValueSZY)) {
                msgContent = patient.getName() + "血压异常(舒张压 " + value2 + "mmHg、收缩压 " + value1 + "mmHg)";
//                msgContent = patient.getName() + "血压异常(舒张压 " + value2 + "mmHg、收缩压 " + value1 + "mmHg)";
                if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueSSY, minValueSSY)==1||checkHealthIndexDetail(NumberUtils.toDouble(value2), maxValueSZY, minValueSZY)==1){
                    msgContent = "<a>"+patient.getName()+"</a><span style=\"color: #FF4C4C;\">血压偏高</span>";
                }else if(checkHealthIndexDetail(NumberUtils.toDouble(value1), maxValueSSY, minValueSSY)==2||checkHealthIndexDetail(NumberUtils.toDouble(value2), maxValueSZY, minValueSZY)==2){
                    msgContent = "<a>"+patient.getName()+"</a><span style=\"color: #FF4C4C;\">血压偏低</span>";
                }
                updateStatus(data);
            }
        }

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

@ -4,10 +4,12 @@ package com.yihu.wlyy.service.app.health.bank;/**
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.device.PatientDevice;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.patient.SignFamily;
import com.yihu.wlyy.repository.dict.SystemDictDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.patient.PatientDeviceDao;
import com.yihu.wlyy.repository.patient.SignFamilyDao;
import com.yihu.wlyy.service.app.device.PatientDeviceService;
import com.yihu.wlyy.util.HttpClientUtil;
@ -52,6 +54,8 @@ public class CreditLogService {
    @Autowired
    private SystemDictDao systemDictDao;
    @Autowired
    private PatientDeviceDao patientDeviceDao;
    @Autowired
    private SignFamilyDao signFamilyDao;
@ -87,7 +91,7 @@ public class CreditLogService {
        if (name == null || name == ""){
            sql  = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND ( doctor = '" +doctorId + "' OR doctor_health = '" + doctorId +"')";
        } else if (name != null) {
            sql  = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND ( doctor = '" +doctorId + "' OR doctor_health = '" + doctorId +"') AND name = '"+name+"'";
            sql  = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND ( doctor = '" +doctorId + "' OR doctor_health = '" + doctorId +"') AND name LIKE '%"+name+"%'";
        }
        List<SignFamily> signFamilyList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SignFamily.class));
        List<String>  patientIds = new ArrayList<>();
@ -255,7 +259,7 @@ public class CreditLogService {
     * @return
     */
    public JSONObject selectByAccount(JSONObject object,Integer page,Integer size){
        String signSql = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND patient = '"+object.getString("patientId") +"'";
        String signSql = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND patient = '"+object.getString("patientId") +"' AND status = 1";
        List<SignFamily> signFamilyList1 = jdbcTemplate.query(signSql,new BeanPropertyRowMapper(SignFamily.class));
        String sql = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND ( doctor = '" +signFamilyList1.get(0).getDoctor() + "' OR doctor_health = '" + signFamilyList1.get(0).getDoctor() +"')";
        List<SignFamily> signFamilyList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SignFamily.class));
@ -299,11 +303,12 @@ public class CreditLogService {
     * @param size
     * @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 url =getBaseUrl() + "selectByActivityRanking1";
        Map<String,String> params = new HashMap<>();
        params.put("activityId",activityId);
        params.put("patientId",patientId);
        params.put("page",page.toString());
        params.put("size",size.toString());
        JSONObject object1 = null;
@ -313,8 +318,8 @@ public class CreditLogService {
            JSONArray array = object1.getJSONArray("detailModelList");
            for (int i = 0;array != null && i<array.size();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);
            }
        }catch (Exception e){
@ -403,14 +408,14 @@ public class CreditLogService {
        if (name == null || name ==""){
            sql  = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND ( doctor = '" +doctorId + "' OR doctor_health = '" + doctorId +"')";
        } else if (name != null) {
            sql  = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND ( doctor = '" +doctorId + "' OR doctor_health = '" + doctorId +"') AND name = '"+name+"'";
            sql  = "SELECT * FROM wlyy_sign_family WHERE status = 1 AND ( doctor = '" +doctorId + "' OR doctor_health = '" + doctorId +"') AND name LIKE '%"+name+"%'";
        }
        List<SignFamily> signFamilyList = jdbcTemplate.query(sql,new BeanPropertyRowMapper(SignFamily.class));
        List<String>  patientOpenIds = new ArrayList<>();
        if (signFamilyList != null && signFamilyList.size() != 0){
            for (SignFamily signFamily:signFamilyList){
                patientOpenIds.add(signFamily.getOpenid());
                patientOpenIds.add(signFamily.getPatient());
            }
        }
        JSONObject object = new JSONObject();
@ -458,13 +463,38 @@ public class CreditLogService {
                patientIds.add(signFamily.getPatient());
            }
        }
        int deviceType = object.getInteger("deviceType");//设备类型 1血糖仪,2血压仪
        int bindStatus = object.getInteger("bindStatus");//绑定状态  0:绑定,1:未绑定
        List<String> ids = new ArrayList<>();
        for (int i=0;i<patientIds.size();i++){
            if (bindStatus == 0){
                String sql1 = "select * from wlyy_patient_device where user = '"+patientIds.get(i)+"' AND category_code = "+deviceType+" AND del = " + bindStatus;
                List<PatientDevice> patientDevices = jdbcTemplate.query(sql1,new BeanPropertyRowMapper(PatientDevice.class));
                if (patientDevices != null && patientDevices.size() != 0){
                    ids.add(patientDevices.get(0).getUser());
                }
            }else if (bindStatus == 1){
                String sql1 = "select * from wlyy_patient_device where user = '"+patientIds.get(i)+"' AND category_code = "+deviceType+" AND del = " + bindStatus;
                List<PatientDevice> patientDevices = jdbcTemplate.query(sql1,new BeanPropertyRowMapper(PatientDevice.class));
                if (patientDevices == null || patientDevices.size() ==0){
                    ids.add(patientIds.get(i));
                }
            }
        }
        JSONArray patientList = new JSONArray();
        for (int i =0 ;i<ids.size();i++){
            Patient patient = patientDao.findByCode(ids.get(i));
            JSONObject jsonObject = (JSONObject) JSONObject.toJSON(patient);
            patientList.add(jsonObject);
        }
        JSONObject object1 = new JSONObject();
        JSONArray array = object.getJSONArray("deviceTypes");
        object1.put("patientIds",patientIds.toArray());
        object1.put("patients",patientList);
        object1.put("bindStatus",object.getInteger("bindStatus"));
        object1.put("deviceTypes",array);
        object1.put("deviceType",deviceType);
        object1.put("ruleId",object.get("ruleId"));
        object1.put("page",page);
        object1.put("size",size);
        String response = null;
        String url =getBaseUrl() + "findAccounByCondition";
        JSONObject object2 = null;

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

@ -125,7 +125,7 @@ public class TaskService {
    public JSONObject attendTask(JSONObject object) throws Exception {
        String response = null;
        Patient patient = patientDao.findByCode(object.getString("patientId"));
        String unionId = "1";
        String unionId = object.getString("unionId");
        Patient patient1 = patientDao.findByUnionid(unionId);
        if (patient1 != null){
            throw new Exception("该居民已报过名!");
@ -134,6 +134,7 @@ public class TaskService {
        patientDao.save(patient);
        object.put("unionId",unionId);
        object.put("patientIdcard",patient.getIdcard());
        object.put("patientOpenid",patient.getOpenid());
        String url =getBaseUrl() + "attendTask";
        Map<String,String> params = new HashMap<>();
        params.put("taskPatientDetail",object.toJSONString());
@ -177,4 +178,28 @@ public class TaskService {
        }
        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);
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/message/MessageService.java

@ -365,7 +365,7 @@ public class MessageService extends BaseService {
     */
    public Map<String,List<Map<String, Object>>> getHealthIndexMessage(String doctor) throws Exception {
        String sql = "select a.sender,a.tz_type,count(1) count,max(date_format(a.create_time,'%Y-%m-%d %H:%i:%s')) last_time,a.has_read from wlyy_Message a where a.receiver='" + doctor + "' and a.type='2' group by a.sender,a.tz_type,a.has_read order by last_time desc";
        String sql = "select a.sender,a.tz_type,count(1) count,max(date_format(a.create_time,'%Y-%m-%d %H:%i:%s')) last_time,a.has_read from wlyy_Message a where a.receiver='" + doctor + "' and a.type='2' and a.over='1' group by a.sender,a.tz_type,a.has_read order by last_time desc";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        Map<String,Map<String, Object>> map = new HashMap<>();

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

@ -778,6 +778,9 @@ public class SignWebService extends BaseService {
        for (PatientDevice patientDevice: patientDevices) {
            JSONObject jsonObject = new JSONObject();
            SignFamily signFamily = signFamilyDao.findByPatient(patient);//签约社区
            if(signFamily == null || signFamily.getCode() == null){
                continue;
            }
            if(StringUtils.isNotBlank(patientDevice.getDoctor())){
                Doctor deviceDoctor = doctorService.findDoctorByCode(patientDevice.getDoctor());
                jsonObject.put("doctor",patientDevice.getDoctor());//操作医生代码

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorTeamGuidanceService.java

@ -470,7 +470,7 @@ public class DoctorTeamGuidanceService extends BaseService {
     * @param images
     * @throws Exception
     */
    public void sendTeamGuidance(String accessToken, String dc, String patient, String content, String guidanceCode, String images, int teamId) throws Exception {
    public void sendTeamGuidance(String accessToken, String dc, String patient, String content, String guidanceCode, String images, int teamId,String tzCode) throws Exception {
        String image = "";
        if (StringUtils.isNotEmpty(images)) {
            image = validateImages(images);
@ -484,7 +484,7 @@ public class DoctorTeamGuidanceService extends BaseService {
        guidance.setImages(image);
        // 保存
        if (patientHealthGuidanceService.add(guidance, accessToken,null) != null) {
        if (patientHealthGuidanceService.add(guidance, accessToken,tzCode) != null) {
            String sendImgs = "";
            if (StringUtils.isNotBlank(image)) {
                sendImgs = image;

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

@ -459,18 +459,15 @@ public class DoctorDeviceController extends BaseController {
	@RequestMapping(value = "/getDevicesList",method = RequestMethod.GET)
	@ResponseBody
	@ApiOperation(value = "医生端-设备管理中设备列表",notes = "设备列表")
	public String getDevicesList(@ApiParam(value = "未测量天数(1今日为测量 2七天未测量 3本月未测量 4超过一个月未测量)", name = "noGaugeDay") @RequestParam(value = "noGaugeDay",required = true)String noGaugeDay,
								 @ApiParam(value = "是否绑定(1绑定 2解绑)", name = "isBinding") @RequestParam(value = "isBinding",required = true)String isBinding,
								 @ApiParam(value = "设备类型(1血糖仪 2血压计)", name = "categoryCode") @RequestParam(value = "categoryCode",required = true)String categoryCode,
								 @ApiParam(value = "今日是否发送消息(1未发送 2已发送)", name = "isSend") @RequestParam(value = "isSend",required = true)String isSend,
	public String getDevicesList(@ApiParam(value = "未测量天数(1今日为测量 2七天未测量 3本月未测量 4超过一个月未测量)", name = "noGaugeDay") @RequestParam(value = "noGaugeDay",required = false)String noGaugeDay,
								 @ApiParam(value = "是否绑定(1绑定 2解绑)", name = "isBinding") @RequestParam(value = "isBinding",required = false)String isBinding,
								 @ApiParam(value = "设备类型(1血糖仪 2血压计)", name = "categoryCode") @RequestParam(value = "categoryCode",required = false)String categoryCode,
								 @ApiParam(value = "今日是否发送消息(1未发送 2已发送)", name = "isSend") @RequestParam(value = "isSend",required = false)String isSend,
								 @ApiParam(name="page",value="第几页",defaultValue = "1") @RequestParam(value="page",required = true) String page,
								 @ApiParam(name="pageSize",value="",defaultValue = "10") @RequestParam(value="pageSize",required = true) String pageSize) {
		if (StringUtils.isBlank(pageSize)) {
			pageSize = "10";
		}
		if (page.equals("0")) {
			page = "1";
		}
		try {
			return  write(200,"查找成功!","data",patientDeviceLogService.getDevicesList(getUID(),noGaugeDay,isBinding,categoryCode,isSend,Integer.valueOf(page),Integer.valueOf(pageSize)));
		} catch (Exception e) {

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

@ -226,7 +226,7 @@ public class ActivityController extends BaseController {
     * @return
     */
    @RequestMapping(value = "/findAccount",method = RequestMethod.POST)
    @ApiOperation("银行账户信息")
    @ApiOperation("用户账户信息")
    public String selectByAccount(@ApiParam(name = "account",value = "任务JSON")
                                  @RequestParam(name = "account") String account,
                                  @ApiParam(name = "page", value = "第几页,从1开始")

+ 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) {
				for (Map<String, Object> map : immrs) {
					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);
				}
			}
@ -129,8 +128,8 @@ public class DoctorImmController extends BaseController {
	
	@RequestMapping(value = "/alertImmVacclinByPatient", method = RequestMethod.POST)
	@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 {
			// TODO: 2018/6/21
			return write(200, "请求成功");
@ -143,7 +142,7 @@ public class DoctorImmController extends BaseController {
	@RequestMapping(value = "/getPatientImmVacclin", method = RequestMethod.GET)
	@ApiOperation(value = "根据儿童免疫条码获取待接种疫苗")
	public String getPatientImmVacclin(@ApiParam(name = "barcode", value = "儿童免疫编码", defaultValue = "")
	                                       @RequestParam(value = "儿童免疫编码", required = true) String barcode){
	                                       @RequestParam(value = "barcode", required = true) String barcode){
		try {
			ChildImmuneVaccin childImmuneVaccin = childFamilyImmuneService.getChildImmuneVaccinByBarcode(barcode);
			return write(200, "请求成功","data",childImmuneVaccin);

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/patient/PatientInfoController.java

@ -523,7 +523,7 @@ public class PatientInfoController extends BaseController {
     * @param deviceSn
     * @param page
     * @param pageSize
     * @return
     * @return ..
     */
    /*@RequestMapping(value = "/getPatientSignByNameOrIdCard",method = RequestMethod.GET)
    @ResponseBody

+ 4 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorTeamGuidanceController.java

@ -258,7 +258,9 @@ public class DoctorTeamGuidanceController extends WeixinBaseController {
            @ApiParam(value = "团队模板code")
            @RequestParam String guidanceCode,
            @ApiParam(value = "团队模板图片")
            @RequestParam(required = false) String images) {
            @RequestParam(required = false) String images,
            @ApiParam(value = "异常指标数据的ids,多条用逗号分割")
            @RequestParam(required = false) String tzCode) {
        try {
            String accessToken = getAccessToken();
            String doctor = getUID();
@ -266,7 +268,7 @@ public class DoctorTeamGuidanceController extends WeixinBaseController {
            for (Object team : teams) {
                JSONObject teamJson = new JSONObject(team.toString());
                int teamCode = teamJson.getInt("teamId");
                doctorTeamGuidanceService.sendTeamGuidance(accessToken, doctor, patient, content, guidanceCode, images,teamCode);
                doctorTeamGuidanceService.sendTeamGuidance(accessToken, doctor, patient, content, guidanceCode, images,teamCode,tzCode);
            }
            return write(200, "发送成功!");
        } catch (Exception e) {

+ 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)
    @ApiOperation(value = "根据儿童免疫条码获取待接种疫苗")
    public String getPatientImmVacclin(@ApiParam(name = "barcode", value = "儿童免疫编码", defaultValue = "")
                                       @RequestParam(value = "儿童免疫编码", required = true) String barcode){
                                       @RequestParam(value = "barcode", required = true) String barcode){
        try {
            ChildImmuneVaccin childImmuneVaccin = childFamilyImmuneService.getChildImmuneVaccinByBarcode(barcode);
            return write(200, "请求成功","data",childImmuneVaccin);

+ 3 - 1
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("获取活动所有排名")
    public String selectByActivityRanking1(@ApiParam(name = "activityId",value = "活动id")
                                  @RequestParam(name = "activityId") String activityId,
                                   @ApiParam(name = "patientId",value = "居民id")
                                   @RequestParam(value = "patientId",required = true)String patientId,
                                  @ApiParam(name = "page", value = "第几页,从1开始")
                                  @RequestParam(value = "page", defaultValue = "1",required = false)Integer page,
                                  @ApiParam(name = "size",defaultValue = "10",value = ",每页分页大小")
                                  @RequestParam(value = "size", required = false)Integer size){
        try {
            return write(200,"查询成功","data",service.selectByActivityRanking1(activityId,page,size));
            return write(200,"查询成功","data",service.selectByActivityRanking1(activityId,patientId,page,size));
        }catch (Exception e){
            error(e);
            return error(-1,e.getMessage());

+ 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){
        try {
            JSONObject object = JSONObject.parseObject(taskPatientDetail);
            object.put("patientOpenid",getOpenid());
            return write(200,"报名成功","data",service.attendTask(object));
        }catch (Exception e){
            error(e);

+ 25 - 1
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.yihu.wlyy.service.app.health.bank.CreditLogService;
import com.yihu.wlyy.service.app.health.bank.TaskService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
@ -31,6 +32,8 @@ public class AccountController extends BaseController {
    @Autowired
    private CreditLogService service;
    @Autowired
    private TaskService taskService;
@ -66,13 +69,15 @@ public class AccountController extends BaseController {
    @ApiOperation("获取活动所有排名")
    public String selectByActivityRanking1(@ApiParam(name = "activityId",value = "活动id")
                                  @RequestParam(name = "activityId") String activityId,
                                   @ApiParam(name = "patientId",value = "居民id")
                                   @RequestParam(value = "patientId",required = true)String patientId,
                                  @ApiParam(name = "page", value = "第几页,从1开始")
                                  @RequestParam(value = "page", defaultValue = "1",required = false)Integer page,
                                  @ApiParam(name = "size",defaultValue = "10",value = ",每页分页大小")
                                  @RequestParam(value = "size", required = false)Integer size){
        try {
            return write(200,"查询成功","data",service.selectByActivityRanking1(activityId,page,size));
            return write(200,"查询成功","data",service.selectByActivityRanking1(activityId,patientId,page,size));
        }catch (Exception e){
            error(e);
            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());
        }
    }
}

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/wechat/util/WeiXinOpenIdUtils.java

@ -116,7 +116,7 @@ public class WeiXinOpenIdUtils {
                String memberCode = (String) member.get("family_member");
                if (StringUtils.isNotBlank(memberCode)) {
                    Patient p = patientDao.findByCode(memberCode);
                    if (StringUtils.isNotBlank(p.getOpenid())&&!p.getOpenid().equals(openid)) {
                    if (p!=null&&StringUtils.isNotBlank(p.getOpenid())&&!p.getOpenid().equals(openid)) {
                        if(!map.containsKey(p.getOpenid())){
                            map.put(p.getOpenid(),p.getOpenid());
                            JSONObject json = new JSONObject();