chenweida 7 rokov pred
rodič
commit
e999cf6623

+ 5 - 2
common/common-entity/src/main/java/com/yihu/es/entity/HealthEduArticleES.java

@ -1,5 +1,6 @@
package com.yihu.es.entity;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.yihu.wlyy.entity.patient.Patient;
import io.searchbox.annotations.JestId;
@ -34,8 +35,8 @@ public class HealthEduArticleES {
    private String town; // 所属区划(ES)
    private String townName; // 所属区划(ES)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
    @CreatedDate
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXX")
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
    private Date createTime;  // 创建时间(ES:必填)
    private Integer sendType;//发送类型 1医生发送 2(管理员)卫纪委发送(ES:必填)
    private String sendLevel;   // 发送人级别  1专科医生,2全科医生,3健康管理师 4 管理员(ES)
@ -69,6 +70,8 @@ public class HealthEduArticleES {
    //说明:如医生推送文章给5个居民,则保存5条userType=1的记录和1条userType=2的记录(共6条)
    //业务需求:userType=1为居民被推送文章列表;userType=2医生推送的文章列表;
    private Integer userType; // 1、患者,2医生(ES:必填)
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXX")
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
    private Date czrq;//阅读时间(默认为空,isRead=0;如isRead=1已读,则该字段有值)(ES:非必填)
    public String getId() {

+ 57 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/util/ElasticsearchUtil.java

@ -8,6 +8,7 @@ import com.yihu.wlyy.entity.patient.Patient;
import com.yihu.wlyy.web.quota.vo.SaveModel;
import org.apache.commons.lang3.StringUtils;
import org.elasticsearch.action.search.SearchResponse;
import org.elasticsearch.client.Client;
import org.nlpcn.es4sql.domain.Select;
import org.nlpcn.es4sql.jdbc.ObjectResult;
import org.nlpcn.es4sql.jdbc.ObjectResultsExtractor;
@ -27,9 +28,7 @@ import java.sql.Timestamp;
import java.text.DateFormat;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.*;
/**
 * Created by chenweida on 2017/7/17.
@ -1313,4 +1312,59 @@ public class ElasticsearchUtil {
        }
        return resultLevel;
    }
    public List<Map<String, Object>> excuteDataModel(String sql) {
        List<Map<String, Object>> returnModels = new ArrayList<>();
        try {
            SQLExprParser parser = new ElasticSqlExprParser(sql);
            SQLExpr expr = parser.expr();
            SQLQueryExpr queryExpr = (SQLQueryExpr) expr;
//            if (parser.getLexer().token() != Token.EOF) {
//                throw new ParserException("illegal sql expr : " + sql);
//            }
            Select select = null;
            select = new SqlParser().parseSelect(queryExpr);
            //通过抽象语法树,封装成自定义的Select,包含了select、from、where group、limit等
            AggregationQueryAction action = null;
            DefaultQueryAction queryAction = null;
            SqlElasticSearchRequestBuilder requestBuilder = null;
            if (select.isAgg) {
                //包含计算的的排序分组的
                action = new AggregationQueryAction(elasticFactory.getTransportClient(), select);
                requestBuilder = action.explain();
            } else {
                //封装成自己的Select对象
                Client client = elasticFactory.getTransportClient();
                queryAction = new DefaultQueryAction(client, select);
                requestBuilder = queryAction.explain();
            }
            SearchResponse response = (SearchResponse) requestBuilder.get();
            Object queryResult = null;
            if (sql.toUpperCase().indexOf("GROUP") != -1 || sql.toUpperCase().indexOf("SUM") != -1) {
                queryResult = response.getAggregations();
            } else {
                queryResult = response.getHits();
            }
            ObjectResult temp = new ObjectResultsExtractor(true, true, true).extractResults(queryResult, true);
            List<String> heads = temp.getHeaders();
            temp.getLines().stream().forEach(one -> {
                try {
                    Map<String, Object> oneMap = new HashMap<String, Object>();
                    for (int i = 0; i < one.size(); i++) {
                        String key = null;
                        Object value = one.get(i);
                        key = heads.get(i);
                        oneMap.put(key, value);
                    }
                    returnModels.add(oneMap);
                } catch (Exception e) {
                    e.printStackTrace();
                }
            });
        } catch (Exception e) {
            e.printStackTrace();
        }
        return returnModels;
    }
}

+ 96 - 101
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/jkedu/service/EduArticleService.java

@ -114,9 +114,9 @@ public class EduArticleService {
        List<NewCategoryModel> secondList = jkeduCategoryDao.findCategory(2);
        String firstId = "";
        String firstName = "健康文章";
        if (firstList!=null && firstList.size()>0){
            for (NewCategoryModel newCategoryModel : firstList){
                if (newCategoryModel.getCategoryName().contains(firstName)){
        if (firstList != null && firstList.size() > 0) {
            for (NewCategoryModel newCategoryModel : firstList) {
                if (newCategoryModel.getCategoryName().contains(firstName)) {
                    firstId = newCategoryModel.getCategoryId();
                }
            }
@ -161,9 +161,9 @@ public class EduArticleService {
                            newArticleModel.setRoleType(2);
                            newArticleModel.setUserScope(1);
                            newArticleModel.setIsOld(1);
                            if (secondList!=null && secondList.size()>0){
                                for (NewCategoryModel newCategoryModel : secondList){
                                    if (newCategoryModel.getCategoryName().equals(newArticleModel.getKeyWord())){
                            if (secondList != null && secondList.size() > 0) {
                                for (NewCategoryModel newCategoryModel : secondList) {
                                    if (newCategoryModel.getCategoryName().equals(newArticleModel.getKeyWord())) {
                                        newArticleModel.setSecondLevelCategoryId(newCategoryModel.getCategoryId());
                                        newArticleModel.setSecondLevelCategoryName(newCategoryModel.getCategoryName());
                                    }
@ -359,9 +359,9 @@ public class EduArticleService {
            List<NewCategoryModel> secondList = jkeduCategoryDao.findCategory(2);
            String firstId = "";
            String firstName = "健康文章";
            if (firstList!=null && firstList.size()>0){
                for (NewCategoryModel newCategoryModel : firstList){
                    if (newCategoryModel.getCategoryName().contains(firstName)){
            if (firstList != null && firstList.size() > 0) {
                for (NewCategoryModel newCategoryModel : firstList) {
                    if (newCategoryModel.getCategoryName().contains(firstName)) {
                        firstId = newCategoryModel.getCategoryId();
                    }
                }
@ -369,13 +369,13 @@ public class EduArticleService {
            //5.查询出根据batch_no聚合后的每个批次号的数量
            String batchNoCountSql = "SELECT batch_no,COUNT(*) batchCount FROM wlyy_health_edu_article_patient_copy where admin_team_code IS NOT NULL AND  batch_no IS NOT NULL GROUP BY batch_no ";
            List<Map<String,Object>> batchNoCountMapList = jdbcTemplate.queryForList(batchNoCountSql);
            List<Map<String, Object>> batchNoCountMapList = jdbcTemplate.queryForList(batchNoCountSql);
            //6.清洗数据
            flag = CleanDateToEs(doctorMap,articleMap,wjwCode,firstId,firstName,secondList,batchNoCountMapList);
            flag = CleanDateToEs(doctorMap, articleMap, wjwCode, firstId, firstName, secondList, batchNoCountMapList);
        }catch (Exception e){
        } catch (Exception e) {
            e.printStackTrace();
            flag = false;
        }
@ -384,6 +384,7 @@ public class EduArticleService {
    /**
     * 清洗数据到es
     *
     * @param doctorMap
     * @param articleMap
     * @param wjwCode
@ -394,7 +395,7 @@ public class EduArticleService {
     * @return
     * @throws Exception
     */
    public boolean CleanDateToEs(Map<String,Doctor> doctorMap,Map<String,HealthEduArticle> articleMap,String wjwCode,String firstId,String firstName,List<NewCategoryModel> secondList,List<Map<String,Object>> batchNoCountMapList)throws Exception{
    public boolean CleanDateToEs(Map<String, Doctor> doctorMap, Map<String, HealthEduArticle> articleMap, String wjwCode, String firstId, String firstName, List<NewCategoryModel> secondList, List<Map<String, Object>> batchNoCountMapList) throws Exception {
        boolean flag = true;
        //1.查询es最新的时间记录
        String timeSql = "select createTime from " + esType + " order by createTime desc limit 0,1";
@ -447,7 +448,7 @@ public class EduArticleService {
                        HealthEduArticleES healthEduArticleES = new HealthEduArticleES();
                        //Map转对象
                        healthEduArticleES = MapListUtils.convertMap2Bean(map, HealthEduArticleES.class);
                        healthEduArticleES = setDateToObj(healthEduArticleES, doctorMap, articleMap, wjwCode, 1,firstId,firstName,secondList,batchNoCountMapList);
                        healthEduArticleES = setDateToObj(healthEduArticleES, doctorMap, articleMap, wjwCode, 1, firstId, firstName, secondList, batchNoCountMapList);
                        if (StringUtils.isEmpty(healthEduArticleES.getDoctorName())) {
                            healthEduArticleES.setDoctorCode(wjwCode);
                            //卫计委发送
@ -468,7 +469,7 @@ public class EduArticleService {
        List<Map<String, Object>> batchNoMap = jdbcTemplate.queryForList(batSql);
        List<String> batchNoList = new ArrayList<>();
        if (batchNoMap != null && batchNoMap.size() > 0) {
            for (Map<String,Object> map : batchNoMap){
            for (Map<String, Object> map : batchNoMap) {
                batchNoList.add(String.valueOf(map.get("batch_no")));
            }
            deleteData(2, batchNoList);
@ -500,7 +501,7 @@ public class EduArticleService {
                healthEduArticleES.setNewArricleFlag(false);
                //Map转对象
                healthEduArticleES = MapListUtils.convertMap2Bean(map, HealthEduArticleES.class);
                healthEduArticleES = setDateToObj(healthEduArticleES, doctorMap, articleMap, wjwCode, 2,firstId,firstName,secondList,batchNoCountMapList);
                healthEduArticleES = setDateToObj(healthEduArticleES, doctorMap, articleMap, wjwCode, 2, firstId, firstName, secondList, batchNoCountMapList);
                if (StringUtils.isEmpty(healthEduArticleES.getDoctorName())) {
                    healthEduArticleES.setDoctorCode(wjwCode);
                    //卫计委发送
@ -518,6 +519,7 @@ public class EduArticleService {
    /**
     * 封装Es存储对象
     *
     * @param healthEduArticleES
     * @param doctorMap
     * @param articleMap
@ -532,8 +534,8 @@ public class EduArticleService {
     */
    public HealthEduArticleES setDateToObj(HealthEduArticleES healthEduArticleES, Map<String, Doctor> doctorMap,
                                           Map<String, HealthEduArticle> articleMap, String wjwCode,
                                           Integer userType,String firstId,String firstName,
                                           List<NewCategoryModel> secondList,List<Map<String,Object>> batchNoCountMapList) throws Exception {
                                           Integer userType, String firstId, String firstName,
                                           List<NewCategoryModel> secondList, List<Map<String, Object>> batchNoCountMapList) throws Exception {
        //遍历医生
        Set<Map.Entry<String, Doctor>> doctorSet = doctorMap.entrySet();
        for (Map.Entry<String, Doctor> doctorEntry : doctorSet) {
@ -560,16 +562,16 @@ public class EduArticleService {
                HealthEduArticle healthEduArticle = articleEntry.getValue();
                healthEduArticleES.setArticleId(healthEduArticle.getCode());
                healthEduArticleES.setArticleTitle(healthEduArticle.getTitle());
                if (healthEduArticle.getContent().length()>=100){
                    healthEduArticleES.setArticleContent(healthEduArticle.getContent().substring(0,100));
                }else {
                if (healthEduArticle.getContent().length() >= 100) {
                    healthEduArticleES.setArticleContent(healthEduArticle.getContent().substring(0, 100));
                } else {
                    healthEduArticleES.setArticleContent(healthEduArticle.getContent());
                }
                healthEduArticleES.setFirstLevelCategoryId(firstId);
                healthEduArticleES.setFirstLevelCategoryName(firstName);
                if (secondList!=null && secondList.size()>0){
                    for (NewCategoryModel newCategoryModel : secondList){
                        if (newCategoryModel.getCategoryName().equals(healthEduArticle.getKeyword())){
                if (secondList != null && secondList.size() > 0) {
                    for (NewCategoryModel newCategoryModel : secondList) {
                        if (newCategoryModel.getCategoryName().equals(healthEduArticle.getKeyword())) {
                            healthEduArticleES.setSecondLevelCategoryId(newCategoryModel.getCategoryId());
                            healthEduArticleES.setSecondLevelCategoryName(newCategoryModel.getCategoryName());
                        }
@ -579,25 +581,25 @@ public class EduArticleService {
            }
        }
        //替换已读数据code
        if (userType==1){
        if (userType == 1) {
            //数据库中的isRead 0已读,1未读--->Es中isRead 0未读 1已读
            if (healthEduArticleES.getIsRead()==0){
            if (healthEduArticleES.getIsRead() == 0) {
                healthEduArticleES.setIsRead(1);
            }else{
            } else {
                healthEduArticleES.setCzrq(null);
                healthEduArticleES.setIsRead(0);
            }
        }
        //算出allCount
        if (batchNoCountMapList!=null && batchNoCountMapList.size()>0){
            for (Map<String,Object> map : batchNoCountMapList){
                if (healthEduArticleES.getBatchNo().equals(String.valueOf(map.get("batch_no")))){
        if (batchNoCountMapList != null && batchNoCountMapList.size() > 0) {
            for (Map<String, Object> map : batchNoCountMapList) {
                if (healthEduArticleES.getBatchNo().equals(String.valueOf(map.get("batch_no")))) {
                    healthEduArticleES.setAllCount(Integer.valueOf(String.valueOf(map.get("batchCount"))));
                }
            }
        }
        //如果是医生推送
        if (!StringUtils.isEmpty(healthEduArticleES.getDoctorName())){
        if (!StringUtils.isEmpty(healthEduArticleES.getDoctorName())) {
            //List<DoctorRole> roleList = doctorRoleDao.findUserRole(healthEduArticleES.getDoctorCode());
            int resultLevel = 4;
            /*if (roleList != null && roleList.size() > 0) {
@ -609,7 +611,7 @@ public class EduArticleService {
            }*/
            healthEduArticleES.setCurrentUserRoleCode(healthEduArticleES.getHospital());
            healthEduArticleES.setCurrentUserRoleLevel(String.valueOf(resultLevel));
        }else{
        } else {
            healthEduArticleES.setCurrentUserRoleCode(wjwCode);
            healthEduArticleES.setCurrentUserRoleLevel("2");
        }
@ -750,27 +752,23 @@ public class EduArticleService {
        JestClient jestClient = null;
        try {
            jestClient = elasticFactory.getJestClient();
            Integer i=0;
            //先根据条件查找出来
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            searchSourceBuilder.query(
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("quotaCode", doctorCode))
            ).size(500000);//一次取10000条
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType)
                    .build();
            SearchResult result = jestClient.execute(search);
            List<HealthEduArticleES> healthEduArticleESs = result.getSourceAsObjectList(HealthEduArticleES.class);
            //根据id批量删除
            Bulk.Builder bulk = new Bulk.Builder().defaultIndex(esIndex).defaultType(esType);
            for (HealthEduArticleES obj : healthEduArticleESs) {
                Delete index = new Delete.Builder(obj.getId()).build();
                bulk.addAction(index);
            String sql = "select id from " + esIndex + " where doctorCode='" + doctorCode + "'";
            List<Map<String, Object>> returnList = elasticsearchUtil.excuteDataModel(sql);
            //根据id批量删除
            for (Map<String, Object> obj : returnList) {
                if (obj.containsKey("id")) {
                    i++;
                    Delete index = new Delete.Builder(obj.get("id").toString()).build();
                    bulk.addAction(index);
                }
            }
            BulkResult br = jestClient.execute(bulk.build());
            logger.info("delete data count:" + healthEduArticleESs.size());
            logger.info("delete data count:" + i);
            logger.info("delete flag:" + br.isSucceeded());
        } catch (Exception e) {
            e.printStackTrace();
@ -812,7 +810,7 @@ public class EduArticleService {
        //3.转换成新的健康教育需要的数据
        List<HealthEduArticleES> healthEduArticleESSaveList = new ArrayList<>();
        //获取医生的角色
        Map<String,Object> roleMaps=  gcLabelService.fetchUserHighestAuthority(doctorCode);
        Map<String, Object> roleMaps = gcLabelService.fetchUserHighestAuthority(doctorCode);
        healthEduArticlePatientMap.keySet().stream().forEach(one -> {
            //获取患者数据
@ -832,10 +830,10 @@ public class EduArticleService {
                healthEduArticleES.setSendLevel(doctor.getLevel().toString());
                healthEduArticleES.setSendSource(1);//旧数据都是1 i健康发送
                healthEduArticleES.setSendType(1);//默认是医生发送
                if(roleMaps!=null){
                   // healthEduArticleES.setCurrentUserRoleLevel("2");
                   // healthEduArticleES.setCurrentUserRoleCode();
                }else{
                if (roleMaps != null) {
                    // healthEduArticleES.setCurrentUserRoleLevel("2");
                    // healthEduArticleES.setCurrentUserRoleCode();
                } else {
                }
@ -912,25 +910,26 @@ public class EduArticleService {
    /**
     * 删除Es里所有的旧数据
     *
     * @return
     * @throws Exception
     */
    public Map<String, Object> deleteEsOldArticlePatient () throws Exception {
    public Map<String, Object> deleteEsOldArticlePatient() throws Exception {
        Map<String, Object> returnMap = new HashedMap();
        int resultSize = 0;
        String sql = "SELECT batch_no AS batchNo,COUNT(1) batchCount " +
                "FROM wlyy_health_edu_article_patient_copy " +
                "WHERE admin_team_code IS NOT NULL AND batch_no IS NOT NULL GROUP BY batch_no";
        List<Map<String,Object>> batchMapList = jdbcTemplate.queryForList(sql);
        List<Map<String, Object>> batchMapList = jdbcTemplate.queryForList(sql);
        List<String> batchNoList = new ArrayList<>();
        if (batchMapList!=null && batchMapList.size()>0){
            for (Map<String,Object> map : batchMapList){
               batchNoList.add(String.valueOf(map.get("batchNo")));
        if (batchMapList != null && batchMapList.size() > 0) {
            for (Map<String, Object> map : batchMapList) {
                batchNoList.add(String.valueOf(map.get("batchNo")));
            }
            resultSize = deleteEsByBatchNo(batchNoList);
        }
        returnMap.put("deleteCount",Integer.valueOf(resultSize));
        returnMap.put("deleteCount", Integer.valueOf(resultSize));
        return returnMap;
    }
@ -939,31 +938,27 @@ public class EduArticleService {
        JestClient jestClient = null;
        //List<HealthEduArticleES> saveModels = new ArrayList<>();
        try {
            int i = 0;
            jestClient = elasticFactory.getJestClient();
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            searchSourceBuilder.query(
                    new BoolQueryBuilder().must(QueryBuilders.termsQuery("batchNo",list))
            ).size(500000);//一次取10000条
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType).build();
            SearchResult result = jestClient.execute(search);
            List<HealthEduArticleES> healthEduArticleESs = result.getSourceAsObjectList(HealthEduArticleES.class);
            /*if (healthEduArticleESs != null && healthEduArticleESs.size() > 0) {
                for (HealthEduArticleES healthEduArticleES : healthEduArticleESs) {
                    saveModels.add(healthEduArticleES);
                }
            }*/
            //根据id批量删除
            Bulk.Builder bulk = new Bulk.Builder().defaultIndex(esIndex).defaultType(esType);
            for (HealthEduArticleES obj : healthEduArticleESs) {
                if (obj != null) {
                    Delete index = new Delete.Builder(obj.getId()).build();
                    bulk.addAction(index);
            for (String batchNo : list) {
                String sql = "select id from " + esIndex + " where batchNo='" + batchNo + "'";
                List<Map<String, Object>> returnList = elasticsearchUtil.excuteDataModel(sql);
                //根据id批量删除
                for (Map<String, Object> obj : returnList) {
                    if (obj.containsKey("id")) {
                        i++;
                        Delete index = new Delete.Builder(obj.get("id").toString()).build();
                        bulk.addAction(index);
                    }
                }
            }
            BulkResult br = jestClient.execute(bulk.build());
            logger.info("delete data count:" + healthEduArticleESs.size());
            logger.info("delete data count:" + i);
            logger.info("delete flag:" + br.isSucceeded());
            return healthEduArticleESs.size();
            return i;
        } catch (Exception e) {
            e.printStackTrace();
            return -1;
@ -974,9 +969,9 @@ public class EduArticleService {
        }
    }
    public Map<String ,Object> addBatchNo(String doctorCode){
        Map<String,Object> resultMap = new HashedMap();
        String sql ="SELECT " +
    public Map<String, Object> addBatchNo(String doctorCode) {
        Map<String, Object> resultMap = new HashedMap();
        String sql = "SELECT " +
                "  id, " +
                "  patient, " +
                "  article, " +
@ -990,40 +985,40 @@ public class EduArticleService {
                "  WHERE " +
                "  admin_team_code IS NOT NULL " +
                "  AND batch_no IS NULL " +
                "  AND doctor = '"+doctorCode+"' ORDER BY czrq ASC";
        List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
        List<Map<String,String>> sqlList = new ArrayList<>();
        if (list!=null && list.size()>0){
                "  AND doctor = '" + doctorCode + "' ORDER BY czrq ASC";
        List<Map<String, Object>> list = jdbcTemplate.queryForList(sql);
        List<Map<String, String>> sqlList = new ArrayList<>();
        if (list != null && list.size() > 0) {
            String oldArticleId = "";
            String oldTime = "";
            for (Map<String,Object> map : list){
                if (!(map.get("article")+"").equals(oldArticleId) || !(map.get("czrq")+"").equals(oldTime)){
                    oldArticleId = map.get("article")+"";
                    oldTime = map.get("czrq")+"";
                    Map<String,String> sqlMap = new HashedMap();
                    sqlMap.put("id",oldArticleId);
            for (Map<String, Object> map : list) {
                if (!(map.get("article") + "").equals(oldArticleId) || !(map.get("czrq") + "").equals(oldTime)) {
                    oldArticleId = map.get("article") + "";
                    oldTime = map.get("czrq") + "";
                    Map<String, String> sqlMap = new HashedMap();
                    sqlMap.put("id", oldArticleId);
                    sqlList.add(sqlMap);
                }
            }
        }
        int a = 0;
        if (sqlList!=null && sqlList.size()>0){
            for (Map<String,String> map : sqlList){
        if (sqlList != null && sqlList.size() > 0) {
            for (Map<String, String> map : sqlList) {
                String batchNo = String.valueOf(UUID.randomUUID());
                batchNo = batchNo.replace("-","");
                String id = map.get("id")+"";
                String updateSql ="UPDATE wlyy_health_edu_article_patient " +
                        " SET batch_no = '"+batchNo+"' " +
                batchNo = batchNo.replace("-", "");
                String id = map.get("id") + "";
                String updateSql = "UPDATE wlyy_health_edu_article_patient " +
                        " SET batch_no = '" + batchNo + "' " +
                        " WHERE " +
                        " admin_team_code IS NOT NULL " +
                        " AND batch_no IS NULL " +
                        " AND article = '"+id+"' " +
                        " AND doctor = '"+doctorCode+"'";
                a +=jdbcTemplate.update(updateSql);
                        " AND article = '" + id + "' " +
                        " AND doctor = '" + doctorCode + "'";
                a += jdbcTemplate.update(updateSql);
            }
        }
        resultMap.put("count",a);
        resultMap.put("count", a);
        return resultMap;
    }
}