فهرست منبع

Merge branch 'dev' of http://192.168.1.220:10080/Amoy/patient-co-management into dev

zd_123 7 سال پیش
والد
کامیت
554486d673
22فایلهای تغییر یافته به همراه314 افزوده شده و 42 حذف شده
  1. 13 5
      patient-co/patient-co-statistics-es/doc/es/统计新增索引.txt
  2. 5 0
      patient-co/patient-co-statistics-es/pom.xml
  3. 6 0
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/save/SaveHelper.java
  4. 67 4
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/save/es/ElastricSearchSave.java
  5. 16 5
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentMysqlToEsQuotaJob.java
  6. 10 5
      patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/vo/SaveModel.java
  7. 1 1
      patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/signServer/RenewSignOrgOutServerJob.java
  8. 1 1
      patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/signServer/RenewSignOrgServerJob.java
  9. 1 1
      patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/signServer/RenewSignServerJob.java
  10. 1 1
      patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/signServer/RenewSignTeamOutServerJob.java
  11. 1 1
      patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/signServer/RenewSignTeamServerJob.java
  12. 2 2
      patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/signServer/RenewSignTownOutServerJob.java
  13. 1 1
      patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/signServer/RenewSignTownServerJob.java
  14. 0 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/education/HealthEduArticleDao.java
  15. 71 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticleService.java
  16. 6 6
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionDispensaryCodeService.java
  17. 9 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/wxpay/model/Charge.java
  18. 4 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionController.java
  19. 95 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/zysoft/ZyHealthEduArticleController.java
  20. 1 1
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/wx/HealthServiceController.java
  21. 2 0
      patient-co/patient-co-wlyy/src/main/resources/wechat/readMe.MD
  22. 1 1
      patient-co/patient-co-wlyy/src/main/resources/wechat/weixin_menu_jimei.txt

+ 13 - 5
patient-co/patient-co-statistics-es/doc/es/统计新增索引.txt

@ -1,11 +1,11 @@
创建索引
POST  http://172.19.103.68:9200/wlyy_quota_test
POST  http://172.19.103.68:9200/wlyy_quota_cwd
查询索引
GET http://172.19.103.68:9200/wlyy_quota_test/
GET http://172.19.103.68:9200/wlyy_quota_cwd/
给索引加mapping
POST http://172.19.103.68:9200/wlyy_quota_test/wlyy_quota_test/_mapping
POST http://172.19.103.68:9200/wlyy_quota_cwd/wlyy_quota_cwd/_mapping
{
    "wlyy_quota_test": {
    "wlyy_quota_cwd": {
            "properties": {
                "quotaCode": {
                    "type": "string",
@ -97,4 +97,12 @@ POST http://172.19.103.68:9200/wlyy_quota_test/wlyy_quota_test/_mapping
                }
            }
        }
  }
  }
增加索引搜索大小
PUT  http://172.19.103.68:9200/wlyy_quota_cwd/_settings
{
  "index": {
    "max_result_window": 500000
  }
}

+ 5 - 0
patient-co/patient-co-statistics-es/pom.xml

@ -449,6 +449,11 @@
            <groupId>com.yihu</groupId>
            <artifactId>common-entity</artifactId>
        </dependency>
        <dependency>
            <groupId>com.alibaba</groupId>
            <artifactId>fastjson</artifactId>
            <version>1.2.17</version>
        </dependency>
    </dependencies>
    <build>

+ 6 - 0
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/save/SaveHelper.java

@ -21,5 +21,11 @@ public class SaveHelper {
        return SpringUtil.getBean(ElastricSearchSave.class).save(sms);
    }
    public Boolean update(List<SaveModel> sms) {
        return SpringUtil.getBean(ElastricSearchSave.class).update(sms);
    }
}

+ 67 - 4
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/etl/save/es/ElastricSearchSave.java

