Преглед изворни кода

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

huangwenjie пре 7 година
родитељ
комит
8306b59a64

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


+ 3 - 0
edu-article/JkEdu/src/com/yihu/jk/api/ArticleApi.java

@ -228,6 +228,9 @@ public class ArticleApi {
					jsonObj.put("authenticationId", StringUtil.getJSONValue(vbo.getAuthenticationId()));
					jsonObj.put("articleType", StringUtil.getJSONValue(vbo.getArticleType()));
					jsonObj.put("isAuthentication", StringUtil.getJSONValue(vbo.getIsAuthentication()));
					jsonObj.put("roleType", StringUtil.getJSONValue(vbo.getRoleType()));
					jsonObj.put("operatorRoleCode", StringUtil.getJSONValue(vbo.getOperatorRoleCode()));
					jsonObj.put("operatorRoleLevel", StringUtil.getJSONValue(vbo.getOperatorRoleLevel()));
					jsonObj.put("articleCover", StringUtil.getJSONValue(vbo.getArticleCover()));
					jsonObj.put("browseNumber", StringUtil.getJSONValue(vbo.getBrowseNumber()));
					jsonObj.put("pointNumber", StringUtil.getJSONValue(vbo.getPointNumber()));

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

@ -38,8 +38,8 @@ public interface DoctorTeamGuidanceTemplateDao extends PagingAndSortingRepositor
    //  根据模板编码更改团队模板对应表
    @Modifying
    @Query("update DoctorTeamGuidanceTemplate t set t.title = ?3 where t.del = 1 and t.teamId = ?1 and t.teamTemplateCode =?2 ")
    int modifyTeamGuidance(int teamId, String guidanceCode, String title);
    @Query("update DoctorTeamGuidanceTemplate t set t.title = ?3,t.labelCode=?4,t.labelName=?5 where t.del = 1 and t.teamId = ?1 and t.teamTemplateCode =?2 ")
    int modifyTeamGuidance(int teamId, String guidanceCode, String title,String labelCode,String labelName);
    //  每给居民发送一次团队指导,使用数量加1
    @Modifying

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

@ -1173,10 +1173,10 @@ public class JMJkEduArticleService extends BaseService {
        //如果文章需要审核且文章保存数据库成功,推送消息通知给审核的管理员
        if(isAuthentication==0&&!StringUtils.isEmpty(b)){
//            if(!StringUtils.isEmpty(articleId)){
//
//                messageDao.setMessageDel(userCode,articleId);
//            }
            if(!StringUtils.isEmpty(articleId)){
                messageDao.setMessageDel(userCode,articleId);
            }
            List<Map<String,Object>> list = null;
            if(roleType==1){
                list = doctorInfoService.getDoctorManager(operatorRoleCode);

+ 17 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/template/DoctorTeamGuidanceService.java

@ -136,13 +136,18 @@ public class DoctorTeamGuidanceService extends BaseService {
     * @throws Exception
     */
    public void modifyTeamGuidance(String doctor, String isLeader,int saveAsGuidance,Boolean isRepeat , String guidanceCode, String title,
                                     JSONArray teams, String content, String images) throws Exception {
                                     JSONArray teams, String content, String images,String labelCode) throws Exception {
//        首先身份验证
        DoctorTeamGuidanceDetail guidanceDetail = doctorTeamGuidanceDetailDao.findGuidanceDetail(guidanceCode);
        String creater = guidanceDetail.getCreater();
        Date nowDate = new Date();
        DoctorGuidanceTempLabel doctorGuidanceTempLable =  doctorGuidanceTempLableDao.findByCode(labelCode);
        String labelName = "未分组";
        if(doctorGuidanceTempLable!=null){
            labelName = doctorGuidanceTempLable.getName();
        }
//        图片地址需要处理
        String image = "";
        if (StringUtils.isNotEmpty(images)) {
@ -154,6 +159,7 @@ public class DoctorTeamGuidanceService extends BaseService {
            List<DoctorGuidanceTemp> templates = guidanceTempDao.findByTitle(doctor, title);
            DoctorGuidanceTemp doctorGuidanceTemp = new DoctorGuidanceTemp();
            if (!isRepeat) {
                doctorGuidanceTemp.setCode(getCode());
                doctorGuidanceTemp.setImagesUrl(image);
                doctorGuidanceTemp.setCreateTime(nowDate);
@ -186,7 +192,7 @@ public class DoctorTeamGuidanceService extends BaseService {
//                        直接失效原有团队模板对应关系  在重新新增以前没有的团队关系 发送次数要归0
                    if (teamList.contains(teamId)) {
//                            数据库有
                        doctorTeamGuidanceTemplateDao.modifyTeamGuidance(teamId, guidanceCode, title);
                        doctorTeamGuidanceTemplateDao.modifyTeamGuidance(teamId, guidanceCode, title,labelCode,labelName);
                    } else if (!teamList.contains(teamId)) {
                        //                        现在有,而数据库没有 要新增
                        DoctorTeamGuidanceTemplate doctorTeamGuidanceTemplate = new DoctorTeamGuidanceTemplate();
@ -199,6 +205,8 @@ public class DoctorTeamGuidanceService extends BaseService {
                        doctorTeamGuidanceTemplate.setTitle(title);
                        doctorTeamGuidanceTemplate.setTeamTemplateCode(guidanceCode);
                        doctorTeamGuidanceTemplate.setUseTimes(0);
                        doctorTeamGuidanceTemplate.setLabelCode(labelCode);
                        doctorTeamGuidanceTemplate.setLabelName(labelName);
                        doctorTeamGuidanceTemplateDao.save(doctorTeamGuidanceTemplate);
                    }
                } else {
@ -237,7 +245,7 @@ public class DoctorTeamGuidanceService extends BaseService {
//                        直接失效原有团队模板对应关系  在重新新增以前没有的团队关系 发送次数要归0
                    if (teamList.contains(teamId)) {
//                            数据库有
                        doctorTeamGuidanceTemplateDao.modifyTeamGuidance(teamId, guidanceCode, title);
                        doctorTeamGuidanceTemplateDao.modifyTeamGuidance(teamId, guidanceCode, title,labelCode,labelName);
                    } else if (!teamList.contains(teamId)) {
                        //                        现在有,而数据库没有 要新增
                        DoctorTeamGuidanceTemplate doctorTeamGuidanceTemplate = new DoctorTeamGuidanceTemplate();
@ -250,6 +258,8 @@ public class DoctorTeamGuidanceService extends BaseService {
                        doctorTeamGuidanceTemplate.setTitle(title);
                        doctorTeamGuidanceTemplate.setTeamTemplateCode(guidanceCode);
                        doctorTeamGuidanceTemplate.setUseTimes(0);
                        doctorTeamGuidanceTemplate.setLabelCode(labelCode);
                        doctorTeamGuidanceTemplate.setLabelName(labelName);
                        doctorTeamGuidanceTemplateDao.save(doctorTeamGuidanceTemplate);
                    }
                } else {
@ -421,6 +431,10 @@ public class DoctorTeamGuidanceService extends BaseService {
        jsonObject.put("createTime", createTime);
        jsonObject.put("czrq", czrq);
        jsonObject.put("teamList", teamList);
        String labelCode = doctorTeamGuidanceTemplate.get(0).getLabelCode();
        String labelName = doctorTeamGuidanceTemplate.get(0).getLabelName();
        jsonObject.put("labelCode", labelCode);
        jsonObject.put("labelName", labelName);
        return jsonObject;
    }

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

@ -16,6 +16,7 @@ import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.repository.organization.HospitalMappingDao;
import com.yihu.wlyy.repository.patient.PatientDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.app.message.MessageService;
import com.yihu.wlyy.service.common.account.PatientService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.ElasticsearchUtil;
@ -76,6 +77,8 @@ public class ThirdJkEduArticleService extends BaseService {
    private HospitalDao hospitalDao;
    @Autowired
    private MessageDao messageDao;
    @Autowired
    private MessageService messageService;
    //    private String baseUrl = "http://service.yihu.com:8085/WsPlatform/rest";
//    private String baseUrl = "http://172.17.110.230:83/WsPlatform/rest";
@ -716,7 +719,8 @@ public class ThirdJkEduArticleService extends BaseService {
     * @param ids
     * @throws Exception
     */
    public void removeArticle(String ids) throws Exception{
    @Transactional
    public void removeArticle(String ids,String receive) throws Exception{
        JSONObject json = null;
        try {
@ -729,6 +733,12 @@ public class ThirdJkEduArticleService extends BaseService {
        }
        if (!"10000".equals(json.getString("Code"))) {
            throw new Exception(json.getString("Message"));
        }else{
            String[] idsArr = ids.split(",");
            for(String one:idsArr){
                messageService.setMessageDel(receive,one);
            }
        }
    }

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

@ -7,6 +7,7 @@ import com.yihu.wlyy.entity.message.Message;
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.third.jkEduArticle.ThirdJkEduArticleService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.Api;
@ -36,6 +37,8 @@ public class DoctorMessageController extends BaseController {
    private ObjectMapper objectMapper = new ObjectMapper();
    @Autowired
    private MessageDao messageDao;
    @Autowired
    private ThirdJkEduArticleService thirdJkEduArticleService;
    @RequestMapping(value = "messages")
    @ResponseBody
@ -436,8 +439,12 @@ public class DoctorMessageController extends BaseController {
                                           @RequestParam(value = "articleId", required = true) String articleId) throws Exception {
        try {
            if(messageService.setMessageDel(getUID(),articleId)){
                return write(200, "删除成功");
                com.alibaba.fastjson.JSONObject newObj = new com.alibaba.fastjson.JSONObject();
                com.alibaba.fastjson.JSONObject jsonObject = thirdJkEduArticleService.getArticalById(articleId,getUID(),"1");
                newObj.put("roleType",jsonObject.get("roleType"));
                newObj.put("operatorRoleCode",jsonObject.get("operatorRoleCode"));
                newObj.put("operatorRoleLevel",jsonObject.get("operatorRoleLevel"));
                return write(200, "删除成功","data",newObj);
            }
            return error(-1,"删除失败");

+ 4 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/template/DoctorTeamGuidanceController.java

@ -184,7 +184,9 @@ public class DoctorTeamGuidanceController extends WeixinBaseController {
            @ApiParam(value = "是否团队长")
            @RequestParam String isLeader,
            @ApiParam(value = "图片路径")
            @RequestParam(required = false) String images) {
            @RequestParam(required = false) String images,
            @ApiParam(value = "指导标签")
            @RequestParam(required = false,defaultValue = "") String labelCode) {
        try {
//            新增修改权限,只有创建者和团队长才能修改
            String result = "";
@ -196,7 +198,7 @@ public class DoctorTeamGuidanceController extends WeixinBaseController {
                result = "个人模板标题重复";
            }
            JSONArray teams = new JSONArray(teamInfo);
            doctorTeamGuidanceService.modifyTeamGuidance(doctor, isLeader, saveAsGuidance, isRepeat, guidanceCode, title, teams, content, images);
            doctorTeamGuidanceService.modifyTeamGuidance(doctor, isLeader, saveAsGuidance, isRepeat, guidanceCode, title, teams, content, images,labelCode);
            String str = "";
            return write(200, "修改团队模板成功!", "result", result);
        } catch (Exception e) {

+ 1 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkEduArticle/ThirdJkEduArticleController.java

@ -245,7 +245,7 @@ public class ThirdJkEduArticleController extends BaseController {
            @RequestParam(value = "ids", required = true) String ids){
        try{
            thirdJkEduArticleService.removeArticle(ids);
            thirdJkEduArticleService.removeArticle(ids,getUID());
            return success("保存成功!");
        } catch (Exception e){
            e.printStackTrace();