Переглянути джерело

Merge branch 'dev_1.4.1' of http://192.168.1.220:10080/Amoy/patient-co-management into 1.4.1

Conflicts:
	patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/jimeiJkEduPC/DoctorJMJkEduArticlePCController.java
liuwenbin 7 роки тому
батько
коміт
41e57ebc44

Різницю між файлами не показано, бо вона завелика
+ 2 - 2
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/PrescriptionController.java


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

@ -1123,7 +1123,8 @@ public class JMJkEduArticleService extends BaseService {
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("patientCode", patient))
                            .must(QueryBuilders.matchQuery("firstLevelCategoryId", firstLevelCategoryId))
            );
                            .must(QueryBuilders.matchQuery("isRead", 1))
            ).size(50000);
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType).build();
            SearchResult result = jestClient.execute(search);
            List<HealthEduArticleES> dataList = result.getSourceAsObjectList(HealthEduArticleES.class);

+ 43 - 13
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/common/FileUploadController.java

@ -541,23 +541,53 @@ public class FileUploadController extends BaseController {
    @ApiOperation("编辑文章上传图片")
    @ResponseBody
    public String pushArticleList(@ApiParam(name = "file", value = "文件", required = true)
                                  @RequestParam(value = "file", required = true) MultipartFile file){
        try {
            InputStream inputStream  = file.getInputStream();
            String fileName = file.getOriginalFilename().substring(0,file.getOriginalFilename().lastIndexOf("."));
            ObjectNode imgNode = FastDFSUtil.upload(inputStream,"png",fileName);
            String fileUrl = imgNode.get("groupName").toString().replaceAll("\"","")
                    + "/" + imgNode.get("remoteFileName").toString().replaceAll("\"","");
            if(!isneiwang){
                fileUrl=fastdfs_file_url+fileUrl;
                                  @RequestParam(value = "file", required = true) MultipartFile file,
                                  HttpServletRequest request, HttpServletResponse response){
        if (isneiwang) {
            // 圖片列表
            List<String> tempPaths = new ArrayList<String>();
            try {
                MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request;
                Map<String, MultipartFile> fileMap = multipartRequest.getFileMap();
                for (Map.Entry<String, MultipartFile> entity : fileMap.entrySet()) {
                    // 上传文件
                    MultipartFile mf = entity.getValue();
                    InputStream inputStream  = mf.getInputStream();
                    String fileName = mf.getOriginalFilename().substring(0,mf.getOriginalFilename().lastIndexOf("."));
                    ObjectNode imgNode = FastDFSUtil.upload(inputStream,"png",fileName);
                    com.alibaba.fastjson.JSONObject json = com.alibaba.fastjson.JSONObject.parseObject(imgNode.toString());
                    tempPaths.add(json.getString("fid"));
                }
                String urls = "";
                for (String image : tempPaths) {
                    if (urls.length() == 0) {
                        urls = image;
                    } else {
                        urls += "," + image;
                    }
                }
                JSONObject json = new JSONObject();
                json.put("status", 200);
                json.put("msg", "上传成功");
                json.put("data", urls);
                logger.info
                        ("图片上传:" + json.toString());
                return json.toString();
            } catch (Exception e) {
                error(e);
                return error(-1, "上传失败");
            }
            return write(200,"上传成功!","data",fileUrl);
        }catch (Exception e) {
            e.printStackTrace();
            return error(-1,"失败!");
        } else {
            String result  = CommonUtil.toNeiWang(request, response);
            logger.info
                    ("fastDFSImag reslt :" + result);
            return CommonUtil.toNeiWang(request, response);
        }
    }
    /**
     * 图片上传
     *

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

@ -3,6 +3,7 @@ package com.yihu.wlyy.web.doctor.jimeiJkEduPC;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.es.entity.HealthEduArticleES;
import com.yihu.wlyy.service.app.health.HealthEduArticleLabelService;
import com.yihu.wlyy.service.jimeiJkEdu.JMJkEduArticleService;
import com.yihu.wlyy.util.ElasticsearchUtil;
import com.yihu.wlyy.web.BaseController;
@ -40,6 +41,9 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
    @Autowired
    private ElasticsearchUtil elasticsearchUtil;
    @Autowired
    private HealthEduArticleLabelService healthEduArticleLabelService;
    @RequestMapping(value = "saveArticle", method = RequestMethod.POST)
    @ApiOperation("添加、编辑文章")
    public  String saveArticle(@ApiParam(name = "articleId", value = "文章Id")
@ -138,6 +142,10 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
            JSONObject response = jmJkEduArticleService.queryArticlePcList(firstLevelCategoryId,secondLevelCategoryId,insertTimeStart,insertTimeEnd,articlelevel,articleTitle,
                    getUID(),currentUserRole,currentUserRoleLevel,isAuthentication,isMyArticle,page,pageSize,sEcho,roleType);
            if(StringUtils.isNotBlank(articleTitle)){
                //记录搜索记录
                healthEduArticleLabelService.saveOrUpdateLabel(articleTitle,getUID());
            }
            //判断文章列表是否有推送过该居民
            if(StringUtils.isNotBlank(patient)){
@ -149,7 +157,7 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
                        articleids.add(pushresponse.getJSONObject(i).getString("articleId"));
                    }
                }
                StringBuffer sql3 = null;
                
                JSONArray datas = response.getJSONArray("aaData");
                if(datas.size() > 0 && !articleids.isEmpty()){
                    for (int i = 0; i < datas.size(); i++) {
@ -159,10 +167,6 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
                        }else{
                            datas.getJSONObject(i).put("ispush","0");
                        }
//                        sql3 = new StringBuffer();
//                        sql3.append("SELECT COUNT(*) as num FROM "+esType+" WHERE  userType=2 AND articleId='"+dataarticleid+"'");
//                        Long num = elasticsearchUtil.excuteForLong(sql3.toString(), esType, esIndex);
//                        datas.getJSONObject(i).put("ispush","0");
                    }
                    response.put("aaData",datas);
                }
@ -178,23 +182,23 @@ 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){
                                      @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 {
@ -213,14 +217,14 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
    public  String saveOrUpdateArticleQR(
//                                        @ApiParam(name = "currentRoleLevel", value = "当前登录角色的级别")
//                                         @RequestParam(value = "currentRoleLevel", required = true) String currentRoleLevel,
            @ApiParam(name = "identification", value = "认证标识文字")
            @RequestParam(value = "identification", required = false) String identification,
            @ApiParam(name = "position", value = "位置")
            @RequestParam(value = "position", required = false) Integer position,
            @ApiParam(name = "imgUrl", value = "二维码图片地址")
            @RequestParam(value = "imgUrl", required = false) String imgUrl,
            @ApiParam(name = "id", value = "认证标识id")
            @RequestParam(value = "id", required = false) Integer id){
                                         @ApiParam(name = "identification", value = "认证标识文字")
                                         @RequestParam(value = "identification", required = false) String identification,
                                         @ApiParam(name = "position", value = "位置")
                                         @RequestParam(value = "position", required = false) Integer position,
                                         @ApiParam(name = "imgUrl", value = "二维码图片地址")
                                         @RequestParam(value = "imgUrl", required = false) String imgUrl,
                                         @ApiParam(name = "id", value = "认证标识id")
                                         @RequestParam(value = "id", required = false) Integer id){
        try{
            jmJkEduArticleService.saveOrUpdateArticleQR(getCurrentRoleLevel(),getCurrentRoleCode(),position,imgUrl,getUID(),id,identification);
@ -234,17 +238,17 @@ public class DoctorJMJkEduArticlePCController extends BaseController {
    @RequestMapping(value = "authenticationArticle", method = RequestMethod.POST)
    @ApiOperation("文章认证")
    public  String authenticationArticle(@ApiParam(name = "articleId", value = "文章id,多个文章‘,’隔开")
                                         @RequestParam(value = "articleId", required = true) String articleId,
                                         @ApiParam(name = "isAuthentication", value = "认证,0取消认证,1认证")
                                         @RequestParam(value = "isAuthentication", required = true) String isAuthentication,
                                         @ApiParam(name = "firstLevelCategoryId", value = "文章一级分类")
                                         @RequestParam(value = "firstLevelCategoryId", required = false) String firstLevelCategoryId,
                                         @ApiParam(name = "firstLevelCategoryName", value = "文章一级分类名称")
                                         @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 = false) String secondLevelCategoryName){
                                          @RequestParam(value = "articleId", required = true) String articleId,
                                          @ApiParam(name = "isAuthentication", value = "认证,0取消认证,1认证")
                                          @RequestParam(value = "isAuthentication", required = true) String isAuthentication,
                                          @ApiParam(name = "firstLevelCategoryId", value = "文章一级分类")
                                          @RequestParam(value = "firstLevelCategoryId", required = false) String firstLevelCategoryId,
                                          @ApiParam(name = "firstLevelCategoryName", value = "文章一级分类名称")
                                          @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 = false) String secondLevelCategoryName){
        try{
            jmJkEduArticleService.authenticationArticle(articleId,isAuthentication,firstLevelCategoryId,firstLevelCategoryName,secondLevelCategoryId,secondLevelCategoryName);
            return success("认证成功!");