Bladeren bron

集美宣教代码提交

liuwenbin 7 jaren geleden
bovenliggende
commit
79d33976f2

+ 9 - 0
common/common-entity/src/main/java/com/yihu/es/entity/HealthEduArticlePatient.java

@ -55,6 +55,7 @@ public class HealthEduArticlePatient {
    private List<Patient> patients;//被推送文章的患者
    private String operatorId;//文章作者Id
    private List<RoleVo> roleList;//发送者角色
    private String leaveWords;//医生留言
    public String getId() {
        return id;
@ -328,4 +329,12 @@ public class HealthEduArticlePatient {
    public void setRoleList(List<RoleVo> roleList) {
        this.roleList = roleList;
    }
    public String getLeaveWords() {
        return leaveWords;
    }
    public void setLeaveWords(String leaveWords) {
        this.leaveWords = leaveWords;
    }
}

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

@ -220,7 +220,8 @@ public class JMJkEduArticleService extends BaseService {
                                                  Integer sendType,
                                                  String sendMessage,
                                                  Long teamId,
                                                  String articleId) throws Exception {
                                                  String articleId,
                                                  String leaveWords) throws Exception {
        String batchNo = UUID.randomUUID().toString();
@ -278,7 +279,7 @@ public class JMJkEduArticleService extends BaseService {
        healthEduArticlePatient.setSendName(sendName);
        healthEduArticlePatient.setSendType(2);
        healthEduArticlePatient.setAdminTeamCode(teamId);
        healthEduArticlePatient.setLeaveWords(leaveWords);
        if (doctor != null) {
            healthEduArticlePatient.setDoctorName(doctor.getName());
            healthEduArticlePatient.setHospital(doctor.getHospital());
@ -463,14 +464,13 @@ public class JMJkEduArticleService extends BaseService {
                whereSql += " (l.label_type = 1 AND l.label in (" + labelDisease + "))) ";
            }
        }
        tableSql += " left join wlyy_patient p on p.code=w.patient ";
        tableSql += " left join wlyy_patient p on p.code=w.patient AND p.openid IS NOT NULL and p.openid <>''";
        if (!StringUtils.isEmpty(labelSex)) {
            whereSql += " and p.sex in (" + labelSex + ") ";
        }
        if (!StringUtils.isEmpty(labelUnit)) {
            whereSql += " and w.hospital in (" + labelUnit + ") ";
        }
        whereSql += " and p.openid is not null ";
        List<String> groupPatient = jdbcTemplate.queryForList(tableSql + whereSql, String.class);
        patientSet.addAll(groupPatient);
    }
@ -852,13 +852,35 @@ public class JMJkEduArticleService extends BaseService {
//        if(doctor.getLevel()==10){
//            isManage = true;
//        }
        if(isMyArticle==null||(isMyArticle!=null&&!isMyArticle)){
            userCode = null;
        }
        return thirdJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,
//        if(isMyArticle==null||(isMyArticle!=null&&!isMyArticle)){
//            userCode = null;
//        }
        return thirdJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,isMyArticle,
                articleTitle,userCode,isAuthentication,currentUserRole,currentUserRoleLevel,page,pageSize,sEcho);
    }
    /**
     * 文章认证列表
     * @param firstLevelCategoryId
     * @param secondLevelCategoryId
     * @param insertTimeStart
     * @param insertTimeEnd
     * @param articleTitle
     * @param currentUserRole
     * @param currentUserRoleLevel
     * @param isAuthentication
     * @param page
     * @param pageSize
     * @param sEcho
     * @return
     * @throws Exception
     */
    public JSONObject authenArticlePCList(String firstLevelCategoryId, String secondLevelCategoryId, String insertTimeStart, String insertTimeEnd, String articleTitle,
                                         String currentUserRole, String currentUserRoleLevel, String isAuthentication,Integer page, Integer pageSize,Integer sEcho) throws Exception{
        return thirdJkEduArticleService.authenArticlePCList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,
                articleTitle,isAuthentication,currentUserRole,currentUserRoleLevel,page,pageSize,sEcho);
    }
    /**
     * 保存或更新 认证标识
     * @param currentRoleLevel

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

@ -77,6 +77,7 @@ public class ThirdJkEduArticleService extends BaseService {
    private String queryArticlePcList = "JkEdu.Article.queryArticlePcList";//PC端获取文章列表
    private String authenticationArticle = "JkEdu.Article.authenticationArticle";//文章认证
    private String removeArticle = "JkEdu.Article.removeArticle";//删除文章
    private String authenArticlePCList = "JkEdu.Article.authenArticlePCList";//文章认证列表
    /*********************************************** Category ******************************************/
    private String getCategoryList = "JkEdu.Category.getCategoryList";//获取类别接口
    private String addCategory = "JkEdu.Category.addCategory";//新增类别接口
@ -442,7 +443,7 @@ public class ThirdJkEduArticleService extends BaseService {
     * @return
     * @throws Exception
     */
    public JSONObject queryArticlePcList(String firstLevelCategoryId,String secondLevelCategoryId,String insertTimeStart,String insertTimeEnd,String articlelevel,
    public JSONObject queryArticlePcList(String firstLevelCategoryId,String secondLevelCategoryId,String insertTimeStart,String insertTimeEnd,String articlelevel,Boolean isMyArticle,
                                        String articleTitle,String userCode,String isAuthentication,String currentUserRole,String currentUserRoleLevel,Integer page,Integer pageSize,Integer sEcho) throws Exception {
        String response = "";
@ -462,6 +463,7 @@ public class ThirdJkEduArticleService extends BaseService {
            param.put("page", page+"");
            param.put("pageSize", pageSize+"");
            param.put("sEcho", sEcho);
            param.put("isMyArticle", isMyArticle);
            response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(queryArticlePcList, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
@ -475,7 +477,55 @@ public class ThirdJkEduArticleService extends BaseService {
    }
    /**
     *
     * 文章认证列表
     * @param firstLevelCategoryId
     * @param secondLevelCategoryId
     * @param insertTimeStart
     * @param insertTimeEnd
     * @param articlelevel
     * @param articleTitle
     * @param userCode
     * @param isAuthentication
     * @param currentUserRole
     * @param currentUserRoleLevel
     * @param page
     * @param pageSize
     * @param sEcho
     * @return
     * @throws Exception
     */
    public JSONObject authenArticlePCList(String firstLevelCategoryId,String secondLevelCategoryId,String insertTimeStart,String insertTimeEnd,
                                         String articleTitle,String isAuthentication,String currentUserRole,String currentUserRoleLevel,Integer page,Integer pageSize,Integer sEcho) throws Exception {
        String response = "";
        JSONObject json = null;
        try {
            JSONObject param = new JSONObject();
            param.put("firstLevelCategoryId", firstLevelCategoryId);
            param.put("secondLevelCategoryId", secondLevelCategoryId);
            param.put("insertTimeStart", insertTimeStart);
            param.put("insertTimeEnd", insertTimeEnd);
            param.put("articleTitle", articleTitle);
            param.put("isAuthentication", isAuthentication);
            param.put("currentUserRole", currentUserRole);
            param.put("currentUserRoleLevel", currentUserRoleLevel);
            param.put("page", page+"");
            param.put("pageSize", pageSize+"");
            param.put("sEcho", sEcho);
            response = httpClientUtil.httpPost(articleBaseUrl+"/WsPlatform/rest", getParamsMap(authenArticlePCList, param.toString(), "1"));
            json = JSON.parseObject(response);
        } catch (Exception e) {
            e.printStackTrace();
        }
        if ("10000".equals(json.getString("Code"))) {
            return json;
        } else {
            throw new Exception(json.getString("Message"));
        }
    }
    /**
     * 认证文章
     * @return
     */
    public void authenticationArticle(String articleId,String isAuthentication,String firstLevelCategoryId,String firstLevelCategoryName,String secondLevelCategoryId,String secondLevelCategoryName) throws Exception{

+ 13 - 10
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEdu/DoctorJMJkEduArticleController.java

@ -112,7 +112,8 @@ public class DoctorJMJkEduArticleController extends BaseController {
            @ApiParam(name = "labelServeType", value = "标签类型  3:服务类型,多个用逗号分隔", required = false) @RequestParam(value = "labelServeType", required = false, defaultValue = "") String labelServeType,
            @ApiParam(name = "labelDiseaseType", value = "标签类型  4:疾病类型,多个用逗号分隔", required = false) @RequestParam(value = "labelDiseaseType", required = false, defaultValue = "") String labelDiseaseType,
            @ApiParam(name = "labelHealthType", value = "标签类型  5:健康情况,多个用逗号分隔", required = false) @RequestParam(value = "labelHealthType", required = false, defaultValue = "") String labelHealthType,
            @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
    ){
        try {
@ -121,7 +122,7 @@ public class DoctorJMJkEduArticleController extends BaseController {
            jmJkEduArticleService.initPatient(patientSet,labelUnitType,labelSexType,labelServeType,labelDiseaseType,labelHealthType,getUID());
//            patientSet.add(patientService.findByCode("wjw00000001000e6badcfa163e424525"));
            //获取保存发送记录
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 2,"", 0L, articleId);
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 2,"", 0L, articleId,leaveWords);
            //推送微信模板消息和发送im消息
            new Thread(() -> {
                //发送任务到redis
@ -241,7 +242,8 @@ public class DoctorJMJkEduArticleController extends BaseController {
                                              @RequestParam(value = "group", required = false, defaultValue = "") String group,
                                              @RequestParam(value = "labelType", required = false) String labelType,
                                              @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){
        try {
            if (StringUtils.isEmpty(code)) {
@ -265,7 +267,7 @@ public class DoctorJMJkEduArticleController extends BaseController {
            if (patientSet.size() == 0) {
                return new BaseResultModel("请至少选择一个患者!");
            }
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 1,"", teamCode, articleId);
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 1,"", teamCode, articleId,leaveWords);
            //推送微信模板消息和发送im消息
            new Thread(() -> {
                //发送任务到redis
@ -282,13 +284,14 @@ public class DoctorJMJkEduArticleController extends BaseController {
    @ApiOperation("医生文章单个患者推送")
    public BaseResultModel doctorSendArticleToSingle(
            @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){
        try {
            Set<String> patientSet = new HashSet<>(); //放入set中可以去重复
            //得到需要发送的患者
            patientSet.add(patientCode);
//            jmJkEduArticleService.initPatients(patientSet,labelType,condition,groupType,teamId,getUID());
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 1,"", 0L, articleId);
            HealthEduArticlePatient healthEduArticlePatient = jmJkEduArticleService.saveArticle(patientSet, getUID(), 1,"", 0L, articleId,leaveWords);
            //推送微信模板消息和发送im消息
            new Thread(() -> {
                //发送任务到redis
@ -338,8 +341,8 @@ public class DoctorJMJkEduArticleController extends BaseController {
                                      @RequestParam(value = "articleTitle", required = false) String articleTitle,
                                      @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 = "currentUserRoleLevel", value = "当前登录的角色级别")
                                      @RequestParam(value = "currentUserRoleLevel", required = false )String currentUserRoleLevel,
                                      @ApiParam(name = "isAuthentication", value = "是否认证")
                                      @RequestParam(value = "isAuthentication", required = false) String isAuthentication,
                                      @ApiParam(name = "isMyArticle", value = "是否过滤我的文章")
@ -352,8 +355,8 @@ public class DoctorJMJkEduArticleController extends BaseController {
            com.alibaba.fastjson.JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,articleTitle,
                    getUID(),currentUserRole,currentUserRoleLevel,isAuthentication,isMyArticle,page,pageSize);
            com.alibaba.fastjson.JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId, secondLevelCategoryId, insertTimeStart, insertTimeEnd, articlelevel, articleTitle,
                    "0de7295862dd11e69faffa163e8aee56", currentUserRole, currentUserRoleLevel, isAuthentication, isMyArticle, page, pageSize,null);
            return write(200,"查询成功!","data",response);
        } catch (Exception e){

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

@ -114,6 +114,39 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
        }
    }
    @RequestMapping(value = "authenArticlePCList", method = RequestMethod.GET)
    @ApiOperation("查询pc端文章认证列表")
    public  String authenArticlePCList(@ApiParam(name = "firstLevelCategoryId", value = "文章一级分类")
                                      @RequestParam(value = "firstLevelCategoryId", required = false) String firstLevelCategoryId,
                                      @ApiParam(name = "secondLevelCategoryId", value = "文章二级分类")
                                      @RequestParam(value = "secondLevelCategoryId", required = false) String secondLevelCategoryId,
                                      @ApiParam(name = "insertTimeStart", value = "新增文章开始时间")
                                      @RequestParam(value = "insertTimeStart", required = false) String insertTimeStart,
                                      @ApiParam(name = "insertTimeEnd", value = "新增文章结束时间")
                                      @RequestParam(value = "insertTimeEnd", required = false) String insertTimeEnd,
                                      @ApiParam(name = "articleTitle", value = "文章标题关键字")
                                      @RequestParam(value = "articleTitle", required = false) String articleTitle,
                                      @ApiParam(name = "isAuthentication", value = "是否认证")
                                      @RequestParam(value = "isAuthentication", required = false) String isAuthentication,
                                      @ApiParam(name = "iDisplayStart", value = "当前页")
                                      @RequestParam(value = "iDisplayStart", required = true) Integer page,
                                      @ApiParam(name = "iDisplayLength", value = "是否过滤我的文章")
                                      @RequestParam(value = "iDisplayLength", required = true) Integer pageSize,
                                      @ApiParam(name = "sEcho", value = "插件自带")
                                      @RequestParam(value = "sEcho", required = false) Integer sEcho){
        try {
            JSONObject response = jmJkEduArticleService.authenArticlePCList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articleTitle,
                    getCurrentRoleCode(),getCurrentRoleLevel(),isAuthentication,page,pageSize,sEcho);
            return write(200,"查询成功!","data",response);
        } catch (Exception e){
            e.printStackTrace();
            return error(-1,"查询失败!");
        }
    }
    @RequestMapping(value = "saveOrUpdateArticleQR", method = RequestMethod.POST)
    @ApiOperation("保存或更新认证标识")
    public  String saveOrUpdateArticleQR(
@ -146,11 +179,11 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
                                          @ApiParam(name = "firstLevelCategoryId", value = "文章一级分类")
                                          @RequestParam(value = "firstLevelCategoryId", required = false) String firstLevelCategoryId,
                                          @ApiParam(name = "firstLevelCategoryName", value = "文章一级分类名称")
                                          @RequestParam(value = "firstLevelCategoryName", required = true) String firstLevelCategoryName,
                                          @RequestParam(value = "firstLevelCategoryName", required = false) String firstLevelCategoryName,
                                          @ApiParam(name = "secondLevelCategoryId", value = "文章二级分类")
                                          @RequestParam(value = "secondLevelCategoryId", required = false) String secondLevelCategoryId,
                                          @ApiParam(name = "secondLevelCategoryName", value = "文章二级分类名称")
                                          @RequestParam(value = "secondLevelCategoryName", required = true) String secondLevelCategoryName){
                                          @RequestParam(value = "secondLevelCategoryName", required = false) String secondLevelCategoryName){
        try{
            jmJkEduArticleService.authenticationArticle(articleId,isAuthentication,firstLevelCategoryId,firstLevelCategoryName,secondLevelCategoryId,secondLevelCategoryName);
            return success("认证成功!");

+ 6 - 5
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/service/GcLabelService.java

@ -255,18 +255,19 @@ public class GcLabelService {
        }
        String roleSql = !StringUtils.isEmpty(role+"")?role.substring(1):"";
        String whereSql = "";
        String resultSql="";
        if(StringUtils.isEmpty(roleSql)){
            switch (level){
                case 1:{whereSql+=" and province in ("+role+")" ;break;}
                case 2:{whereSql+=" and city in ("+role+")" ;break;}
                case 3:{whereSql+=" and town in ("+role+")" ;break;}
                case 4:{whereSql+=" and code in ("+role+")" ;break;}
                case 1:{whereSql+=" and province in ("+role+") group by city,city_name " ;resultSql=" DISTINCT(city) as code,DISTINCT(city_name) as name ";break;}
                case 2:{whereSql+=" and city in ("+role+") group by town,town_name " ;resultSql=" DISTINCT(town) as code,DISTINCT(town_name) as name ";break;}
                case 3:{whereSql+=" and town in ("+role+") group by code,name " ;resultSql=" DISTINCT(code) as code,DISTINCT(name) as name ";break;}
                case 4:return new ArrayList<>();
            }
        }
        String sql = "select code, name  from dm_hospital  where level=2 "+whereSql ;
        String sql = "select "+resultSql+"  from dm_hospital  where level=2 "+whereSql ;
        List<DictModel> returnList = jdbcTemplate.query(sql, new BeanPropertyRowMapper(DictModel.class));
        return returnList;
    }