@ -1,11 +1,13 @@
package com.yihu.wlyy.statistics.etl.save.es;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.statistics.vo.SaveModel;
import io.searchbox.client.JestClient;
import io.searchbox.client.JestResult;
import io.searchbox.core.Bulk;
import io.searchbox.core.BulkResult;
import io.searchbox.core.Index;
import net.sf.json.JSONObject;
import io.searchbox.core.Update;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
@ -38,14 +40,23 @@ public class ElastricSearchSave {
            //得到链接
            JestClient jestClient = elasticFactory.getJestClient();
            int success = 0;
            int error = 0;
            Bulk.Builder bulk = new Bulk.Builder().defaultIndex(esIndex).defaultType(esType);
            for (SaveModel obj : sms) {
                Index index = new Index.Builder(obj).build();
                bulk.addAction(index);
                try {
                    obj.setCreateTime(new Date());
                    Index index = new Index.Builder(obj).build();
                    bulk.addAction(index);
                } catch (Exception e) {
                    logger.error(e.getMessage());
                }
            }
            BulkResult br = jestClient.execute(bulk.build());
            logger.info("save data count:" + sms.size());
            logger.info("save flag:" + br.isSucceeded());
            logger.info("save success:" + success);
            logger.info("save error:" + error);
            return br.isSucceeded();
        } catch (Exception e) {
            logger.error(" save error :" + e.getMessage());
@ -53,4 +64,56 @@ public class ElastricSearchSave {
        return null;
    }
    public Boolean update(List<SaveModel> sms) {
        try {
            //得到链接
            JestClient jestClient = elasticFactory.getJestClient();
            int success = 0;
            int error = 0;
            boolean isSuccessed = true;
//            Bulk.Builder bulk = new Bulk.Builder().defaultIndex(esIndex).defaultType(esType);
//            for (SaveModel obj : sms) {
//                try {
//                    obj.setCreateTime(new Date());
//                    Update index = new Update.Builder(obj).index(esIndex).type(esType).id(obj.getId()).build();
//                    bulk.addAction(index);
//                    success++;
//                } catch (Exception e) {
//                    error++;
//                }
//            }
            Bulk.Builder bulk = new Bulk.Builder().defaultIndex(esIndex).defaultType(esType);
            for (SaveModel obj : sms) {
                try {
                    JSONObject jo=new JSONObject();
                    obj.setCreateTime(new Date());
                    jo.put("doc",obj);
                    Update index = new Update.Builder(jo.toString()).index(esIndex).type(esType).id(obj.getId()).build();
                    bulk.addAction(index);
                  //  JestResult result = jestClient.execute(index);
//                    if (result.isSucceeded()) {
//                        success++;
//                    } else {
//                        error++;
//                        isSuccessed = false;
//                    }
                } catch (Exception e) {
                    error++;
                    isSuccessed = false;
                }
            }
            BulkResult br = jestClient.execute(bulk.build());
            logger.info("update flag:" + br.isSucceeded());
            logger.info("update success:" + success);
            logger.info("update error:" + error);
            return isSuccessed;
        } catch (Exception e) {
            logger.error(" update error :" + e.getMessage());
        }
        return null;
    }
}

+ 16 - 5
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/job/business/CurrentMysqlToEsQuotaJob.java

