|
@ -138,7 +138,7 @@ public class DoctorJMJkEduArticleController extends BaseController {
|
|
jmJkEduArticleService.initPatient(patientSet,labelUnitType,labelSexType,labelServeType,labelDiseaseType,labelHealthType,getUID(),currentRoleCode,currentRoleLevel);
|
|
jmJkEduArticleService.initPatient(patientSet,labelUnitType,labelSexType,labelServeType,labelDiseaseType,labelHealthType,getUID(),currentRoleCode,currentRoleLevel);
|
|
// patientSet.add(patientService.findByCode("wjw00000001000e6badcfa163e424525"));
|
|
// patientSet.add(patientService.findByCode("wjw00000001000e6badcfa163e424525"));
|
|
//获取保存发送记录
|
|
//获取保存发送记录
|
|
HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.savePCPushArticle(patientSet, getUID(), 2,"", 0L, articleId,leaveWords,getCurrentRoleCode(),getCurrentRoleLevel());
|
|
|
|
|
|
HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.savePCPushArticle(patientSet, getUID(), 2,"", 0L, articleId,leaveWords,currentRoleCode,currentRoleLevel);
|
|
//推送微信模板消息和发送im消息
|
|
//推送微信模板消息和发送im消息
|
|
new Thread(() -> {
|
|
new Thread(() -> {
|
|
//发送任务到redis
|
|
//发送任务到redis
|
|
@ -266,7 +266,9 @@ public class DoctorJMJkEduArticleController extends BaseController {
|
|
@RequestParam(value = "labelType", required = false) String labelType,
|
|
@RequestParam(value = "labelType", required = false) String labelType,
|
|
@RequestParam(value = "teamCode", required = false) long teamCode,
|
|
@RequestParam(value = "teamCode", required = false) long teamCode,
|
|
@RequestParam(value = "articleId", required = false) String articleId,
|
|
@RequestParam(value = "articleId", required = false) String articleId,
|
|
@RequestParam(value = "leaveWords", required = false) String leaveWords){
|
|
|
|
|
|
@RequestParam(value = "leaveWords", required = false) String leaveWords,
|
|
|
|
@RequestParam(value = "currentUserRole", required = false) String currentUserRole,
|
|
|
|
@RequestParam(value = "currentUserRoleLevel", required = false ,defaultValue = "4")String currentUserRoleLevel){
|
|
|
|
|
|
try {
|
|
try {
|
|
if (StringUtils.isEmpty(code)) {
|
|
if (StringUtils.isEmpty(code)) {
|
|
@ -290,7 +292,13 @@ public class DoctorJMJkEduArticleController extends BaseController {
|
|
if (patientSet.size() == 0) {
|
|
if (patientSet.size() == 0) {
|
|
return new BaseResultModel("请至少选择一个患者!");
|
|
return new BaseResultModel("请至少选择一个患者!");
|
|
}
|
|
}
|
|
HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 1,"", teamCode, articleId,leaveWords);
|
|
|
|
|
|
if(!StringUtils.isNotEmpty(currentUserRole)){
|
|
|
|
currentUserRole = getCurrentRoleCode();
|
|
|
|
}
|
|
|
|
if(!StringUtils.isNotEmpty(currentUserRoleLevel)){
|
|
|
|
currentUserRoleLevel = getCurrentRoleLevel();
|
|
|
|
}
|
|
|
|
HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.savePCPushArticle(patientSet, getUID(), 1,"", teamCode, articleId,leaveWords,currentUserRole,currentUserRoleLevel);
|
|
//推送微信模板消息和发送im消息
|
|
//推送微信模板消息和发送im消息
|
|
new Thread(() -> {
|
|
new Thread(() -> {
|
|
//发送任务到redis
|
|
//发送任务到redis
|
|
@ -308,13 +316,21 @@ public class DoctorJMJkEduArticleController extends BaseController {
|
|
public BaseResultModel doctorSendArticleToSingle(
|
|
public BaseResultModel doctorSendArticleToSingle(
|
|
@ApiParam(name = "patientCode", value = "患者Code", required = true) @RequestParam(value = "patientCode", required = true) String patientCode,
|
|
@ApiParam(name = "patientCode", value = "患者Code", required = true) @RequestParam(value = "patientCode", required = true) String patientCode,
|
|
@ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId,
|
|
@ApiParam(name = "articleId", value = "文章ID", required = true) @RequestParam(value = "articleId", required = true) String articleId,
|
|
@ApiParam(name = "leaveWords", value = "医生留言", required = false) @RequestParam(value = "leaveWords", required = false) String leaveWords){
|
|
|
|
|
|
@ApiParam(name = "leaveWords", value = "医生留言", required = false) @RequestParam(value = "leaveWords", required = false) String leaveWords,
|
|
|
|
@RequestParam(value = "currentUserRole", required = false) String currentUserRole,
|
|
|
|
@RequestParam(value = "currentUserRoleLevel", required = false ,defaultValue = "4")String currentUserRoleLevel){
|
|
try {
|
|
try {
|
|
|
|
if(!StringUtils.isNotEmpty(currentUserRole)){
|
|
|
|
currentUserRole = getCurrentRoleCode();
|
|
|
|
}
|
|
|
|
if(!StringUtils.isNotEmpty(currentUserRoleLevel)){
|
|
|
|
currentUserRoleLevel = getCurrentRoleLevel();
|
|
|
|
}
|
|
Set<String> patientSet = new HashSet<>(); //放入set中可以去重复
|
|
Set<String> patientSet = new HashSet<>(); //放入set中可以去重复
|
|
//得到需要发送的患者
|
|
//得到需要发送的患者
|
|
patientSet.add(patientCode);
|
|
patientSet.add(patientCode);
|
|
// jmJkEduArticleService.initPatients(patientSet,labelType,condition,groupType,teamId,getUID());
|
|
// jmJkEduArticleService.initPatients(patientSet,labelType,condition,groupType,teamId,getUID());
|
|
HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.savePCPushArticle(patientSet, getUID(), 1,"", 0L, articleId,leaveWords,getCurrentRoleCode(),getCurrentRoleLevel());
|
|
|
|
|
|
HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.savePCPushArticle(patientSet, getUID(), 1,"", 0L, articleId,leaveWords,currentUserRole,currentUserRoleLevel);
|
|
//推送微信模板消息和发送im消息
|
|
//推送微信模板消息和发送im消息
|
|
new Thread(() -> {
|
|
new Thread(() -> {
|
|
//发送任务到redis
|
|
//发送任务到redis
|
|
@ -390,44 +406,44 @@ public class DoctorJMJkEduArticleController extends BaseController {
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@RequestMapping(value = "saveArticle", method = RequestMethod.POST)
|
|
|
|
@ApiOperation("添加文章")
|
|
|
|
public String saveArticle(@ApiParam(name = "articleId", value = "文章Id")
|
|
|
|
@RequestParam(value = "articleId", required = false) String articleId,
|
|
|
|
@ApiParam(name = "articleTitle", value = "文章标题")
|
|
|
|
@RequestParam(value = "articleTitle", required = true) String articleTitle,
|
|
|
|
@ApiParam(name = "articleType", value = "文章类型")
|
|
|
|
@RequestParam(value = "articleType", required = true) String articleType,
|
|
|
|
@ApiParam(name = "articlelevel", value = "文章级别")
|
|
|
|
@RequestParam(value = "articlelevel", required = true) Integer articlelevel,
|
|
|
|
@ApiParam(name = "secondLevelCategoryId", value = "文章二级分类id")
|
|
|
|
@RequestParam(value = "secondLevelCategoryId", required = true) String secondLevelCategoryId,
|
|
|
|
@ApiParam(name = "secondLevelCategoryName", value = "文章二级分类名称")
|
|
|
|
@RequestParam(value = "secondLevelCategoryName", required = true) String secondLevelCategoryName,
|
|
|
|
@ApiParam(name = "firstLevelCategoryId", value = "文章一级分类id")
|
|
|
|
@RequestParam(value = "firstLevelCategoryId", required = true) String firstLevelCategoryId,
|
|
|
|
@ApiParam(name = "firstLevelCategoryName", value = "文章一级分类名称")
|
|
|
|
@RequestParam(value = "firstLevelCategoryName", required = true) String firstLevelCategoryName,
|
|
|
|
@ApiParam(name = "content", value = "文章内容")
|
|
|
|
@RequestParam(value = "content", required = true) String content,
|
|
|
|
@ApiParam(name = "imageUrl", value = "文章封面图片地址")
|
|
|
|
@RequestParam(value = "imageUrl", required = true) String imageUrl,
|
|
|
|
@ApiParam(name = "currentUserRole", value = "当前登录的角色")
|
|
|
|
@RequestParam(value = "currentUserRole", required = true) String currentUserRole,
|
|
|
|
@ApiParam(name = "currentUserRoleLevel", value = "当前登录的角色级别",defaultValue = "4")
|
|
|
|
@RequestParam(value = "currentUserRoleLevel", required = false ,defaultValue = "4")String currentUserRoleLevel,
|
|
|
|
@ApiParam(name = "userScope", value = "使用范围(1、全市使用,2、全区使用,3、全社区使用)")
|
|
|
|
@RequestParam(value = "userScope", required = true) Integer userScope){
|
|
|
|
|
|
|
|
try {
|
|
|
|
jmJkEduArticleService.saveArticle(getUID(),articleTitle,articleType,articlelevel,secondLevelCategoryId,imageUrl,
|
|
|
|
secondLevelCategoryName,firstLevelCategoryId,firstLevelCategoryName,content,currentUserRole,currentUserRoleLevel,userScope,articleId);
|
|
|
|
return success("添加成功!");
|
|
|
|
}catch (Exception e){
|
|
|
|
e.printStackTrace();
|
|
|
|
return error(-1,"添加失败!");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
// @RequestMapping(value = "saveArticle", method = RequestMethod.POST)
|
|
|
|
// @ApiOperation("添加文章")
|
|
|
|
// public String saveArticle(@ApiParam(name = "articleId", value = "文章Id")
|
|
|
|
// @RequestParam(value = "articleId", required = false) String articleId,
|
|
|
|
// @ApiParam(name = "articleTitle", value = "文章标题")
|
|
|
|
// @RequestParam(value = "articleTitle", required = true) String articleTitle,
|
|
|
|
// @ApiParam(name = "articleType", value = "文章类型")
|
|
|
|
// @RequestParam(value = "articleType", required = true) String articleType,
|
|
|
|
// @ApiParam(name = "articlelevel", value = "文章级别")
|
|
|
|
// @RequestParam(value = "articlelevel", required = true) Integer articlelevel,
|
|
|
|
// @ApiParam(name = "secondLevelCategoryId", value = "文章二级分类id")
|
|
|
|
// @RequestParam(value = "secondLevelCategoryId", required = true) String secondLevelCategoryId,
|
|
|
|
// @ApiParam(name = "secondLevelCategoryName", value = "文章二级分类名称")
|
|
|
|
// @RequestParam(value = "secondLevelCategoryName", required = true) String secondLevelCategoryName,
|
|
|
|
// @ApiParam(name = "firstLevelCategoryId", value = "文章一级分类id")
|
|
|
|
// @RequestParam(value = "firstLevelCategoryId", required = true) String firstLevelCategoryId,
|
|
|
|
// @ApiParam(name = "firstLevelCategoryName", value = "文章一级分类名称")
|
|
|
|
// @RequestParam(value = "firstLevelCategoryName", required = true) String firstLevelCategoryName,
|
|
|
|
// @ApiParam(name = "content", value = "文章内容")
|
|
|
|
// @RequestParam(value = "content", required = true) String content,
|
|
|
|
// @ApiParam(name = "imageUrl", value = "文章封面图片地址")
|
|
|
|
// @RequestParam(value = "imageUrl", required = true) String imageUrl,
|
|
|
|
// @ApiParam(name = "currentUserRole", value = "当前登录的角色")
|
|
|
|
// @RequestParam(value = "currentUserRole", required = true) String currentUserRole,
|
|
|
|
// @ApiParam(name = "currentUserRoleLevel", value = "当前登录的角色级别",defaultValue = "4")
|
|
|
|
// @RequestParam(value = "currentUserRoleLevel", required = false ,defaultValue = "4")String currentUserRoleLevel,
|
|
|
|
// @ApiParam(name = "userScope", value = "使用范围(1、全市使用,2、全区使用,3、全社区使用)")
|
|
|
|
// @RequestParam(value = "userScope", required = true) Integer userScope){
|
|
|
|
//
|
|
|
|
// try {
|
|
|
|
// jmJkEduArticleService.saveArticle(getUID(),articleTitle,articleType,articlelevel,secondLevelCategoryId,imageUrl,
|
|
|
|
// secondLevelCategoryName,firstLevelCategoryId,firstLevelCategoryName,content,currentUserRole,currentUserRoleLevel,userScope,articleId);
|
|
|
|
// return success("添加成功!");
|
|
|
|
// }catch (Exception e){
|
|
|
|
// e.printStackTrace();
|
|
|
|
// return error(-1,"添加失败!");
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
@RequestMapping(value = "saveArticleCollection",method = RequestMethod.POST)
|
|
@RequestMapping(value = "saveArticleCollection",method = RequestMethod.POST)
|
|
@ApiOperation("收藏文章")
|
|
@ApiOperation("收藏文章")
|