瀏覽代碼

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

humingfen 7 年之前
父節點
當前提交
b7a3018946
共有 14 個文件被更改,包括 185 次插入25 次删除
  1. 3 0
      patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/common/dao/SignFamilyDao.java
  2. 6 3
      patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/service/DeviceService.java
  3. 1 1
      patient-co/patient-co-wlyy/pom.xml
  4. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/BaseInterceptor.java
  5. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/message/MessageDao.java
  6. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/device/PatientDeviceLogService.java
  7. 2 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/PatientHealthGuidanceService.java
  8. 85 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/CreditLogService.java
  9. 16 5
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/bank/TaskService.java
  10. 4 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/data/DataHandingService.java
  11. 24 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthController.java
  12. 3 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java
  13. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/health/bank/TaskController.java
  14. 36 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/health/bank/AccountController.java

+ 3 - 0
patient-co-service/wlyy_device/src/main/java/com/yihu/hos/device/common/dao/SignFamilyDao.java

@ -37,4 +37,7 @@ public interface SignFamilyDao extends PagingAndSortingRepository<SignFamily, Lo
	@Query("select a from SignFamily a where a.patient = ?1 and a.type =1 and a.status = 1")
	SignFamily findBySanshiPatientYes(String id);
	@Query("select a from SignFamily a where a.patient = ?1 and a.type =2 and a.status > 0")
	SignFamily findByPatient(String code);
}

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