@ -117,7 +117,7 @@ public class CurrentMysqlToEsQuotaJob implements Job {
        if ("2".equals(timeLevel)) {
            //按年度到达量
            startTime = this.year + "-06-30 17:00:00";
        }else{
        } else {
            //增量
            this.startTime = new LocalDate(new DateTime().minusDays(1)).toString("yyyy-MM-dd") + " 17:00:00"; //2017-06-01 17:00:00
        }
@ -136,7 +136,7 @@ public class CurrentMysqlToEsQuotaJob implements Job {
        List<QuartzJobConfig> list = quartzJobConfigDao.findByIds();
        list.stream().forEach(one -> {
            try {
                logger.info("========================quotaCode:" + one.getId() + ","+DateUtil.dateToStr(quotaDate, "yyyy-MM-dd")+",timeLevel:"+timeLevel+" start========================");
                logger.info("========================quotaCode:" + one.getId() + "," + DateUtil.dateToStr(quotaDate, "yyyy-MM-dd") + ",timeLevel:" + timeLevel + " start========================");
                QuartzJobLog tjQuotaLog = new QuartzJobLog();
                tjQuotaLog.setJobId(one.getId());
                tjQuotaLog.setJobStartTime(new Date());
@ -160,7 +160,7 @@ public class CurrentMysqlToEsQuotaJob implements Job {
                tjQuotaLog.setJobEndTime(new Date());
                tjQuotaLog.setJobContent(JSONArray.fromObject(filterModel.getErrorModels()).toString());
                saveLog(tjQuotaLog);
                logger.info("========================quotaCode:" + one.getId() + ","+DateUtil.dateToStr(quotaDate, "yyyy-MM-dd")+" start========================");
                logger.info("========================quotaCode:" + one.getId() + "," + DateUtil.dateToStr(quotaDate, "yyyy-MM-dd") + " start========================");
            } catch (Exception e) {
                e.printStackTrace();
            }
@ -207,15 +207,26 @@ public class CurrentMysqlToEsQuotaJob implements Job {
                    obj.setResult2(newResult.getResult2());
                    obj.setCreateTime(new Date());
                }
                sms=quarySaveModels;
                sms = quarySaveModels;
                return updateDate(sms);
            } else {
                return saveDate(sms);
            }
            return saveDate(sms);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return false;
    }
    private boolean updateDate(List<SaveModel> sms) {
        try {
            return SpringUtil.getBean(SaveHelper.class).update(sms);
        } catch (Exception e) {
            logger.error("save error:" + e.getMessage());
        }
        return false;
    }
    @Transactional
    private void saveLog(QuartzJobLog tjQuotaLog) {
        quartzJobLogDao.save(tjQuotaLog);

+ 10 - 5
patient-co/patient-co-statistics-es/src/main/java/com/yihu/wlyy/statistics/vo/SaveModel.java

@ -1,10 +1,12 @@
package com.yihu.wlyy.statistics.vo;
import com.alibaba.fastjson.annotation.JSONField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.searchbox.annotations.JestId;
import org.elasticsearch.index.analysis.AnalysisSettingsRequired;
import org.springframework.data.annotation.CreatedDate;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;
@ -18,9 +20,9 @@ public class SaveModel {
    private final static String townKey = "town";
    private final static String cityKey = "city";
    public final static String interval_day="1";
    public final static String interval_week="2";
    public final static String interval_month="3";
    public final static String interval_day = "1";
    public final static String interval_week = "2";
    public final static String interval_month = "3";
    public final static String teamLevel = "5";
    public final static String OrgLevel = "4";
@ -35,6 +37,9 @@ public class SaveModel {
    private String quotaCode;//指标code
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXX")
    @CreatedDate
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
    private Date quotaDate;//统计时间
    private String city;//城市代码 350200
@ -74,13 +79,13 @@ public class SaveModel {
    private Integer result2 = 0;//统计结果  次数
    private String areaLevel;// 1 省 2 市 3 区县 4 机构 5团队
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyyMMdd'T'HHmmss.SSS'Z'")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd'T'HH:mm:ssXX")
    @CreatedDate
    @JSONField(format = "yyyy-MM-dd'T'HH:mm:ssXX")
    private Date createTime;//创建时间
    private String timeLevel;// 1日 2年
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy/MM/dd ")
    public Date getQuotaDate() {
        return quotaDate;
    }

+ 1 - 1
patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/signServer/RenewSignOrgOutServerJob.java

@ -84,7 +84,7 @@ public class RenewSignOrgOutServerJob implements Job {
    @Transactional
    private void computequota() {
        try{
            jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='"+yesterday+"' and quato_code='"+39+"'");
            jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='"+yesterday+"' and quato_code='"+56+"'");
            //新建任务日志对象
            QuartzJobLog quartzJobLog = new QuartzJobLog();

+ 1 - 1
patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/signServer/RenewSignOrgServerJob.java

@ -85,7 +85,7 @@ public class RenewSignOrgServerJob implements Job {
    @Transactional
    private void computequota() {
        try{
            jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='"+yesterday+"' and quato_code='"+43+"'");
            jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='"+yesterday+"' and quato_code='"+53+"'");
            //新建任务日志对象
            QuartzJobLog quartzJobLog = new QuartzJobLog();

+ 1 - 1
patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/signServer/RenewSignServerJob.java

@ -84,7 +84,7 @@ public class  RenewSignServerJob implements Job {
    @Transactional
    private void computequota() {
        try{
            jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='"+yesterday+"' and quato_code='"+29+"'");
            jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='"+yesterday+"' and quato_code='"+51+"'");
            //新建任务日志对象
            QuartzJobLog quartzJobLog = new QuartzJobLog();

+ 1 - 1
patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/signServer/RenewSignTeamOutServerJob.java

@ -85,7 +85,7 @@ public class RenewSignTeamOutServerJob implements Job {
    @Transactional
    private void computequota() {
        try{
            jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='"+yesterday+"' and quato_code='"+35+"'");
            jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='"+yesterday+"' and quato_code='"+55+"'");
            //新建任务日志对象
            QuartzJobLog quartzJobLog = new QuartzJobLog();

+ 1 - 1
patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/signServer/RenewSignTeamServerJob.java

@ -84,7 +84,7 @@ public class RenewSignTeamServerJob implements Job {
    @Transactional
    private void computequota() {
        try{
            jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='"+yesterday+"' and quato_code='"+42+"'");
            jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='"+yesterday+"' and quato_code='"+52+"'");
            //新建任务日志对象
            QuartzJobLog quartzJobLog = new QuartzJobLog();

+ 2 - 2
patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/signServer/RenewSignTownOutServerJob.java

@ -31,7 +31,7 @@ import java.util.List;
import java.util.Map;
/**
 * 续签团队签出服务类型的指标执行类
 * 续签团队签出(标签类型维度)的指标执行类
 */
@Component
@Scope("prototype")
@ -84,7 +84,7 @@ public class RenewSignTownOutServerJob implements Job {
    @Transactional
    private void computequota() {
        try{
            jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='"+yesterday+"' and quato_code='"+41+"'");
            jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='"+yesterday+"' and quato_code='"+57+"'");
            //新建任务日志对象
            QuartzJobLog quartzJobLog = new QuartzJobLog();

+ 1 - 1
patient-co/patient-co-statistics/src/main/java/com/yihu/wlyy/statistics/job/business/signServer/RenewSignTownServerJob.java

@ -84,7 +84,7 @@ public class RenewSignTownServerJob implements Job {
    @Transactional
    private void computequota() {
        try{
            jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='"+yesterday+"' and quato_code='"+44+"'");
            jdbcTemplate.execute("delete from wlyy_quota_result where quota_date='"+yesterday+"' and quato_code='"+54+"'");
            //新建任务日志对象
            QuartzJobLog quartzJobLog = new QuartzJobLog();

+ 0 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/education/HealthEduArticleDao.java

@ -1,6 +1,5 @@
package com.yihu.wlyy.repository.education;
import com.yihu.wlyy.entity.patient.PatientHealthRecordDiet;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
@ -9,7 +8,6 @@ import org.springframework.data.repository.PagingAndSortingRepository;
import com.yihu.wlyy.entity.education.HealthEduArticle;
import java.util.Date;
public interface HealthEduArticleDao extends PagingAndSortingRepository<HealthEduArticle, Long>, JpaSpecificationExecutor<HealthEduArticle> {

+ 71 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/health/HealthEduArticleService.java

@ -299,4 +299,75 @@ public class HealthEduArticleService extends BaseService {
        }
    }
    
    public List<Map<String,Object>> zyfindAll(int page, int pagesize, String titlefilter, String keywordfilter, String contentfilter) {
        if (pagesize <= 0) {
            pagesize = 10;
        }
        if (page <=0) {
            page = 1;
        }
        page = page-1;
        List<Object> params = new ArrayList<Object>();
        StringBuffer sql = new StringBuffer();
        sql.append("select a.id,a.code,a.title,a.url,a.czrq,a.summary content,a.keyword");
        sql.append(",(select count(1) from wlyy_health_edu_article_op_history c where c.code = a.code and c.status = 1) as readAmount");
        sql.append(",(select count(1) from wlyy_health_edu_article_op_history c where c.code = a.code and c.status = 2) as collectionAmount");
        sql.append(",(select count(1) from wlyy_health_edu_article_op_history c where c.code = a.code and c.status = 3) as repeatAmount");
        sql.append(" from wlyy_health_edu_article a  ");//内联取文章内容
        String where = " where 1=1 ";
        if (StringUtils.isNotBlank(titlefilter) ||
                StringUtils.isNotBlank(keywordfilter)||
                    StringUtils.isNotBlank(contentfilter)) {
            where += " and  ( ";
            
            boolean need_or = false;
    
            //文章标题关键字搜索
            if(StringUtils.isNotBlank(titlefilter)){
                titlefilter = "%" + titlefilter + "%";
                where +="a.title like ?";
    
                need_or = true;
                params.add(titlefilter);
            }
    
            //关键字搜索
            if(StringUtils.isNotBlank(keywordfilter)){
                keywordfilter = "%" + keywordfilter + "%";
                
                if(need_or){
                    where +=" or a.keyword like ?";
                }else{
                    where +="a.keyword like ?";
                    need_or = true;
                }
                params.add(keywordfilter);
            }
    
            //文章内容搜索
            if(StringUtils.isNotBlank(contentfilter)){
                contentfilter = "%" + contentfilter + "%";
        
                if(need_or){
                    where +=" or a.content like ?";
                }else{
                    where +="a.content like ?";
                }
                params.add(contentfilter);
            }
            
            where += " )";
        }
//        if(wheaType>=0){
//            where += " and  ( a.whea_type = ? )";
//            params.add(wheaType);
//        }
        int start = page * pagesize;
        String pageInfo = " limit " + start + "," + pagesize;
        String orderBy = " order by a.czrq desc";
        sql.append(where).append(orderBy).append(pageInfo);
        List<Map<String, Object>> result = jdbcTemplate.queryForList(sql.toString(), params.toArray());
        return result;
    }
}

+ 6 - 6
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/app/prescription/PrescriptionDispensaryCodeService.java

@ -119,7 +119,7 @@ public class PrescriptionDispensaryCodeService extends BaseService {
    }
    @Transactional
    public void saveQRCode(String token,String prescriptionCode) throws Exception {
    public void saveQRCode(String prescriptionCode) throws Exception {
        Prescription prescription = prescriptionDao.findByCode(prescriptionCode);
        //取药类型:1 自取 2快递配送 3健管师配送
        Integer type = prescription.getDispensaryType();
@ -127,7 +127,7 @@ public class PrescriptionDispensaryCodeService extends BaseService {
        PrescriptionDispensaryCode p1 = prescriptionDispensaryCodeDao.findByPrescriptionCodeAndIsUseAndType(prescriptionCode,0,1);
        if(p1==null){
            p1 = savePatientQRCode(token,prescriptionCode);
            p1 = savePatientQRCode(prescriptionCode);
        }
        if(p1==null){
            throw new Exception("二维码生成失败!");
@ -136,7 +136,7 @@ public class PrescriptionDispensaryCodeService extends BaseService {
            PrescriptionDispensaryCode p2 = prescriptionDispensaryCodeDao.findByPrescriptionCodeAndIsUseAndType(prescriptionCode,0,2);
            if(p2==null){
                p2 = saveQRCode(p1.getCode(),token,prescriptionCode,2);
                p2 = saveQRCode(p1.getCode(),prescriptionCode,2);
            }
            if(p2==null){
                throw new Exception("二维码生成失败!");
@ -144,7 +144,7 @@ public class PrescriptionDispensaryCodeService extends BaseService {
            PrescriptionDispensaryCode p3 = prescriptionDispensaryCodeDao.findByPrescriptionCodeAndIsUseAndType(prescriptionCode,0,3);
            if(p3==null){
                p3 = saveQRCode(p1.getCode(),token,prescriptionCode,3);
                p3 = saveQRCode(p1.getCode(),prescriptionCode,3);
            }
            if(p3==null){
                throw new Exception("二维码生成失败!");
@ -154,7 +154,7 @@ public class PrescriptionDispensaryCodeService extends BaseService {
    //生成居民端取药码
    @Transactional
    public PrescriptionDispensaryCode savePatientQRCode(String token,String prescriptionCode) throws Exception {
    public PrescriptionDispensaryCode savePatientQRCode(String prescriptionCode) throws Exception {
        //获取年月日8位数
        Calendar cal  = Calendar.getInstance();
        String year = String.valueOf(cal.get(Calendar.YEAR));
@ -192,7 +192,7 @@ public class PrescriptionDispensaryCodeService extends BaseService {
    //生成配送员(健管师)(2、取药码  2、配送码)
    @Transactional
    public PrescriptionDispensaryCode saveQRCode(String code,String token,String prescriptionCode,Integer type) throws Exception {
    public PrescriptionDispensaryCode saveQRCode(String code,String prescriptionCode,Integer type) throws Exception {
        String jgsCode= "";
        synchronized (obj2){
            boolean bl = true;

+ 9 - 1
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/weixin/wxpay/model/Charge.java

@ -21,7 +21,15 @@ public class Charge {
    private String userName;  // 用户姓名
    private String idType;  // 证件号码
    private String idNo;  // 证件类型
    //private String responseContent;  //扣费详情
    private String responseContent;  //扣费详情
    public String getResponseContent() {
        return responseContent;
    }
    public void setResponseContent(String responseContent) {
        this.responseContent = responseContent;
    }
    public String getTradeStatus() {
        return tradeStatus;

+ 4 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/patient/prescription/PatientPrescriptionController.java

@ -56,7 +56,7 @@ public class PatientPrescriptionController extends WeixinBaseController {
            @ApiParam(required = true, name = "prescriptionCode", value = "处方code") @RequestParam(value = "prescriptionCode", required = true) String prescriptionCode) {
        try {
            prescriptionDispensaryCodeService.saveQRCode(getAccessToken(), prescriptionCode);
            prescriptionDispensaryCodeService.saveQRCode(prescriptionCode);
            return write(200, "生成二维码成功!");
        } catch (Exception e) {
            error(e);
@ -78,7 +78,7 @@ public class PatientPrescriptionController extends WeixinBaseController {
//        String token = getAccessToken();
        try {
            PrescriptionDispensaryCode prescriptionDispensaryCode = prescriptionDispensaryCodeService.savePatientQRCode(getAccessToken(), prescriptionCode);
            PrescriptionDispensaryCode prescriptionDispensaryCode = prescriptionDispensaryCodeService.savePatientQRCode(prescriptionCode);
            if (prescriptionDispensaryCode == null) {
                return error(-1, "生成居民取药码失败!");
            } else {
@ -103,7 +103,7 @@ public class PatientPrescriptionController extends WeixinBaseController {
            @RequestParam(value = "code", required = true) String code) {
        try {
            PrescriptionDispensaryCode prescriptionDispensaryCode = prescriptionDispensaryCodeService.saveQRCode(code, getAccessToken(), prescriptionCode, 2);
            PrescriptionDispensaryCode prescriptionDispensaryCode = prescriptionDispensaryCodeService.saveQRCode(code, prescriptionCode, 2);
            if (prescriptionDispensaryCode == null) {
                return error(-1, "生成配送员取药码失败!");
            } else {
@ -129,7 +129,7 @@ public class PatientPrescriptionController extends WeixinBaseController {
            @RequestParam(value = "code", required = true) String code) {
        try {
            PrescriptionDispensaryCode prescriptionDispensaryCode = prescriptionDispensaryCodeService.saveQRCode(code, getAccessToken(), prescriptionCode, 3);
            PrescriptionDispensaryCode prescriptionDispensaryCode = prescriptionDispensaryCodeService.saveQRCode(code,prescriptionCode, 3);
            if (prescriptionDispensaryCode == null) {
                return error(-1, "生成配送员配送码失败!");
            } else {

+ 95 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/zysoft/ZyHealthEduArticleController.java

@ -0,0 +1,95 @@
package com.yihu.wlyy.web.third.zysoft;
import com.yihu.wlyy.entity.education.HealthEduArticle;
import com.yihu.wlyy.service.app.health.HealthEduArticleService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.web.BaseController;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 * 提供给智业调用的健康教育文章相关的接口:
 * @author huangwenjie
 * @date 2017/10/17 09:05
 */
@RestController
@RequestMapping("/wlyygc/zy/healthedu/article/")
public class ZyHealthEduArticleController extends BaseController {
	
	@Autowired
	private HealthEduArticleService healthEduArticleService;
	
	/**
	 * 查询健康教育文章列表
	 * @param titlefilter 文章标题搜索条件
	 * @param keywordfilter 关键字搜索条件
	 * @param contentfilter 文章内容搜索条件
	 * @param page 第几页(第一页传0)
	 * @param pagesize 分页大小
	 * @return 列表
	 */
	@ApiOperation("基卫查询健康教育文章列表")
	@RequestMapping(value = "list",method = RequestMethod.GET)
	@ResponseBody
	public String list(@RequestParam(value = "page", required = true) int page,
	                   @RequestParam(value = "pagesize", required = true) int pagesize,
	                   @RequestParam(value = "titlefilter", required = false) String titlefilter,
	                   @RequestParam(value = "keywordfilter", required = false) String keywordfilter,
	                   @RequestParam(value = "contentfilter", required = false) String contentfilter) {
		try {
			List<Map<String, Object>> list = healthEduArticleService.zyfindAll(page, pagesize, titlefilter, keywordfilter, contentfilter);
			JSONArray jsonArray = new JSONArray();
			if (list != null) {
				for (Map<String, Object> map : list) {
					JSONObject json = new JSONObject();
					json.put("id", map.get("id"));
					// 文章标识
					json.put("code", map.get("code"));
					// 文章标题
					json.put("title", map.get("title"));
					// 文章配图URL
					json.put("url", map.get("url"));
					// 文章简介
					json.put("content", String.valueOf(map.get("content"))==null?"":map.get("content"));
					// 添加日期
					json.put("czrq", DateUtil.dateToStrLong((Date) map.get("czrq")));
					// 关键字
					json.put("keyword", map.get("keyword") == null ? "" : map.get("keyword"));
					// 阅读量
					json.put("readAmount", map.get("readAmount"));
					// 收藏量
					json.put("collectionAmount", map.get("collectionAmount"));
					// 转发量
					json.put("repeatAmount", map.get("repeatAmount"));
					
					jsonArray.put(json);
				}
			}
			return write(200, "查询成功", "list", jsonArray);
		} catch (Exception ex) {
			error(ex);
			return invalidUserException(ex, -1, "查询失败!");
		}
	}
	
	@RequestMapping(value = "getArticalByCode",method = RequestMethod.GET)
	@ApiOperation("获取健康教育文章详情")
	public String getArticalById(@ApiParam(name = "articleCode", value = "教育文章Code",defaultValue = "1")
	                             @RequestParam(value = "articleCode", required = true) String articleCode){
		try {
			HealthEduArticle healthEduArticle = healthEduArticleService.findArticleByCode(articleCode);
			return write(200,"查询成功!","data",healthEduArticle);
		}catch (Exception e){
			e.printStackTrace();
			return error(-1,"查询失败!");
		}
	}
}

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

@ -37,7 +37,7 @@ public class HealthServiceController extends WeixinBaseController {
			response.sendRedirect(server_url + "wx/html/home/html/login.html?type=1&openid=" + json.get("msg").toString());
		} else if (Integer.parseInt(json.get("status").toString()) == 200) {
//			String json2 = json.get("data").toString();
//			String paramUrl = getParamUrl(json2, 1);
//			String paramUrl = getParamUrl(json2, 1);12
			response.sendRedirect(server_url + "wx/html/zxwz/html/online-consulting.html");
		} else {
			response.sendRedirect(server_url + "wx/health_service/404.html");

+ 2 - 0
patient-co/patient-co-wlyy/src/main/resources/wechat/readMe.MD

@ -0,0 +1,2 @@
集美区标签
正式库103 测试库105

+ 1 - 1
patient-co/patient-co-wlyy/src/main/resources/wechat/weixin_menu_jimei.txt

@ -87,6 +87,6 @@
	 ]
  }],
    "matchrule":{
      "tag_id":"105"
      "tag_id":"103"
      }
}