瀏覽代碼

Merge branch 'dev' of liuwenbin/patient-co-management into dev

huangwenjie 7 年之前
父節點
當前提交
56408aee13

文件差異過大導致無法顯示
+ 10 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/message/Message.java


+ 1 - 0
edu-article/JkEdu/src/com/yihu/jk/dao/ArticleDao.java

@ -460,6 +460,7 @@ public class ArticleDao {
			DB.me().insert(MyDatabaseEnum.JkEduDB, sql);
			json.put("Code", 10000);
			json.put("Message", "添加成功");
			json.put("Data", orgArticleVo.getArticleId());
			return json;
		} catch (Exception e) {
			return new JSONObject(StringUtil.jsonResult(-1, Utils.getException(e)));

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

@ -60,13 +60,13 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("update Message a set a.read = 0 where a.receiver = ?1 and a.sender=?2 and a.tzType=?3")
    int updateHealthIndexMessageByPatient(String doctor, String patient, String type);
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2,6,7,12,101) order by a.czrq desc")
    @Query("select a from Message a where a.read= 1 and a.receiver = ?1 and a.type not in (1,2,6,7,12,101,14,15) order by a.czrq desc")
    List<Message> getSystemMessageUnread(String doctor);
    @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) 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) 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' ")
@ -111,9 +111,9 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query("from Message a where a.type = 12 and a.del='1' and a.over='1' and relationCode = ?1  ")
    List<Message> findByCallServiceRelationCode(String relationCode);
    @Query(" select a from Message a where a.type=14 and a.del='1' and a.read=1 and a.receiver=?1 and a.over='1'")
    List<Message> findEduArticle(String receiver);
    @Query(" select a from Message a where a.type=?2 and a.del='1' and a.read=1 and a.receiver=?1 and a.over='1'")
    List<Message> findEduArticle(String receiver,Integer type);
    @Query(" select a from Message a where a.type=14 and a.del='1' and a.read=1 and a.receiver=?1 and a.over='1'")
    List<Message> findEduArticle(String receiver, Pageable pageRequest);
    @Query(" select a from Message a where a.type=?2 and a.del='1'  and a.receiver=?1 ")
    List<Message> findEduArticle(String receiver,Integer type, Pageable pageRequest);
}

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/template/DoctorGuidanceTempLabelDao.java

@ -20,8 +20,8 @@ public interface DoctorGuidanceTempLabelDao extends PagingAndSortingRepository<D
    @Query("select t from DoctorGuidanceTempLabel t where t.teamId = ?1 and t.del=1 order by t.createTime desc ")
    List<DoctorGuidanceTempLabel> findByTeamId(Integer teamId);
    @Query("select t from DoctorGuidanceTempLabel t where t.code = ?1 and t.del=1 ")
    DoctorGuidanceTempLabel findByCodeWithDel(String code);
    @Query("select t from DoctorGuidanceTempLabel t where t.teamId=?1 and  t.name = ?2 and t.del=1 ")
    DoctorGuidanceTempLabel findByNameWithDel(Integer teamId,String name);
    @Query("select t from DoctorGuidanceTempLabel t where t.code = ?1 ")
    DoctorGuidanceTempLabel findByCode(String code);

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

