|
@ -18,6 +18,8 @@ import com.yihu.wlyy.service.app.message.MessageService;
|
|
|
import com.yihu.wlyy.util.DateUtil;
|
|
|
import com.yihu.wlyy.web.BaseController;
|
|
|
|
|
|
import java.util.List;
|
|
|
|
|
|
@Controller
|
|
|
@RequestMapping(value = "/doctor/message", produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
|
|
|
@Api(description = "医生端-消息")
|
|
@ -201,5 +203,47 @@ public class DoctorMessageController extends BaseController {
|
|
|
return error(-1, "获取消息失败!");
|
|
|
}
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
* @param type 消息类型 1.是家庭签约信息 2.体征消息 3分配健管师
|
|
|
* @param id 消息id
|
|
|
* @param pagesize 每頁顯示條數
|
|
|
* @return
|
|
|
*/
|
|
|
@RequestMapping(value = "findMessage")
|
|
|
@ResponseBody
|
|
|
public String findMessage(String type,
|
|
|
long id,
|
|
|
int pagesize) {
|
|
|
try {
|
|
|
JSONArray array = new JSONArray();
|
|
|
Page<Message> list = messageService.find(getUID(), type,id,pagesize);
|
|
|
for (Message msg : list) {
|
|
|
if (msg == null) {
|
|
|
continue;
|
|
|
}
|
|
|
JSONObject json = new JSONObject();
|
|
|
// 消息ID
|
|
|
json.put("id", msg.getId());
|
|
|
// 发送人标识
|
|
|
json.put("sender", msg.getSender());
|
|
|
// 发送人姓名
|
|
|
json.put("senderName", msg.getSenderName());
|
|
|
// 发送人头像
|
|
|
json.put("senderPhoto", msg.getSenderPhoto());
|
|
|
// 消息类型:1血糖,2血压
|
|
|
json.put("type", msg.getTzType());
|
|
|
// 是否已读:1未读,0已读
|
|
|
json.put("read", msg.getRead());
|
|
|
// 是否已读:
|
|
|
json.put("sex", msg.getSex());
|
|
|
// 发送时间
|
|
|
json.put("czrq", DateUtil.dateToStrLong(msg.getCzrq()));
|
|
|
array.put(json);
|
|
|
}
|
|
|
return write(200, "获取消息成功!", "list", array);
|
|
|
} catch (Exception e) {
|
|
|
error(e);
|
|
|
return error(-1, "获取消息失败!");
|
|
|
}
|
|
|
}
|
|
|
}
|