浏览代码

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

huangwenjie 7 年之前
父节点
当前提交
66e4342ab2

+ 1 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/message/Message.java

@ -55,7 +55,7 @@ public class Message extends IdEntity {
	private String tzType;//体征类别
	private String tzType;//体征类别
	private String tzCode;//体征code
	private String tzCode;//体征code
	private Integer sex;//患者性别
	private Integer sex;//患者性别
	private String relationCode;//业务关联code,type=6时为咨询code,type=7、8、9时为续方code type = 10\11时为申诉和反馈ID 12.协同服务code
	private String relationCode;//业务关联code,type=6时为咨询code,type=7、8、9时为续方code type = 10\11时为申诉和反馈ID 12.协同服务code,14和15是文章审核功能是(0未认证1已认证2未通过)
	private String prescriptionStatus;//type=6续方审核状态 0待审核,1审核通过,2审核失败,3居民取消|type=7续方状态 0待取药,1已取药
	private String prescriptionStatus;//type=6续方审核状态 0待审核,1审核通过,2审核失败,3居民取消|type=7续方状态 0待取药,1已取药
	public String getCode() {
	public String getCode() {

二进制
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/api/ArticleApi.class


二进制
edu-article/JkEdu/WebRoot/WEB-INF/classes/com/yihu/jk/dao/ArticleDao.class


+ 4 - 1
edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java

@ -553,6 +553,7 @@ public class ArticleApi {
		Timestamp nowTime = DateOper.getNowDateTime();//插入和更新时间一样
		Timestamp nowTime = DateOper.getNowDateTime();//插入和更新时间一样
		orgArticleVo.setUpdateTime(nowTime);
		orgArticleVo.setUpdateTime(nowTime);
		Integer isAuthentication = StringUtil.isEmpty(json.get("isAuthentication")) ? null : json.getInt("isAuthentication");//是否认证
		if(StringUtil.isEmpty(articleId)) {
		if(StringUtil.isEmpty(articleId)) {
			String userCode = StringUtil.isEmpty(json.get("userCode")) ? null : json.getString("userCode");
			String userCode = StringUtil.isEmpty(json.get("userCode")) ? null : json.getString("userCode");
			String orgName = StringUtil.isEmpty(json.get("orgName")) ? null : json.getString("orgName");//组织名称
			String orgName = StringUtil.isEmpty(json.get("orgName")) ? null : json.getString("orgName");//组织名称
@ -564,7 +565,6 @@ public class ArticleApi {
			String articleType = StringUtil.isEmpty(json.get("articleType")) ? null : json.getString("articleType");//类型
			String articleType = StringUtil.isEmpty(json.get("articleType")) ? null : json.getString("articleType");//类型
			String operatorRoleCode = StringUtil.isEmpty(json.get("operatorRoleCode")) ? null : json.getString("operatorRoleCode");//操作人角色code
			String operatorRoleCode = StringUtil.isEmpty(json.get("operatorRoleCode")) ? null : json.getString("operatorRoleCode");//操作人角色code
			String opertorRoleLevel = StringUtil.isEmpty(json.get("opertorRoleLevel")) ? null : json.getString("opertorRoleLevel");//操作人角色级别
			String opertorRoleLevel = StringUtil.isEmpty(json.get("opertorRoleLevel")) ? null : json.getString("opertorRoleLevel");//操作人角色级别
			Integer isAuthentication = StringUtil.isEmpty(json.get("isAuthentication")) ? null : json.getInt("isAuthentication");//是否认证
			String authentication = StringUtil.isEmpty(json.get("authentication")) ? null : json.getString("authentication");//认证单位
			String authentication = StringUtil.isEmpty(json.get("authentication")) ? null : json.getString("authentication");//认证单位
			String authenticationId = StringUtil.isEmpty(json.get("authenticationId")) ? null : json.getString("authenticationId");//认证单位ID
			String authenticationId = StringUtil.isEmpty(json.get("authenticationId")) ? null : json.getString("authenticationId");//认证单位ID
			articleId = StringUtil.createUUID();
			articleId = StringUtil.createUUID();
@ -603,9 +603,12 @@ public class ArticleApi {
//			statistic.setArticleId(articleId);
//			statistic.setArticleId(articleId);
//			dao.insertArticleInitStatistic(statistic);
//			dao.insertArticleInitStatistic(statistic);
			dao.insertArticleStatistic(articleId);
			dao.insertArticleStatistic(articleId);
			System.out.println("saveArticle===============");
			return dao.saveArticle(orgArticleVo).toString();
			return dao.saveArticle(orgArticleVo).toString();
		}else{
		}else{
			orgArticleVo.setIsAuthentication(isAuthentication);
			orgArticleVo.setArticleId(articleId);
			orgArticleVo.setArticleId(articleId);
			System.out.println("updateArticle==============="+orgArticleVo);
			return dao.updateArticle(orgArticleVo).toString();
			return dao.updateArticle(orgArticleVo).toString();
		}
		}
	}
	}

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

@ -529,6 +529,8 @@ public class ArticleDao {
			JSONObject json = new JSONObject();
			JSONObject json = new JSONObject();
			json.put("Code", 10000);
			json.put("Code", 10000);
			json.put("Message", "更新成功");
			json.put("Message", "更新成功");
			json.put("Data", vo.getArticleId());
			System.out.println("json:----->"+json);
			return json;
			return json;
		} catch (JSONException | SQLException e) {
		} catch (JSONException | SQLException e) {
			// TODO Auto-generated catch block
			// TODO Auto-generated catch block

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

@ -116,4 +116,8 @@ public interface MessageDao extends PagingAndSortingRepository<Message, Long>, J
    @Query(" select a from Message a where a.type=?2 and a.del='1'  and a.receiver=?1 ")
    @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);
    List<Message> findEduArticle(String receiver,Integer type, Pageable pageRequest);
    @Modifying
    @Query("delete from Message a   where a.receiver = ?1 and a.data = ?2 and a.type in (14,15) ")
    int setMessageDel(String doctor, String articleCode);
}
}

+ 17 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/account/DoctorInfoService.java

@ -1622,11 +1622,27 @@ public class DoctorInfoService extends BaseService {
    }
    }
    /**
    /**
     * 获取同级的文章审核管理员
     * 获取同级的文章审核管理员(普通医生)
     * @param operatorRoleCode
     * @param operatorRoleCode
     * @return
     * @return
     */
     */
    public List<Map<String,Object>> getDoctorManager(String operatorRoleCode){
    public List<Map<String,Object>> getDoctorManager(String operatorRoleCode){
        String sql = "select d.code,d.name,d.openid from wlyy_doctor d " +
//                " join wlyy_user_role h on d.code=h.user " +
                " join manage_role_user ru on d.code=ru.user_code " +
                " join manage_role_feature rf on ru.role_id=rf.role_id " +
                " join manage_feature f on rf.feature_id=f.id " +
                " where f.code='Manage_Article_Authentication' " +
                " and d.hospital='"+operatorRoleCode+"'";
        return jdbcTemplate.queryForList(sql);
    }
    /**
     * 获取同级的文章审核管理员(管理员)
     * @param operatorRoleCode
     * @return
     */
    public List<Map<String,Object>> getDoctorManager2(String operatorRoleCode){
        String sql = "select d.code,d.name,d.openid from wlyy_doctor d " +
        String sql = "select d.code,d.name,d.openid from wlyy_doctor d " +
                " join wlyy_user_role h on d.code=h.user " +
                " join wlyy_user_role h on d.code=h.user " +
                " join manage_role_user ru on d.code=ru.user_code " +
                " join manage_role_user ru on d.code=ru.user_code " +

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

@ -656,4 +656,13 @@ public class MessageService extends BaseService {
        messageDao.save(mess);
        messageDao.save(mess);
        return "1";
        return "1";
    }
    }
    @Transactional
    public boolean setMessageDel(String receive,String articleId){
        if(messageDao.setMessageDel(receive,articleId)>0){
            return true;
        }else {
            return false;
        }
    }
}
}

+ 27 - 8
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/jimeiJkEdu/JMJkEduArticleService.java

@ -1136,6 +1136,7 @@ public class JMJkEduArticleService extends BaseService {
     * @param content
     * @param content
     * @throws Exception
     * @throws Exception
     */
     */
    @Transactional
    public void saveArticle(String userCode,String articleTitle,String articleType,Integer	articlelevel,String	secondLevelCategoryId,String image,
    public void saveArticle(String userCode,String articleTitle,String articleType,Integer	articlelevel,String	secondLevelCategoryId,String image,
                            String	secondLevelCategoryName,String firstLevelCategoryId,String firstLevelCategoryName,String content,String operatorRoleCode,
                            String	secondLevelCategoryName,String firstLevelCategoryId,String firstLevelCategoryName,String content,String operatorRoleCode,
                            String opertorRoleLevel,Integer userScope,String articleId,Integer roleType) throws Exception {
                            String opertorRoleLevel,Integer userScope,String articleId,Integer roleType) throws Exception {
@ -1156,23 +1157,38 @@ public class JMJkEduArticleService extends BaseService {
        }
        }
        Integer isAuthentication = 0;
        Integer isAuthentication = 0;
        //当管理员具有审核权限时,添加文章不需认证,添加后自动认证,
        //当管理员具有审核权限时,添加文章不需认证,添加后自动认证,
//        Doctor doctor = doctorDao.findByCode(userCode);
        if(roleType==2){
        Doctor doctor = doctorDao.findByCode(userCode);
//        if(roleType==2){
//            List<RoleWithAuthorityCheck> list = doctorDao.findEduAuthority(userCode,operatorRoleCode);
//            List<RoleWithAuthorityCheck> list = doctorDao.findEduAuthority(userCode,operatorRoleCode);
            List<Map<String, Object>> list = doctorInfoService.getDoctorManagerRole(userCode,"Manage_Article_Authentication");
            if(list.size()>0&&!StringUtils.isEmpty(list.get(0).get("code"))){
            List<Map<String, Object>> list2 = doctorInfoService.getDoctorManagerRole(userCode,"Manage_Article_Authentication");
            if(list2.size()>0&&!StringUtils.isEmpty(list2.get(0).get("code"))){
                isAuthentication = 1;
                isAuthentication = 1;
            }
            }
        }
//        }
        String  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,
                secondLevelCategoryName,firstLevelCategoryId,firstLevelCategoryName,content,operatorRoleCode,opertorRoleLevel,
                userScope,isAuthentication,articleId,roleType);
                userScope,isAuthentication,articleId,roleType);
        //如果文章需要审核且文章保存数据库成功,推送消息通知给审核的管理员
        //如果文章需要审核且文章保存数据库成功,推送消息通知给审核的管理员
        if(isAuthentication==0&&!StringUtils.isEmpty(b)){
        if(isAuthentication==0&&!StringUtils.isEmpty(b)){
            Doctor doctor = doctorDao.findByCode(userCode);
            List<Map<String,Object>> list = doctorInfoService.getDoctorManager(operatorRoleCode);
//            if(!StringUtils.isEmpty(articleId)){
//
//                messageDao.setMessageDel(userCode,articleId);
//            }
            List<Map<String,Object>> list = null;
            if(roleType==1){
                list = doctorInfoService.getDoctorManager(operatorRoleCode);
            }else if(roleType==2){
                list = doctorInfoService.getDoctorManager2(operatorRoleCode);
            }
            for(Map<String,Object> one:list){
            for(Map<String,Object> one:list){
                if(!StringUtils.isEmpty(articleId)){
                    messageDao.setMessageDel(one.get("code")+"",articleId);
                }
                Message message = new Message();
                Message message = new Message();
                message.setCzrq(new Date());
                message.setCzrq(new Date());
                message.setCreateTime(new Date());
                message.setCreateTime(new Date());
@ -1190,6 +1206,7 @@ public class JMJkEduArticleService extends BaseService {
                message.setOver("1");//未处理
                message.setOver("1");//未处理
                message.setDel("1");
                message.setDel("1");
                message.setData(b);
                message.setData(b);
                message.setRelationCode("0");
                messageDao.save(message);
                messageDao.save(message);
                if(messageService.getMessageNoticeSettingByMessageType(one.get("code")+"","1", MessageNoticeSetting.MessageTypeEnum.signSwitch.getValue())){
                if(messageService.getMessageNoticeSettingByMessageType(one.get("code")+"","1", MessageNoticeSetting.MessageTypeEnum.signSwitch.getValue())){
                    // 发送消息给医生
                    // 发送消息给医生
@ -1318,13 +1335,14 @@ public class JMJkEduArticleService extends BaseService {
        }
        }
    }
    }
    @Transient
    @Transactional
    public void authenticationArticle(String articleId,String isAuthentication,String firstLevelCategoryId,String firstLevelCategoryName,String secondLevelCategoryId,String secondLevelCategoryName,String reasonContent,String sender) throws Exception{
    public void authenticationArticle(String articleId,String isAuthentication,String firstLevelCategoryId,String firstLevelCategoryName,String secondLevelCategoryId,String secondLevelCategoryName,String reasonContent,String sender) throws Exception{
        String[] str = articleId.split(",");
        String[] str = articleId.split(",");
        Doctor doctor = doctorDao.findByCode(sender);
        Doctor doctor = doctorDao.findByCode(sender);
        for(String one: str){
        for(String one: str){
            boolean b = thirdJkEduArticleService.authenticationArticle(one,isAuthentication,firstLevelCategoryId,firstLevelCategoryName,secondLevelCategoryId,secondLevelCategoryName);
            boolean b = thirdJkEduArticleService.authenticationArticle(one,isAuthentication,firstLevelCategoryId,firstLevelCategoryName,secondLevelCategoryId,secondLevelCategoryName);
            messageDao.setMessageDel(sender,articleId);
            if(b){
            if(b){
                Message message = new Message();
                Message message = new Message();
                message.setCzrq(new Date());
                message.setCzrq(new Date());
@ -1351,6 +1369,7 @@ public class JMJkEduArticleService extends BaseService {
                message.setOver("1");//未处理
                message.setOver("1");//未处理
                message.setDel("1");
                message.setDel("1");
                message.setData(article.get("articleId")+"");
                message.setData(article.get("articleId")+"");
                message.setRelationCode(isAuthentication);
                messageDao.save(message);
                messageDao.save(message);
                if(messageService.getMessageNoticeSettingByMessageType(receiveDoctor.getCode(),"1", MessageNoticeSetting.MessageTypeEnum.signSwitch.getValue())){
                if(messageService.getMessageNoticeSettingByMessageType(receiveDoctor.getCode(),"1", MessageNoticeSetting.MessageTypeEnum.signSwitch.getValue())){
                    // 发送消息给医生
                    // 发送消息给医生

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

@ -220,7 +220,7 @@ public class BaseController {
                userAgent = request.getHeader("User-Agent");
                userAgent = request.getHeader("User-Agent");
            }
            }
            JSONObject json = new JSONObject(userAgent);
            JSONObject json = new JSONObject(userAgent);
            return json.getJSONObject("currentUserRole").getString("level");
            return json.getJSONObject("currentUserRole").get("level")+"";
        } catch (Exception e) {
        } catch (Exception e) {
            return null;
            return null;
        }
        }

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/account/DoctorController.java

@ -146,9 +146,9 @@ public class DoctorController extends BaseController {
                one.put("level","4");
                one.put("level","4");
                if(list.size()>0&&!org.springframework.util.StringUtils.isEmpty(list.get(0).get("code"))){
                if(list.size()>0&&!org.springframework.util.StringUtils.isEmpty(list.get(0).get("code"))){
                    one.put("authOperate", "1");
                    one.put("doctorAuthOperate", "1");
                }else{
                }else{
                    one.put("authOperate", "0");
                    one.put("doctorAuthOperate", "0");
                }
                }
                map.put("currentUserRole", one);
                map.put("currentUserRole", one);
            }
            }

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

@ -5,6 +5,7 @@ import com.yihu.wlyy.aop.ObserverRequired;
import com.yihu.wlyy.entity.consult.ConsultTeam;
import com.yihu.wlyy.entity.consult.ConsultTeam;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.message.Message;
import com.yihu.wlyy.entity.message.MessageNoticeSetting;
import com.yihu.wlyy.entity.message.MessageNoticeSetting;
import com.yihu.wlyy.repository.message.MessageDao;
import com.yihu.wlyy.service.app.message.MessageService;
import com.yihu.wlyy.service.app.message.MessageService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.BaseController;
import com.yihu.wlyy.web.BaseController;
@ -33,6 +34,8 @@ public class DoctorMessageController extends BaseController {
    @Autowired
    @Autowired
    private MessageService messageService;
    private MessageService messageService;
    private ObjectMapper objectMapper = new ObjectMapper();
    private ObjectMapper objectMapper = new ObjectMapper();
    @Autowired
    private MessageDao messageDao;
    @RequestMapping(value = "messages")
    @RequestMapping(value = "messages")
    @ResponseBody
    @ResponseBody
@ -425,4 +428,21 @@ public class DoctorMessageController extends BaseController {
            return error(-1, "设置失败");
            return error(-1, "设置失败");
        }
        }
    }
    }
    @RequestMapping(value = "delectArticleMessage", method = RequestMethod.POST)
    @ResponseBody
    @ApiOperation("删除健康文章已处理的消息")
    public String delectArticleMessage(@ApiParam(name = "articleId", value = "健康文章的code")
                                           @RequestParam(value = "articleId", required = true) String articleId) throws Exception {
        try {
            if(messageService.setMessageDel(getUID(),articleId)){
                return write(200, "删除成功");
            }
            return error(-1,"删除失败");
        } catch (Exception ex) {
            return invalidUserException(ex, -1, ex.getMessage());
        }
    }
}
}