@ -100,7 +100,7 @@ public class MessageService extends BaseService {
    /**
     * 查询医生未读消息和最后消息
     */
    public JSONObject findDoctorAllMessage(String doctor) throws Exception {
    public JSONObject findDoctorAllMessage(String doctor,Integer type) throws Exception {
        // 签约未读消息总数
        int sign = messageDao.amountUnreadByReceiver(doctor);
        JSONObject signJson = new JSONObject();
@ -192,7 +192,7 @@ public class MessageService extends BaseService {
        }
        //文章审核消息
        List<Message> articleMes = messageDao.findEduArticle(doctor);
        List<Message> articleMes = messageDao.findEduArticle(doctor,type);
        JSONObject articleMesJson = new JSONObject();
        if (articleMes != null && articleMes.size() > 0) {
            articleMesJson.put("amount", articleMes.size());
@ -509,12 +509,12 @@ public class MessageService extends BaseService {
     * @return
     * @throws Exception
     */
    public List<Message> getEduArticleMessage(String receiver ,Integer page, Integer pagesize) throws Exception{
    public List<Message> getEduArticleMessage(String receiver ,Integer type,Integer page, Integer pagesize) throws Exception{
        // 排序
        Sort sort = new Sort(Sort.Direction.DESC, "createTime");
        Sort sort = new Sort(Sort.Direction.DESC, "read","over","createTime");
        // 分页信息
        Pageable pageRequest = new PageRequest(page - 1, pagesize, sort);
        return messageDao.findEduArticle(receiver,pageRequest);
        return messageDao.findEduArticle(receiver,type,pageRequest);
    }
    /**

+ 13 - 7
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -1164,11 +1164,11 @@ public class JMJkEduArticleService extends BaseService {
                isAuthentication = 1;
            }
        }
        boolean b = thirdJkEduArticleService.saveArticle(userCode,articleTitle,articleType,articlelevel,secondLevelCategoryId,image,
        String  b = thirdJkEduArticleService.saveArticle(userCode,articleTitle,articleType,articlelevel,secondLevelCategoryId,image,
                secondLevelCategoryName,firstLevelCategoryId,firstLevelCategoryName,content,operatorRoleCode,opertorRoleLevel,
                userScope,isAuthentication,articleId,roleType);
        //如果文章需要审核且文章保存数据库成功,推送消息通知给审核的管理员
        if(isAuthentication==0&&b){
        if(isAuthentication==0&&!StringUtils.isEmpty(b)){
            Doctor doctor = doctorDao.findByCode(userCode);
            List<Map<String,Object>> list = doctorInfoService.getDoctorManager(operatorRoleCode);
            for(Map<String,Object> one:list){
@ -1188,6 +1188,8 @@ public class JMJkEduArticleService extends BaseService {
                message.setReadonly(1);//是否只读消息
                message.setSex(doctor.getSex());
                message.setOver("1");//未处理
                message.setDel("1");
                message.setData(b);
                messageDao.save(message);
                if(messageService.getMessageNoticeSettingByMessageType(one.get("code")+"","1", MessageNoticeSetting.MessageTypeEnum.signSwitch.getValue())){
                    // 发送消息给医生
@ -1328,23 +1330,27 @@ public class JMJkEduArticleService extends BaseService {
                message.setCzrq(new Date());
                message.setCreateTime(new Date());
                message.setTitle("新增文章审核消息");
                if("0".equals(isAuthentication)){
                if("2".equals(isAuthentication)){
                    message.setContent("健康文章审核不通过,原因:"+reasonContent);
                }else{
                }else if("1".equals(isAuthentication)){
                    message.setContent("健康文章审核通过。");
                }else {
                    message.setContent("健康文章取消认证。");
                }
                JSONObject article = thirdJkEduArticleService.getArticalById(one,"","");
                Doctor receiveDoctor = doctorDao.findByCode(article.getString("OperatorId"));
                Doctor receiveDoctor = doctorDao.findByCode(article.getString("operatorId"));
                message.setRead(1);//设置未读
                message.setReceiver(article.getString("OperatorId"));//设置接受医生的code()
                message.setReceiver(article.getString("operatorId"));//设置接受医生的code()
                message.setSender(sender);//设置发送的医生
                message.setSenderName(doctor.getName());
                message.setCode(getCode());
                message.setSenderPhoto(doctor.getPhoto());
                message.setType(14);//新增健康文章审核信息
                message.setType(15);//新增健康文章审核结果信息
                message.setReadonly(1);//是否只读消息
                message.setSex(doctor.getSex());
                message.setOver("1");//未处理
                message.setDel("1");
                message.setData(article.get("articleId")+"");
                messageDao.save(message);
                if(messageService.getMessageNoticeSettingByMessageType(receiveDoctor.getCode(),"1", MessageNoticeSetting.MessageTypeEnum.signSwitch.getValue())){
                    // 发送消息给医生

+ 5 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/jkEduArticle/ThirdJkEduArticleService.java

@ -30,6 +30,7 @@ import org.springframework.beans.factory.annotation.Value;
import org.springframework.jdbc.core.BeanPropertyRowMapper;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.util.StringUtils;
import springfox.documentation.spring.web.json.Json;
@ -403,6 +404,7 @@ public class ThirdJkEduArticleService extends BaseService {
     * @param articleId 文章id
     * @return
     */
    @Transactional
    public JSONObject getArticalById(String articleId,String userId,String userType,String messageCode) throws Exception {
        JSONObject re = new JSONObject();
        JSONObject json = null;
@ -447,7 +449,7 @@ public class ThirdJkEduArticleService extends BaseService {
     * @return
     * @throws Exception
     */
    public boolean saveArticle(String userCode,String articleTitle,String articleType,Integer	articlelevel,String	secondLevelCategoryId,String newUrl,
    public String saveArticle(String userCode,String articleTitle,String articleType,Integer	articlelevel,String	secondLevelCategoryId,String newUrl,
                                 String	secondLevelCategoryName,String firstLevelCategoryId,String firstLevelCategoryName,String content,
                                 String operatorRoleCode,String opertorRoleLevel,Integer userScope,Integer isAuthentication,String articleId,Integer roleType) throws Exception {
@ -513,11 +515,12 @@ public class ThirdJkEduArticleService extends BaseService {
//            }
            response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(saveArticle, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if ("10000".equals(json.getString("Code"))) {
            return true;
            return json.get("Data")+"";
        } else {
            throw new Exception(json.getString("Message"));
        }

+ 3 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/messages/ImMessageController.java

@ -33,9 +33,10 @@ public class ImMessageController extends BaseController {
    @RequestMapping(value = "messages",method = {RequestMethod.GET,RequestMethod.POST})
    @ResponseBody
    @ApiOperation("查询医生未读消息和最后消息")
    public String messages() {
    public String messages(@ApiParam(name = "type", value = "文章审核的时候必传,消息类型,14:提交文章审核,15:审核结果")
                               @RequestParam(value = "type", required = false,defaultValue = "15") Integer type) {
        try {
            JSONObject json = messageService.findDoctorAllMessage(getUID());
            JSONObject json = messageService.findDoctorAllMessage(getUID(),type);
            return write(200, "获取消息总数成功!", "data", json);
        } catch (Exception e) {
            error(e);

+ 3 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEduPC/DoctorJMJkEduArticlePCController.java

@ -245,7 +245,7 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
    @ApiOperation("文章认证")
    public  String authenticationArticle(@ApiParam(name = "articleId", value = "文章id,多个文章‘,’隔开")
                                         @RequestParam(value = "articleId", required = true) String articleId,
                                         @ApiParam(name = "isAuthentication", value = "认证,0取消认证,1认证")
                                         @ApiParam(name = "isAuthentication", value = "认证,0取消认证,1认证,2(认证但未通过)")
                                         @RequestParam(value = "isAuthentication", required = true) String isAuthentication,
                                         @ApiParam(name = "firstLevelCategoryId", value = "文章一级分类")
                                         @RequestParam(value = "firstLevelCategoryId", required = false) String firstLevelCategoryId,
@ -259,10 +259,10 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
                                         @RequestParam(value = "reasonContent", required = false) String reasonContent){
        try{
            jmJkEduArticleService.authenticationArticle(articleId,isAuthentication,firstLevelCategoryId,firstLevelCategoryName,secondLevelCategoryId,secondLevelCategoryName,reasonContent,getUID());
            return success("认证成功!");
            return success("操作成功!");
        }catch (Exception e){
            e.printStackTrace();
            return error(-1,"认证失败!");
            return error(-1,"操作失败!");
        }
    }

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

@ -37,9 +37,10 @@ public class DoctorMessageController extends BaseController {
    @RequestMapping(value = "messages")
    @ResponseBody
    @ApiOperation("查询医生未读消息和最后消息")
    public String messages() {
    public String messages(@ApiParam(name = "type", value = "文章审核的时候必传,消息类型,14:提交文章审核,15:审核结果")
                               @RequestParam(value = "type", required = false) Integer type) {
        try {
            JSONObject json = messageService.findDoctorAllMessage(getUID());
            JSONObject json = messageService.findDoctorAllMessage(getUID(),type);
            return write(200, "获取消息总数成功!", "data", json);
        } catch (Exception e) {
            error(e);
@ -215,12 +216,14 @@ public class DoctorMessageController extends BaseController {
    @RequestMapping(value = "getEduArticleMessage", method = RequestMethod.GET)
    @ResponseBody
    @ApiOperation("获取文章审核消息")
    public String getEduArticleMessage(@ApiParam(value = "第几页", defaultValue = "1")
    public String getEduArticleMessage(@ApiParam(name = "type", value = "文章审核的时候必传,消息类型,14:提交文章审核,15:审核结果")
                                           @RequestParam(value = "type", required = false) Integer type,
                                        @ApiParam(value = "第几页", defaultValue = "1")
                                       @RequestParam Integer page,
                                       @ApiParam(value = "每页几行", defaultValue = "10")
                                       @RequestParam Integer pagesize){
        try{
            List<Message> list = messageService.getEduArticleMessage(getUID(),page,pagesize);
            List<Message> list = messageService.getEduArticleMessage(getUID(),type,page,pagesize);
            return write(200,"获取消息成功!", "list", list);
        }catch (Exception e){
            error(e);

+ 7 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorGuidanceTempLabelController.java

@ -2,6 +2,7 @@ package com.yihu.wlyy.web.doctor.template;
import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.template.DoctorGuidanceTempLabel;
import com.yihu.wlyy.repository.template.DoctorGuidanceTempLabelDao;
import com.yihu.wlyy.service.template.DoctorGuidanceTempLableService;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
@ -25,6 +26,8 @@ public class DoctorGuidanceTempLabelController extends BaseController {
    @Autowired
    private DoctorGuidanceTempLableService doctorGuidanceTempLableService;
    @Autowired
    private DoctorGuidanceTempLabelDao doctorGuidanceTempLableDao;
    @RequestMapping(value = "/add", method = RequestMethod.POST)
    @ApiOperation(value = "添加指导模板标签")
@ -34,6 +37,10 @@ public class DoctorGuidanceTempLabelController extends BaseController {
                        @ApiParam(name = "teamId", value = "医生团队id", required = true)
                        @RequestParam(value = "teamId", required = true) Integer teamId){
        try{
            DoctorGuidanceTempLabel doctorGuidanceTempLabel = doctorGuidanceTempLableDao.findByNameWithDel(teamId,name);
            if(doctorGuidanceTempLabel!=null){
                return error(-1,"标签名称已存在!");
            }
            DoctorGuidanceTempLabel doctorGuidanceTempLable = doctorGuidanceTempLableService.save(getUID(),name,teamId);
            if(doctorGuidanceTempLable!=null){
                return write(200,"保存标签成功!","data",doctorGuidanceTempLable);

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

@ -141,7 +141,7 @@ es:
jkEdu:
  web:
#    articleBaseUrl: http://yihu.com:9088/
    articleBaseUrl: http://172.19.103.87:9088/
    articleBaseUrl: http://172.19.103.87:9092/
#消息队列
activemq:

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

@ -131,7 +131,7 @@ es:
#集美宣教居民端健康文章
jkEdu:
  web:
    articleBaseUrl: http://172.19.103.87:9088/
    articleBaseUrl: http://172.19.103.87:9092/
#消息队列
activemq: