Bläddra i källkod

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

huangwenjie 7 år sedan
förälder
incheckning
31749585f9

+ 4 - 3
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/common/thread/LoadNewSignThread.java

@ -1,6 +1,7 @@
package com.yihu.wlyy.sign.common.thread;
package com.yihu.wlyy.sign.common.thread;
import com.yihu.wlyy.sign.common.util.DateUtil;
import com.yihu.wlyy.sign.common.util.SpringContextHolder;
import com.yihu.wlyy.sign.common.util.SpringContextHolder;
import com.yihu.wlyy.sign.service.SignZYService;
import com.yihu.wlyy.sign.service.SignZYService;
import com.yihu.wlyy.sign.service.SystemDictService;
import com.yihu.wlyy.sign.service.SystemDictService;
@ -15,7 +16,7 @@ public class LoadNewSignThread implements Runnable {
    int retryTime =  30000;
    int retryTime =  30000;
    //空闲时间
    //空闲时间
    Integer nightHours = 22;
    Integer nightHours = 23;
    Integer morningHours = 6;
    Integer morningHours = 6;
    //默认线程间隔
    //默认线程间隔
@ -37,7 +38,7 @@ public class LoadNewSignThread implements Runnable {
                    {
                    {
                        Boolean running = systemDictService.getLoadRunning();
                        Boolean running = systemDictService.getLoadRunning();
                        if(running) {
                        if(running) {
                            //System.out.print(DateUtil.dateToStrLong(now) + " 开始采集新增签约...\r\n");
                            System.out.print(DateUtil.dateToStrLong(now) + " 开始采集新增签约...\r\n");
                            try {
                            try {
                                signZYService.loadNewSignFamilyThread();
                                signZYService.loadNewSignFamilyThread();
                            }
                            }
@ -46,7 +47,7 @@ public class LoadNewSignThread implements Runnable {
                                e.printStackTrace();
                                e.printStackTrace();
                            }
                            }
                            //System.out.print(DateUtil.dateToStrLong(new Date()) + " 采集新增签约结束。\r\n");
                            System.out.print(DateUtil.dateToStrLong(new Date()) + " 采集新增签约结束。\r\n");
                        }
                        }
                        continue;
                        continue;

+ 11 - 11
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/common/thread/LoadThread.java

@ -20,7 +20,7 @@ public class LoadThread implements Runnable {
    Integer morningHours = 6;
    Integer morningHours = 6;
    //默认线程间隔
    //默认线程间隔
    Integer sleepTime = 180;
    Integer sleepTime = 60;
    @Override
    @Override
    public void run() {
    public void run() {
@ -29,38 +29,38 @@ public class LoadThread implements Runnable {
                Date now = new Date();
                Date now = new Date();
                //判断非空闲时候
                //判断非空闲时候
                if(now.getHours()>=morningHours &&  now.getHours() < nightHours)
                {
//                if(now.getHours()>=morningHours &&  now.getHours() < nightHours)
//                {
                    //签约更新
                    //签约更新
                    SignZYService signZYService = (SignZYService) SpringContextHolder.getSpringBean("SignZYService");
                    SignZYService signZYService = (SignZYService) SpringContextHolder.getSpringBean("SignZYService");
                    SystemDictService systemDictService = (SystemDictService) SpringContextHolder.getSpringBean("SystemDictService");
                    SystemDictService systemDictService = (SystemDictService) SpringContextHolder.getSpringBean("SystemDictService");
                    if(signZYService!=null && systemDictService!=null)
                    if(signZYService!=null && systemDictService!=null)
                    {
                    {
                        Boolean running = systemDictService.getLoadRunning();
                        Boolean running = systemDictService.getLoadRunning();
                        sleepTime = systemDictService.getLoadSleepTime();
//                        sleepTime = systemDictService.getLoadSleepTime();
                        if(running) {
                        if(running) {
                            System.out.print(DateUtil.dateToStrLong(now) + " 开始采集签约...\r\n");
                            System.out.print(DateUtil.dateToStrLong(now) + " 开始采集签约(更新)...\r\n");
                            try {
                            try {
                                signZYService.loadSignFamilyThread();
                                signZYService.loadSignFamilyThreadMore();
                            }
                            }
                            catch (Exception e)
                            catch (Exception e)
                            {
                            {
                                e.printStackTrace();
                                e.printStackTrace();
                            }
                            }
                            System.out.print(DateUtil.dateToStrLong(new Date()) + " 采集签约结束。\r\n");
                            System.out.print(DateUtil.dateToStrLong(new Date()) + " 采集签约(更新)结束。\r\n");
                        }
                        }
                        Thread.sleep(sleepTime*1000);//间隔三分钟
                        Thread.sleep(sleepTime*1000);//间隔1分钟
                        continue;
                        continue;
                    }
                    }
                    else{
                    else{
                        Thread.sleep(retryTime);
                        Thread.sleep(retryTime);
                        continue;
                        continue;
                    }
                    }
                }
                Thread.sleep(sleepTime*1000);
//                }
//
//                Thread.sleep(sleepTime*1000);
            } catch (Exception ex) {
            } catch (Exception ex) {
                ex.printStackTrace();
                ex.printStackTrace();
                try {
                try {

+ 3 - 2
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/common/thread/UploadChargeThread.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.sign.common.thread;
package com.yihu.wlyy.sign.common.thread;
import com.yihu.wlyy.sign.common.util.DateUtil;
import com.yihu.wlyy.sign.common.util.SpringContextHolder;
import com.yihu.wlyy.sign.common.util.SpringContextHolder;
import com.yihu.wlyy.sign.service.ChargeZYService;
import com.yihu.wlyy.sign.service.ChargeZYService;
import com.yihu.wlyy.sign.service.SystemDictService;
import com.yihu.wlyy.sign.service.SystemDictService;
@ -28,7 +29,7 @@ public class UploadChargeThread implements Runnable{
                {
                {
                    Boolean running = systemDictService.getUploadChargeRunning();
                    Boolean running = systemDictService.getUploadChargeRunning();
                    if(running) {
                    if(running) {
//                        System.out.print(DateUtil.dateToStrLong(now) + " 上传缴费...\r\n");
                        System.out.print(DateUtil.dateToStrLong(now) + " 上传缴费...\r\n");
                        try {
                        try {
                            service.uploadCharge();
                            service.uploadCharge();
                        }
                        }
@ -37,7 +38,7 @@ public class UploadChargeThread implements Runnable{
                            e.printStackTrace();
                            e.printStackTrace();
                        }
                        }
//                        System.out.print(DateUtil.dateToStrLong(new Date()) + " 上传缴费记录结束。\r\n");
                        System.out.print(DateUtil.dateToStrLong(new Date()) + " 上传缴费记录结束。\r\n");
                    }
                    }
                    Thread.sleep(sleepTime);
                    Thread.sleep(sleepTime);

+ 3 - 2
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/common/thread/UploadRenewThread.java

@ -1,6 +1,7 @@
package com.yihu.wlyy.sign.common.thread;
package com.yihu.wlyy.sign.common.thread;
import com.yihu.wlyy.sign.common.util.DateUtil;
import com.yihu.wlyy.sign.common.util.SpringContextHolder;
import com.yihu.wlyy.sign.common.util.SpringContextHolder;
import com.yihu.wlyy.sign.service.SignRenewZYService;
import com.yihu.wlyy.sign.service.SignRenewZYService;
import com.yihu.wlyy.sign.service.SystemDictService;
import com.yihu.wlyy.sign.service.SystemDictService;
@ -35,7 +36,7 @@ public class UploadRenewThread implements Runnable {
                {
                {
                    Boolean running = systemDictService.getUploadRenewRunning();
                    Boolean running = systemDictService.getUploadRenewRunning();
                    if(running) {
                    if(running) {
                        //System.out.print(DateUtil.dateToStrLong(now) + " 开始上传续签记录...\r\n");
                        System.out.print(DateUtil.dateToStrLong(now) + " 开始上传续签记录...\r\n");
                        try {
                        try {
                            service.uploadRenewSignFamily();
                            service.uploadRenewSignFamily();
                        }
                        }
@ -44,7 +45,7 @@ public class UploadRenewThread implements Runnable {
                            e.printStackTrace();
                            e.printStackTrace();
                        }
                        }
                        //System.out.print(DateUtil.dateToStrLong(new Date()) + " 上传续签记录结束。\r\n");
                        System.out.print(DateUtil.dateToStrLong(new Date()) + " 上传续签记录结束。\r\n");
                    }
                    }
                    Thread.sleep(sleepTime);
                    Thread.sleep(sleepTime);

+ 7 - 3
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/service/SignRenewZYService.java

@ -355,7 +355,7 @@ public class SignRenewZYService {
                }
                }
                //////////////$$$$$ 20170616 hzp 特殊写死 /////////////////////////////////////
                //////////////$$$$$ 20170616 hzp 特殊写死 /////////////////////////////////////
                String signYear = "2017";
	            String signYear = "2018";
                /*map.get("SIGN_YEAR");
                /*map.get("SIGN_YEAR");
                if(signYear.length()!=4)
                if(signYear.length()!=4)
                {
                {
@ -879,7 +879,7 @@ public class SignRenewZYService {
                String patientBirthday = map.get("BIRTHDAY");  //患者生日
                String patientBirthday = map.get("BIRTHDAY");  //患者生日
                String patientCardNo = map.get("CARD_NO");  //患者社保卡号
                String patientCardNo = map.get("CARD_NO");  //患者社保卡号
                ////////////// 20170616 hzp 特殊写死 $$$$$/////////////////////////////////////
                ////////////// 20170616 hzp 特殊写死 $$$$$/////////////////////////////////////
                String signYear = "2017";//map.get("SIGN_YEAR"); //签约年份
                String signYear = "2018";//map.get("SIGN_YEAR"); //签约年份
                //社保卡号过长存-1
                //社保卡号过长存-1
                if(!StringUtil.isEmpty(patientCardNo) && patientCardNo.length()>20)
                if(!StringUtil.isEmpty(patientCardNo) && patientCardNo.length()>20)
                {
                {
@ -1627,7 +1627,11 @@ public class SignRenewZYService {
                } else {
                } else {
                    log.setNeedUpload("1");
                    log.setNeedUpload("1");
                }
                }
                log.setUploadLog(content + "\r\n" + msg);
                String errorMsg = content + "\r\n" + msg;
                if(errorMsg.length() > 4000){
                    errorMsg = errorMsg.substring(0,3990);
                }
                log.setUploadLog(errorMsg);
            }
            }
            else //成功
            else //成功
            {
            {

+ 241 - 19
patient-co-service/wlyy_sign/src/main/java/com/yihu/wlyy/sign/service/SignZYService.java

@ -15,6 +15,10 @@ import org.springframework.stereotype.Service;
import java.io.*;
import java.io.*;
import java.util.*;
import java.util.*;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;
/**
/**
 * Created by hzp on 2016/9/9.
 * Created by hzp on 2016/9/9.
@ -339,7 +343,7 @@ public class SignZYService {
        String msg = "";
        String msg = "";
        SignFamily sign = null;
        SignFamily sign = null;
        //**续签对接临时方案***
        //**续签对接临时方案***
        if(!"2017".equals(signYear))
        if(!"2018".equals(signYear))
        {
        {
            return false;
            return false;
        }
        }
@ -348,6 +352,7 @@ public class SignZYService {
        try {
        try {
            if (map != null && map.containsKey("IDENTITY_CARD_NO")) {
            if (map != null && map.containsKey("IDENTITY_CARD_NO")) {
                idcard = map.get("IDENTITY_CARD_NO");
                idcard = map.get("IDENTITY_CARD_NO");
//                System.out.println("开始同步基卫传递过来的签约数据(更新):居民身份证"+idcard);
                proId = map.get("PRO_ID");
                proId = map.get("PRO_ID");
                String chargeTime = map.get("CHARGE_TIME");//付款时间
                String chargeTime = map.get("CHARGE_TIME");//付款时间
                String flag = map.get("SUBSIDY_FLAG"); //是否补贴
                String flag = map.get("SUBSIDY_FLAG"); //是否补贴
@ -727,7 +732,6 @@ public class SignZYService {
        //签约变更记录表
        //签约变更记录表
        saveSignFamilyMapping(code, proId, signYear,idcard, action, isSuccess);
        saveSignFamilyMapping(code, proId, signYear,idcard, action, isSuccess);
        return isSuccess;
        return isSuccess;
    }
    }
@ -1007,10 +1011,11 @@ public class SignZYService {
        String msg = "";
        String msg = "";
        try {
        try {
            
            if (map != null && map.containsKey("PRO_ID") && map.get("RELEASE_FLAG").equals("2"))
            if (map != null && map.containsKey("PRO_ID") && map.get("RELEASE_FLAG").equals("2"))
            {
            {
                proId = map.get("PRO_ID");
                proId = map.get("PRO_ID");
//                System.out.println("开始同步基卫传递过来的解约数据:基卫pro_id"+proId);
                //通过proid获取code
                //通过proid获取code
                SignFamilyMapping mapping = signFamilyMappingDao.findByProId(proId);
                SignFamilyMapping mapping = signFamilyMappingDao.findByProId(proId);
                if(mapping==null || StringUtil.isEmpty(mapping.getCode()))
                if(mapping==null || StringUtil.isEmpty(mapping.getCode()))
@ -1086,7 +1091,7 @@ public class SignZYService {
        //签约变更记录表
        //签约变更记录表
        saveSignFamilyMapping(null, proId, null, idcard, action, isSuccess);
        saveSignFamilyMapping(null, proId, null, idcard, action, isSuccess);
//        System.out.println("开始同步基卫传递过来的解约数据:基卫pro_id"+proId+",同步成功");
        return isSuccess;
        return isSuccess;
    }
    }
@ -1215,31 +1220,101 @@ public class SignZYService {
     */
     */
    public void loadSignFamilyThread() throws Exception
    public void loadSignFamilyThread() throws Exception
    {
    {
        String startTime =  systemDictService.getLoadSignTime();   //上次执行时间
        /*Date start = DateUtil.getNextMin(DateUtil.strToDate(startTime), -1);   //重复采集前1分钟
        startTime = DateUtil.dateToStrLong(start);*/
        String endTime = DateUtil.dateToStrLong(new Date());
        System.out.print(DateUtil.getCurrentString()+ " update sign family start..");
        loadSignFamilyBatch(startTime, endTime);
        Date end = new Date();
        do {
            String startTime =  systemDictService.getLoadSignTime();   //上次执行时间
            Date start = DateUtil.getNextMin(DateUtil.strToDate(startTime), -1);   //重复采集前1分钟
            startTime = DateUtil.dateToStrLong(start);
    
            String endTime = DateUtil.dateToStrLong(new Date());
    
            System.out.println("采集时间:start="+startTime);
    
            end = DateUtil.getNextMin(DateUtil.strToDate(startTime), 30);//采集30分钟后的数据
            
            if(end.before(new Date())){
                endTime = DateUtil.dateToStrLong(end);
            }
            System.out.print(DateUtil.getCurrentString()+ " update sign family start..");
            loadSignFamilyBatch(startTime, endTime);
    
            //更新下次采集签约时间
            systemDictService.saveLoadSignTime(endTime);
        //更新下次采集签约时间
        systemDictService.saveLoadSignTime(endTime);
        }while (end.before(new Date()));
    }
    }
    
    
    /**
     * 【线程】调用批量更新签约数据
     * 多线程同步
     * @throws Exception
     */
    public void loadSignFamilyThreadMore() throws Exception
    {
        Date end = new Date();
        do {
            String startTime =  systemDictService.getLoadSignTime();   //上次执行时间
            Date start = DateUtil.getNextMin(DateUtil.strToDate(startTime), -1);   //重复采集前1分钟
            startTime = DateUtil.dateToStrLong(start);
            
            String endTime = DateUtil.dateToStrLong(new Date());
            
            System.out.println("采集时间:start="+startTime);
            
            end = DateUtil.getNextMin(DateUtil.strToDate(startTime), 15);//采集15分钟后的数据
            
            if(end.before(new Date())){
                endTime = DateUtil.dateToStrLong(end);
            }
            System.out.print(DateUtil.getCurrentString()+ " update sign family start..");
            loadSignFamilyBatchMore(startTime, endTime);
            
            //更新下次采集签约时间
            systemDictService.saveLoadSignTime(endTime);
            
        }while (end.before(new Date()));
    }
    
    /**
    /**
     * 【线程】调用批量新增签约数据
     * 【线程】调用批量新增签约数据
     */
     */
    public void loadNewSignFamilyThread() throws Exception
    public void loadNewSignFamilyThread() throws Exception
    {
    {
    
        Date end = new Date();
//        do {
        String startTime =  systemDictService.getLoadNewSignTime();   //上次执行时间
        String startTime =  systemDictService.getLoadNewSignTime();   //上次执行时间
        Date start = DateUtil.getNextMin(DateUtil.strToDate(startTime), -1);   //重复采集前1分钟
        Date start = DateUtil.getNextMin(DateUtil.strToDate(startTime), -1);   //重复采集前1分钟
        startTime = DateUtil.dateToStrLong(start);
        startTime = DateUtil.dateToStrLong(start);
    
        String endTime = DateUtil.dateToStrLong(new Date());
        String endTime = DateUtil.dateToStrLong(new Date());
    
        System.out.println("采集时间:start="+startTime);
    
        end = DateUtil.getNextMin(DateUtil.strToDate(startTime), 30);//采集30分钟后的数据
    
        if(end.before(new Date())){
            endTime = DateUtil.dateToStrLong(end);
        }
        System.out.println("采集时间:end="+endTime);
        loadNewSignFamilyBatch(startTime,endTime);
        loadNewSignFamilyBatch(startTime,endTime);
        //更新下次采集签约时间
        //更新下次采集签约时间
        systemDictService.saveLoadNewSignTime(endTime);
        systemDictService.saveLoadNewSignTime(endTime);
        
//        }while (end.before(new Date()));
        
//        String startTime =  systemDictService.getLoadNewSignTime();   //上次执行时间
//        Date start = DateUtil.getNextMin(DateUtil.strToDate(startTime), -1);   //重复采集前1分钟
//        startTime = DateUtil.dateToStrLong(start);
//        String endTime = DateUtil.dateToStrLong(new Date());
//
//        loadNewSignFamilyBatch(startTime,endTime);
//
//        //更新下次采集签约时间
//        systemDictService.saveLoadNewSignTime(endTime);
    }
    }
    /************************************* 公开接口 ************************************************/
    /************************************* 公开接口 ************************************************/
@ -1616,6 +1691,153 @@ public class SignZYService {
        }
        }
        return isSuccess;
        return isSuccess;
    }
    }
    
    
    /**
     * 遍历机构更新签约数据   (更新)--多线程同步
     */
    public void loadSignFamilyBatchMore(String startTime,String endTime) throws Exception
    {
        List<HospitalMapping> list = hospitalMappingDao.findJwOrg();
        long total =  0;
        long error = 0;
        if(list!=null && list.size()>0) //获取机构映射
        {
            for(HospitalMapping hm :list)
            {
                try {
                    String hospital = hm.getMappingCode();
                    String licence = hm.getLicence();
                    //获取某个时间段签约数据
                    String response =  zysoftService.getEhrOrgFamilySignInfo(startTime, endTime, hospital, licence,"0");
                    List<Map<String,String>> signList = zysoftService.getJwList(response);
                    
                    long htotal =  0;
                    long herror = 0;
                    if(signList!=null && signList.size()>0)
                    {
                        htotal =  signList.size();
    
                        System.out.print("遍历机构更新签约数据   (更新)"+startTime +"~" + endTime +"【"+hm.getName()+"】总采集"+htotal+"条:开始执行同步"+DateUtil.getCurrentString()+"..\r\n");
                        
                        //数据小于10条的直接走单线程处理
                        if(10 >= htotal){
                            //遍历数据
                            for(Map<String,String> signInfo:signList)
                            {
                                //判断是否解约
                                if(signInfo.get("RELEASE_FLAG")!=null && signInfo.get("RELEASE_FLAG").equals("2"))
                                {
                                    if(!releaseSignFamily(signInfo))
                                    {
                                        herror ++;
                                    }
                                }
                                else{
                                    if(!saveSignFamily(signInfo))
                                    {
                                        herror ++;
                                    }
                                }
                            }
                            total += htotal;
                            error += herror;
                        }else {
                         //数据大于10条的走多线程
                            long start = System.currentTimeMillis();
                            // 总数据条数
                            int dataSize = signList.size();
                            // 每10条数据开启一条线程
                            int threadSize = 10;
                            // 线程数
                            int threadNum = dataSize / threadSize + 1;
                            // 定义标记,过滤threadNum为整数
                            boolean special = dataSize % threadSize == 0;
    
    
                            System.out.print("遍历机构更新签约数据   (更新):线程数"+threadNum+"..\r\n");
    
                            // 创建一个线程池
                            ExecutorService exec = Executors.newFixedThreadPool(threadNum);
    
                            // 定义一个任务集合
                            List<Callable<Integer>> tasks = new ArrayList<Callable<Integer>>();
                            Callable<Integer> task = null;
                            List<Map<String,String>> cutList = null;
                            // 确定每条线程的数据
                            for (int i = 0; i < threadNum; i++) {
                                if (i == threadNum - 1) {
                                    if (special) {
                                        break;
                                    }
                                    cutList = signList.subList(threadSize * i, dataSize);
                                } else {
                                    cutList = signList.subList(threadSize * i, threadSize * (i + 1));
                                }
                                // System.out.println("第" + (i + 1) + "组:" + cutList.toString());
                                final List<Map<String,String>> listStr = cutList;
                                task = new Callable<Integer>() {
                                    @Override
                                    public Integer call() throws Exception {
                                        if(listStr!=null && listStr.size()>0)
                                        {
//                                            htotal =  signList.size();
                                            //遍历数据
                                            for(Map<String,String> signInfo:listStr)
                                            {
                                                //判断是否解约
                                                if(signInfo.get("RELEASE_FLAG")!=null && signInfo.get("RELEASE_FLAG").equals("2"))
                                                {
                                                    if(!releaseSignFamily(signInfo))
                                                    {
                                                        System.out.print("遍历机构更新签约数据   (更新):解约失败..\r\n");
//                                                        herror ++;
                                                    }
                                                }
                                                else{
                                                    if(!saveSignFamily(signInfo))
                                                    {
                                                        System.out.print("遍历机构更新签约数据   (更新):签约失败..\r\n");
//                                                        herror ++;
                                                    }
                                                }
                                            }
//                                            total += htotal;
//                                            error += herror;
                                        }
//                                        System.out.println(Thread.currentThread().getName() + "线程:");
                                        return 1;
                                    }
                                };
                                // 这里提交的任务容器列表和返回的Future列表存在顺序对应的关系
                                tasks.add(task);
                            }
                            List<Future<Integer>> results = exec.invokeAll(tasks);
                            for (Future<Integer> future : results) {
                                System.out.println(future.get());
                            }
                            // 关闭线程池
                            exec.shutdown();
                            System.out.println("线程任务执行结束");
                            System.err.println("执行任务消耗了 :" + (System.currentTimeMillis() - start) + "毫秒");
                         
                        }
                    }
                    System.out.print("遍历机构更新签约数据   (更新)"+startTime +"~" + endTime +"【"+hm.getName()+"】总采集"+htotal+"条,失败"+herror+"条。..\r\n");
                }
                catch (Exception e)
                {
                    System.out.print("遍历机构更新签约数据   (更新)"+startTime +"~" + endTime +"【"+hm.getName()+"】全部采集失败。..\r\n");
                }
            }
            
        }
        if(error != 0)
        {
            System.out.print("遍历机构更新签约数据   (更新)"+startTime +"~" + endTime +"批量更新签约数据,总条数"+total+"条,失败"+error+"条。..\r\n");
        }
    }
    /**
    /**
@ -1663,18 +1885,18 @@ public class SignZYService {
                        total += htotal;
                        total += htotal;
                        error += herror;
                        error += herror;
                    }
                    }
                    //System.out.print(startTime +"~" + endTime +"【"+hm.getName()+"】总采集"+htotal+"条,失败"+herror+"条。");
                    System.out.print("遍历机构更新签约数据   (更新)"+startTime +"~" + endTime +"【"+hm.getName()+"】总采集"+htotal+"条,失败"+herror+"条。");
                }
                }
                catch (Exception e)
                catch (Exception e)
                {
                {
                    //System.out.print(startTime +"~" + endTime +"【"+hm.getName()+"】全部采集失败。");
                    System.out.print("遍历机构更新签约数据   (更新)"+startTime +"~" + endTime +"【"+hm.getName()+"】全部采集失败。");
                }
                }
            }
            }
        }
        }
        if(error != 0)
        if(error != 0)
        {
        {
            //System.out.print(startTime +"~" + endTime +"批量更新签约数据,总条数"+total+"条,失败"+error+"条。");
            System.out.print("遍历机构更新签约数据   (更新)"+startTime +"~" + endTime +"批量更新签约数据,总条数"+total+"条,失败"+error+"条。");
        }
        }
    }
    }
@ -1723,18 +1945,18 @@ public class SignZYService {
                        total += htotal;
                        total += htotal;
                        error += herror;
                        error += herror;
                    }
                    }
                    //System.out.print(startTime +"~" + endTime +"【"+hm.getName()+"】总采集"+htotal+"条,失败"+herror+"条。");
                    System.out.print("遍历机构更新签约数据   (新增)"+startTime +"~" + endTime +"【"+hm.getName()+"】总采集"+htotal+"条,失败"+herror+"条。");
                }
                }
                catch (Exception e)
                catch (Exception e)
                {
                {
                    //System.out.print(startTime +"~" + endTime +"【"+hm.getName()+"】全部采集失败。");
                    System.out.print("遍历机构更新签约数据   (新增)"+startTime +"~" + endTime +"【"+hm.getName()+"】全部采集失败。");
                }
                }
            }
            }
        }
        }
        if(error != 0)
        if(error != 0)
        {
        {
            //System.out.print(startTime +"~" + endTime +"批量更新签约数据,总条数"+total+"条,失败"+error+"条。");
            System.out.print("遍历机构更新签约数据   (新增)"+startTime +"~" + endTime +"批量更新签约数据,总条数"+total+"条,失败"+error+"条。");
        }
        }
    }
    }

+ 3 - 3
patient-co/patient-co-wlyy/doc/技术文档/es/回访问卷新增索引.txt

@ -1,9 +1,9 @@
创建索引
创建索引
POST  http://172.19.103.68:9200/wlyy_questionnaire_winning
POST  http://27.155.100.191:9200//wlyy_questionnaire_winning
查询索引
查询索引
GET http://172.19.103.68:9200/wlyy_questionnaire_winning/
GET http://27.155.100.191:9200/wlyy_questionnaire_winning/
给索引加mapping
给索引加mapping
POST http://172.19.103.68:9200/wlyy_questionnaire_winning/wlyy_questionnaire_winning/_mapping
POST http://27.155.100.191:9200/wlyy_questionnaire_winning/wlyy_questionnaire_winning/_mapping
{
{
    "wlyy_questionnaire_winning": {
    "wlyy_questionnaire_winning": {
        "properties": {
        "properties": {