@ -503,8 +503,12 @@ public class DeviceService extends BaseService{
            } else {
                //患者信息
                String patientCode = result.getUser();
                SignFamily signFamily = signFamilyDao.findByPatient(patientCode);
                Patient patient = patientDao.findByCode(patientCode);
                String hospital = "";
                if (signFamily!=null){
                    hospital = signFamily.getHospital();
                }
                String flagStr = "";
                if (deviceType==1){
                    flagStr="BP_MEASURE";
@ -514,7 +518,7 @@ public class DeviceService extends BaseService{
                try {
                    //增加积分
                    if (dataUoloadCount == 0 && "350205".equals(patient.getTown())){
                    if (dataUoloadCount == 0 && "350205".equals(hospital.substring(0,6))){
                        String sql = "select count(*) num from device.wlyy_devices where device_code = '"+deviceSn+"'";
                        Map<String,Object> deviceCountMap = jdbcTemplate.queryForMap(sql);
                        if (Integer.valueOf(String.valueOf(deviceCountMap.get("num")))>0){
@ -524,7 +528,6 @@ public class DeviceService extends BaseService{
                            params.add(new BasicNameValuePair("creditsDetail", "{\"tradeType\":\"ACTIVITY_TASK\",\"flag\":\""+flagStr+"\",\"tradeDirection\":1,\"status\":1,\"patientId\":\""+result.getUser()+"\",\"hospital\":\"350205\"}"));
                            String response = HttpClientUtil.post(url, params, "UTF-8");
                            System.out.println(response);
                            com.alibaba.fastjson.JSONObject jsonObject = com.alibaba.fastjson.JSONObject.parseObject(response);
                            String status = jsonObject.getString("status");
                            if (!"200".equals(status)){

+ 1 - 1
patient-co/patient-co-wlyy/pom.xml

@ -567,7 +567,7 @@
                    <target>1.8</target>
                    <compilerArguments>
                        <verbose/>
                        <bootclasspath>${java.home}/lib/rt.jar:${java.home}/lib/jce.jar</bootclasspath>
                        <bootclasspath>${java.home}/lib/rt.jar;${java.home}/lib/jce.jar</bootclasspath>
                    </compilerArguments>
                </configuration>
                <version>3.1</version>

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/interceptors/BaseInterceptor.java

@ -26,7 +26,7 @@ abstract public class BaseInterceptor implements HandlerInterceptor {
			if (StringUtils.isEmpty(userAgent)) {
				userAgent = request.getHeader("User-Agent");
			}
			logger.info("userAgent:" + userAgent);
			logger.debug("userAgent:" + userAgent);
			return new JSONObject(userAgent);
		} catch (Exception e) {
			return null;

+ 2 - 2
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 and a.del=1 and a.over=1 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.over=1 order by a.createTime desc")
    List<Message> getHealthIndexMessageByPatient(String doctor, String patient, String type, Pageable pageRequest);
    //查询医生下的签约居民未读体征异常消息
@ -66,7 +66,7 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("select a from Message a where a.receiver = ?1 and a.prescriptionStatus=?2 and a.type in (6,7) order by a.createTime desc")
    List<Message> getSysTemMessageByPrescription(String doctor, String prescriptionStatus);
    @Query("select a from Message a where a.receiver = ?1 and a.type not in (1,2,6,7,12,101,14,15) and (a.del = '1' or a.del is null) ")
    @Query("select a from Message a where a.receiver = ?1 and a.type not in (1,2,6,7,12,101,14,15,301) and (a.del = '1' or a.del is null) ")
    List<Message> getSystemMessage(String doctor, Pageable pageRequest);
    @Query("select a from Message a where a.receiver = ?1 and a.type=?2 and a.prescriptionStatus='0' ")

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

@ -74,7 +74,7 @@ public class PatientDeviceLogService extends BaseService {
                "  SELECT sf.name, pd.* FROM wlyy_patient_device_log pd" +
                "  LEFT JOIN wlyy_sign_family sf ON pd.patient = sf.patient" +
                "  WHERE" +
                "   pd.is_del = 1 and (sf.doctor= '" +doctor+"' or sf.doctor_health = '"+doctor+"')"+
                "  pd.is_del = 1 and (sf.doctor= '" +doctor+"' or sf.doctor_health = '"+doctor+"') and sf.`status`>0"+
                "  ORDER BY" +
                "  create_time DESC) a" +
                " GROUP BY a.device_sn) b" +

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

@ -177,13 +177,12 @@ public class PatientHealthGuidanceService extends BaseService {
		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*60*24;
			long h24 = 60*60*60*24+10;
			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="";
				Date temp =(Date)one.get("czrq");
				if(currentTime.getTime()-temp.getTime()<=h24){//有效干预
				if(new Date().getTime()-temp.getTime()<=h24){//有效干预
					tempSql = "update device.wlyy_patient_health_index set manage_result=1 where id="+one.get("id");
				}else{//无效干预
					tempSql = "update device.wlyy_patient_health_index set manage_result=2 where id="+one.get("id");

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

@ -7,12 +7,18 @@ 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.entity.wechat.WechatTemplateConfig;
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.repository.wechat.WechatTemplateConfigDao;
import com.yihu.wlyy.service.app.device.PatientDeviceService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpClientUtil;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -49,8 +55,6 @@ public class CreditLogService {
    private StringRedisTemplate redisTemplate;
    @Autowired
    private PatientDeviceService patientDeviceService;
    @Autowired
    private PatientDao patientDao;
    @Autowired
    private SystemDictDao systemDictDao;
@ -59,6 +63,17 @@ public class CreditLogService {
    @Autowired
    private SignFamilyDao signFamilyDao;
    
    @Autowired
    private PatientService patientService;
    @Autowired
    private WechatTemplateConfigDao templateConfigDao;
    @Autowired
    private PushMsgTask pushMsgTask;
    @Autowired
    private WeiXinAccessTokenUtils weiXinAccessTokenUtils;
    @Autowired
    private PatientDao patientDao;
    /**
@ -132,6 +147,9 @@ public class CreditLogService {
     * @return
     */
    public JSONObject insert(JSONObject object) throws Exception {
    
        JSONObject result = new JSONObject();
        
        String response = null;
        String patientId = object.getString("patientId");
        Patient patient = patientDao.findByCode(patientId);
@ -151,10 +169,73 @@ public class CreditLogService {
            e.printStackTrace();
            logger.error(e.getMessage());
        }
        return JSONObject.parseObject(response);
        
        result = JSONObject.parseObject(response);
        String status = result.getString("status");
        logger.info("健康银行居民新增积分:"+result.toString());
        if ("200".equals(status)){
            List<Map<String,Object>> list = (List<Map<String,Object>>)result.get("detailModelList");
            if (list!=null && list.size()>0){
                //积分
                String integrateresult = String.valueOf(list.get(0).get("integrate"));
                String patientid = String.valueOf(list.get(0).get("patientId"));
                String total = String.valueOf(list.get(0).get("total"));
                
                try {
                    //@TODO 获取积分调用发送微信模板接口
                    Patient people = patientDao.findByCode(patientid);
                    String openId = people.getOpenid();
                    String name = people.getName();
                
                    org.json.JSONObject sendJson = new org.json.JSONObject();
                    String first = "";
                    String remark = "";
                    String urlresult = "";
                
                    WechatTemplateConfig templateConfig = templateConfigDao.findByScene("template_healthbank_credit","jfdztz");
                    first = templateConfig.getFirst();
                    remark = templateConfig.getRemark();
//                    String keyword1 = templateConfig.getKeyword1();
                
                    sendJson.put("keyword1", integrateresult);
                    sendJson.put("keyword2", DateUtil.getStringDate());
                    sendJson.put("keyword3", total);
                    sendJson.put("first", first);
                    sendJson.put("remark", remark);
                    urlresult = templateConfig.getUrl();
                    urlresult = urlresult.replace("key1",(integrateresult==null?"":integrateresult));
                    sendJson.put("url", urlresult);//带参数的模板跳转链接
                    System.out.println(sendJson.toString());
                    pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 23, openId, name, sendJson);
//	                    //发送代理人
//	                    jsonArray = weiXinOpenIdUtils.getAgentOpenId(patient, openId);
//	                    if (jsonArray != null && jsonArray.length() > 0) {
//		                    for (int i = 0; i < jsonArray.length(); i++) {
//			                    org.json.JSONObject j = jsonArray.getJSONObject(i);
//			                    Patient member = (Patient) j.get("member");
//			                    int start = url.indexOf("&toUser=");
//			                    int end = url.indexOf("&", start + 1);
//			                    String touser = url.substring(start, end);
//			                    url = url.replace(touser, "&toUser=" + member.getCode());
//			                    //name患者姓名
//			                    sendJson.put("first", weiXinOpenIdUtils.getTitleMes(people, (int) j.get("relation"), name) + first);
//			                    sendJson.put("url", url);
//			                    pushMsgTask.putWxMsg(weiXinAccessTokenUtils.getAccessToken(), 19, member.getOpenid(), name, sendJson);
//		                    }
//	                    }
                }catch (Exception e){
                    logger.info("健康银行居民新增积分,微信模板消息发送失败:"+e.getMessage());
//	                        e.printStackTrace();
                }
            
            }
        }
        
        return result;
    }
    /**
     * 按条件查询积分
     *
@ -566,7 +647,7 @@ public class CreditLogService {
        object.put("idCard",patient.getIdcard());
        object.put("openId",patient.getOpenid());
        object.put("unionId",patient.getUnionid());
        String url =getBaseUrl() + "addStepIntegrate";
        String url =getBaseUrl()+ "addStepIntegrate";
        Map<String,String> params = new HashMap<>();
        params.put("creditsDetail",object.toJSONString());
        try {

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

@ -84,8 +84,14 @@ public class TaskService {
     */
    public JSONObject selectActivity(JSONObject object,Integer page,Integer size){
        String response = null;
        Patient patient = patientDao.findByCode(object.getString("patientId"));
        String url =getBaseUrl() + "findActivity";
        Map<String,String> params = new HashMap<>();
        if (patient != null){
            object.put("patientIdcard",patient.getIdcard());
            object.put("unionId",patient.getUnionid());
        }
        object.remove("patientId");
        params.put("activity",object.toJSONString());
        params.put("page",page.toString());
        params.put("size",size.toString());
@ -142,7 +148,7 @@ public class TaskService {
        }
        Patient patient = patientDao.findByCode(patientId);
        String unionId = object.getString("unionId");
        if(!StringUtils.isNoneBlank(patient.getUnionid())){
        if(StringUtils.isNoneBlank(patient.getUnionid())){
            throw new Exception("该居民已报名!");
        }else {
            Patient patient1 = patientDao.findByUnionid(unionId);
@ -187,7 +193,7 @@ public class TaskService {
      /*  List<Patient> patientList = new ArrayList<>();*/
        JSONObject object = new JSONObject();
        if (patient != null){
            String sql1 = "select * from wlyy_sign_family a where a.patient = '"+patient.getCode()+"'";
            String sql1 = "select * from wlyy_sign_family a where a.patient = '"+patient.getCode()+"' AND status = 1";
            List<SignFamily> signFamilyList = jdbcTemplate.query(sql1,new BeanPropertyRowMapper(SignFamily.class));
            if (signFamilyList != null&&signFamilyList.size()!=0){
                SignFamily signFamily1 = signFamilyList.get(0);
@ -199,7 +205,7 @@ public class TaskService {
            List<PatientFamilyMember> patientFamilyMemberList = patientFamilyMemberDao.findByPatient(patient.getCode());
            for (PatientFamilyMember patientFamilyMember:patientFamilyMemberList){
                Patient patient1 = patientDao.findByCode(patientFamilyMember.getFamilyMember());
                String sql2 = "select * from wlyy_sign_family a where a.patient = '"+patient1.getCode()+"'";
                String sql2 = "select * from wlyy_sign_family a where a.patient = '"+patient1.getCode()+"' AND status = 1";
                List<SignFamily> signFamilyList2 = jdbcTemplate.query(sql2,new BeanPropertyRowMapper(SignFamily.class));
                if(signFamilyList2 != null&&signFamilyList2.size()!=0){
                    SignFamily signFamily = signFamilyList2.get(0);
@ -248,12 +254,17 @@ public class TaskService {
     */
    public JSONObject getStepNumber(){
        String step = redisTemplate.opsForValue().get(STEP);
        logger.info("redis数据:"+step);
        String step1 = systemDictDao.findByDictNameAndCode("HEALTH_STEP","HEALTH_STEP");
        JSONObject jsonObject = JSONObject.parseObject(step1);
        if (step1 != null && step.equalsIgnoreCase(step1)){
        logger.info("数据库的数据:"+step1);
        if (step != null && step.equalsIgnoreCase(step1)){
            JSONObject jsonObject = JSONObject.parseObject(step);
            logger.info("数据不一致:"+jsonObject.toString());
            return jsonObject;
        }else {
            JSONObject jsonObject = JSONObject.parseObject(step);
            redisTemplate.opsForValue().set(STEP,step1);
            logger.info("数据一致:"+jsonObject.toString());
            return jsonObject;
        }
    }

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

@ -418,11 +418,11 @@ public class DataHandingService {
    }
    public void addPointOldDeviceBind()throws Exception{
        String sql = "SELECT pd.*,p.town FROM wlyy_patient_device pd LEFT JOIN wlyy_patient p ON pd.`user` = p.`code`";
        String sql = "SELECT pd.*,sf.hospital FROM wlyy_patient_device pd LEFT JOIN wlyy_sign_family sf ON pd.`user` = sf.patient where sf.`status`>0";
        List<Map<String,Object>> patientDeviceList = jdbcTemplate.queryForList(sql);
        Map<String,String> map = new HashedMap();
        for (Map<String,Object> patientDeviceMap : patientDeviceList) {
            if (org.apache.commons.lang.StringUtils.equals(String.valueOf(patientDeviceMap.get("town")),"350205")){
            if (org.apache.commons.lang.StringUtils.equals(String.valueOf(patientDeviceMap.get("hospital")).substring(0,6),"350205")){
                String deviceType=null;
                if (!map.containsKey(String.valueOf(patientDeviceMap.get("user")))) {
                    deviceType = map.get(String.valueOf(patientDeviceMap.get("user")));
@ -441,7 +441,7 @@ public class DataHandingService {
            }else if ("2".equals(entry.getValue())){
                flagStr="BP_BIND";
            }
            String creditDetail = "{\"tradeType\":\"HEALTH_TASK\",\"flag\":\""+flagStr+"\",\"tradeDirection\":1,\"status\":1,\"patientId\":\""+entry.getKey()+"\",\"hospital\":\"350205\"}";
            String creditDetail = "{\"tradeType\":\"ACTIVITY_TASK\",\"flag\":\""+flagStr+"\",\"tradeDirection\":1,\"status\":1,\"patientId\":\""+entry.getKey()+"\",\"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");
@ -466,7 +466,7 @@ public class DataHandingService {
            }else if (StringUtils.pathEquals("2",type)){
                flagStr = "BP_MEASURE";
            }
            String creditDetail = "{\"tradeType\":\"HEALTH_TASK\",\"flag\":\""+flagStr+"\",\"tradeDirection\":1,\"status\":1,\"patientId\":\""+user+"\",\"hospital\":\"350205\"}";
            String creditDetail = "{\"tradeType\":\"ACTIVITY_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");

+ 24 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/health/DoctorHealthController.java

@ -18,6 +18,7 @@ import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
@ -36,6 +37,8 @@ public class DoctorHealthController extends BaseController {
	@Autowired
	private PatientService patientService;
	@Autowired
	private JdbcTemplate jdbcTemplate;
	@RequestMapping(value = "recent",method = RequestMethod.GET)
	@ResponseBody
@ -456,6 +459,27 @@ public class DoctorHealthController extends BaseController {
		}
	}
	@RequestMapping(value = "/getHealthDateAll",method = RequestMethod.GET)
	@ResponseBody
	@ApiOperation("医生端--查询所有有数据的日期")
	public String getHealthDateAll(@ApiParam(value = "居民code)", name = "patientCode") @RequestParam(value = "patientCode",required = true)String patientCode,
								   @ApiParam(value = "设备sn码", name = "deviceSn") @RequestParam(value = "deviceSn",required = true)String deviceSn,
								   @ApiParam(value = "时间(month:yyyy-MM)", name = "choseMonth") @RequestParam(value = "choseMonth",required = true)String choseMonth,
								   @ApiParam(value = "健康指标类型(1血糖,2血压,3体重,4腰围)",name = "type")@RequestParam(value = "type",required = true)int type){
		try{
			String sql = "select DISTINCT(DATE_FORMAT(a.record_date,'%Y-%m-%d')) result from device.wlyy_patient_health_index a where a.type="+type+" and a.`user` = '"+patientCode+"' and DATE_FORMAT(a.record_date,'%Y-%m') = '"+choseMonth+"' and a.device_sn = '"+deviceSn+"' and a.del = '1' order by a.record_date,a.id";
			List<Map<String,Object>> reusltList = jdbcTemplate.queryForList(sql);
			List<String> list = new ArrayList<>();
			for (Map<String,Object> map : reusltList){
				list.add(String.valueOf(map.get("result")));
			}
			return write(200, "获取健康指标记录日期成功", "data", list);
		}catch (Exception e){
			return invalidUserException(e, -1, e.getMessage());
		}
	}
	@RequestMapping(value = "/patientHealthIndexByDateAndDeviceSn",method = RequestMethod.GET)
	@ResponseBody
	@ApiOperation("医生端--根据时间和设备sn码查询某个居民的体征记录")

+ 3 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/message/DoctorMessageController.java

@ -225,6 +225,7 @@ public class DoctorMessageController extends BaseController {
    @RequestMapping(value = "getEduArticleMessage", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取文章审核消息")
    @ObserverRequired
    public String getEduArticleMessage(@ApiParam(name = "type", value = "文章审核的时候必传,消息类型,14:提交文章审核,15:审核结果")
                                           @RequestParam(value = "type", required = false) Integer type,
                                        @ApiParam(value = "第几页", defaultValue = "1")
@ -243,6 +244,7 @@ public class DoctorMessageController extends BaseController {
    @RequestMapping(value = "getHealthIndexMessage", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取超标指标消息--根据患者分组")
    @ObserverRequired
    public String getHealthIndexMessage() throws Exception {
        try {
            Map<String,List<Map<String, Object>>> list = messageService.getHealthIndexMessage(getUID());     //"D20161008003"
@ -256,6 +258,7 @@ public class DoctorMessageController extends BaseController {
    @RequestMapping(value = "getHealthIndexMessageByPatient", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取患者超标指标消息")
    @ObserverRequired
    public String getHealthIndexMessageByPatient(@ApiParam(name = "patient", value = "患者代码", defaultValue = "P20161008001")
                                                 @RequestParam(value = "patient", required = true) String patient,
                                                 @ApiParam(name = "type", value = "健康指标类型1血糖,2血压,3体重", defaultValue = "1")

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

@ -44,7 +44,7 @@ public class TaskController extends BaseController{
                                    @RequestParam(value = "size", required = false)Integer size){
        try {
            JSONObject object = JSONObject.parseObject(task);
            object.put("openId",getOpenid());
            object.put("patientId",getUID());
            return write(200,"查询成功","data",service.selectActivity(object,page,size));
        }catch (Exception e){
            error(e);

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

@ -4,9 +4,16 @@
package com.yihu.wlyy.web.third.health.bank;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.entity.wechat.WechatTemplateConfig;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.repository.wechat.WechatTemplateConfigDao;
import com.yihu.wlyy.service.app.health.bank.CreditLogService;
import com.yihu.wlyy.service.app.health.bank.TaskService;
import com.yihu.wlyy.task.PushMsgTask;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.wechat.util.WeiXinAccessTokenUtils;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
@ -19,6 +26,9 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.util.List;
import java.util.Map;
/**
 * @author wangzhinan
 * @create 2018-05-07 8:50
@ -34,6 +44,14 @@ public class AccountController extends BaseController {
    private CreditLogService service;
    @Autowired
    private TaskService taskService;
    @Autowired
    private WechatTemplateConfigDao templateConfigDao;
    @Autowired
    private PushMsgTask pushMsgTask;
    @Autowired
    private WeiXinAccessTokenUtils weiXinAccessTokenUtils;
    @Autowired
    private PatientDao patientDao;
@ -141,4 +159,22 @@ public class AccountController extends BaseController {
            return error(-1,e.getMessage());
        }
    }
    @RequestMapping(value = "/insertCredits",method = RequestMethod.POST)
    @ApiOperation("添加积分")
    public String insert(@ApiParam(name = "creditsDetail",value = "居民id集合")
                         @RequestParam(name = "creditsDetail") String creditsDetail){
        try {
            JSONObject object = JSONObject.parseObject(creditsDetail);
            JSONObject result = service.insert(object);
            String status = result.getString("status");
            logger.info("健康银行居民新增积分:"+result.toString());
            return write(200,"添加成功","data",result);
        }catch (Exception e){
            error(e);
            return error(-1,e.getMessage());
        }
    }
}