Forráskód Böngészése

JOB工程-慢病、随访、老年人体检修改。sign工程同步代码修改

huangwenjie 7 éve
szülő
commit
3b900616c2

+ 1 - 1
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/service/prescription/PrescriptionCATestServiceImp.java

@ -26,7 +26,7 @@ import java.util.UUID;
 * Created by hzp on 2017-07-31
 * 长处方CA认证服务
 */
@Profile({"dev","test"})
@Profile({"dev","test","devtest"})
@Service
public class PrescriptionCATestServiceImp extends ZysoftBaseService implements PrescriptionCAService{

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

@ -1839,6 +1839,7 @@ public class SignRenewZYService {
            for(SignFamilyMapping obj : list)
            {
                try {
                    System.out.println("mapping code:"+obj.getCode());
                    if(!uploadPreSignFamily(obj))
                    {
                        error++;
@ -1859,6 +1860,7 @@ public class SignRenewZYService {
            for(SignFamilyRenewLog log : listRenew)
            {
                try {
                    System.out.println("renelog code:"+log.getId());
                    if(!uploadRenewSignFamily(log))
                    {
                        error++;

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

@ -1258,6 +1258,7 @@ public class SignZYService {
            for(SignFamilyMapping obj : list)
            {
                try {
                    System.out.println(obj.getId());
                    if(!uploadSignFamily(obj.getCode()))
                    {
                        error++;
@ -1411,10 +1412,14 @@ public class SignZYService {
                    params.put("SICK_COUNTY", patient.getTown() == null ? "" : patient.getTown());    //行政区
                    params.put("SICK_COUNTRY", patient.getStreet() == null ? "" : patient.getStreet());    //街道
                    
                    if(StringUtils.isNoneBlank(patient.getSickVillage())){
                    if(StringUtils.isNotBlank(patient.getSickVillage())){
                        //居委会需要转换成基卫的居委会CODE
                        Country country = countryDao.findByCode(patient.getSickVillage());
                        params.put("SICK_VILLAGE", country.getJwCode());    //居委会
                        if(country != null){
                            params.put("SICK_VILLAGE", country.getJwCode());    //居委会
                        }else{
                            params.put("SICK_VILLAGE", "");    //居委会
                        }
                    }else{
                        params.put("SICK_VILLAGE", "");    //居委会
                    }

+ 19 - 7
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/FollowUpSynJob.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.job;
import com.yihu.wlyy.service.system.SystemDictService;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
import com.yihu.wlyy.util.DateUtil;
import org.quartz.Job;
@ -9,6 +10,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
/**
 * 居民随访记录同步JOB
 * @author huangwenjie
@ -20,18 +23,27 @@ public class FollowUpSynJob implements Job {
	@Autowired
	private JwPrescriptionService jwPrescriptionService;
	
	@Autowired
	private SystemDictService systemDictService;
	
	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		logger.info("START=====居民随访记录同步JOB");
		try {
			
			//获取前一天的时间范围
			String startdate = DateUtil.getNextDay(DateUtil.getStringDateShort(),-1) + " 00:00:00";
			String enddate = DateUtil.getNextDay(DateUtil.getStringDateShort(),-1) + " 23:59:59";
			
			//根据起止时间查询家签居民随访记录,并同步到本地数据库
			jwPrescriptionService.getFollowUpByTime(startdate,enddate);
			
			Date end = new Date();
			do{
				String startTime =  systemDictService.getFollowupSynTime();   //上次执行时间
				logger.info("采集时间:start="+startTime);
				end = DateUtil.getNextMin(DateUtil.strToDate(startTime), 60);
				String endTime = DateUtil.dateToStrLong(end);//采集60分钟后的数据
				logger.info("采集时间:end="+endTime);
				//根据起止时间查询家签居民随访记录,并同步到本地数据库
				jwPrescriptionService.getFollowUpByTime(startTime,endTime);
				//更新下次采集签约时间
				systemDictService.saveFollowupSynTime(endTime);
				
			}while (end.before(new Date()));
			logger.info("END========居民随访记录同步JOB");
		}catch (Exception e){
			e.printStackTrace();

+ 19 - 7
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/OldPeoplePhysicalExaminationSynJob.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.job;
import com.yihu.wlyy.service.system.SystemDictService;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
import com.yihu.wlyy.util.DateUtil;
import org.quartz.Job;
@ -9,6 +10,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
/**
 * 老年人体检记录同步JOB
 * @author huangwenjie
@ -21,17 +24,26 @@ public class OldPeoplePhysicalExaminationSynJob implements Job {
	@Autowired
	private JwPrescriptionService jwPrescriptionService;
	
	@Autowired
	private SystemDictService systemDictService;
	
	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		logger.info("START=====老年人体检记录同步JOB");
		try {
			
			//获取前一天的时间范围
			String startdate = DateUtil.getNextDay(DateUtil.getStringDateShort(),-1) + " 00:00:00";
			String enddate = DateUtil.getNextDay(DateUtil.getStringDateShort(),-1) + " 23:59:59";
			
			//根据起止时间查询家签慢病患者定标情况,并同步到本地数据库
			jwPrescriptionService.getOldPeoplePhysicalExaminationByTime(startdate,enddate);
			Date end = new Date();
			do{
				String startTime =  systemDictService.getOldPeopleExaminationTime();   //上次执行时间
				logger.info("采集时间:start="+startTime);
				end = DateUtil.getNextMin(DateUtil.strToDate(startTime), 60);
				String endTime = DateUtil.dateToStrLong(end);//采集60分钟后的数据
				logger.info("采集时间:end="+endTime);
				//根据起止时间查询家签慢病患者定标情况,并同步到本地数据库
				jwPrescriptionService.getOldPeoplePhysicalExaminationByTime(startTime,endTime);
				//更新下次采集签约时间
				systemDictService.saveOldPeopleExaminationTime(endTime);
				
			}while (end.before(new Date()));
			
			logger.info("END========老年人体检记录同步JOB");
		}catch (Exception e){

+ 18 - 7
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/PatientDiseaseConditionSynJob.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.job;
import com.yihu.wlyy.service.system.SystemDictService;
import com.yihu.wlyy.service.third.jw.JwPrescriptionService;
import com.yihu.wlyy.util.DateUtil;
import org.quartz.Job;
@ -9,6 +10,8 @@ import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import java.util.Date;
/**
 * 慢病患者定标情况同步JOB
@ -20,18 +23,26 @@ public class PatientDiseaseConditionSynJob implements Job {
    @Autowired
    private JwPrescriptionService jwPrescriptionService;
    @Autowired
    private SystemDictService systemDictService;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        logger.info("START=====开始更新慢病患者定标情况的JOB");
        try {
            //获取前一天的时间范围
            String startdate = DateUtil.getNextDay(DateUtil.getStringDateShort(),-1) + " 00:00:00";
            String enddate = DateUtil.getNextDay(DateUtil.getStringDateShort(),-1) + " 23:59:59";
            //根据起止时间查询家签慢病患者定标情况,并同步到本地数据库
            jwPrescriptionService.getPatientDiseaseContentMapByTime(startdate,enddate);
            Date end = new Date();
            do{
                String startTime =  systemDictService.getPatientDiseaseSynTime();   //上次执行时间
                logger.info("采集时间:start="+startTime);
                end = DateUtil.getNextMin(DateUtil.strToDate(startTime), 60);
                String endTime = DateUtil.dateToStrLong(end);//采集60分钟后的数据
                logger.info("采集时间:end="+endTime);
                //根据起止时间查询家签居民随访记录,并同步到本地数据库
                jwPrescriptionService.getPatientDiseaseContentMapByTime(startTime,endTime);
                //更新下次采集签约时间
                systemDictService.savePatientDiseaseSynTime(endTime);
        
            }while (end.before(new Date()));
            logger.info("END========开始更新慢病患者定标情况成功JOB");
        }catch (Exception e){

+ 3 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/repository/dict/SystemDictDao.java

@ -17,6 +17,9 @@ public interface SystemDictDao extends PagingAndSortingRepository<SystemDict, Lo
    @Query("select s.value from SystemDict s where s.dictName=?1 and s.code =?2")
    String findByDictNameAndCode(String dictName,String code);
    
    @Query("select s from SystemDict s where s.dictName=?1 and s.code=?2")
    SystemDict getByDictNameAndCode(String dictName,String code);
    @Query("select s from SystemDict s where s.value like ?1 ")
    List<SystemDict> findByLikeName(String name);

+ 162 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/system/SystemDictService.java

@ -84,4 +84,166 @@ public class SystemDictService {
            return false;
        }
    }
    
    /**
     * 获取老年人体检采集时间
     */
    public String getOldPeopleExaminationTime()
    {
        String re = "2016-10-01 00:00:00";
        try{
            SystemDict dict = systemDictDao.getByDictNameAndCode(dictName,"OLDPEOPLE_EXAM_TIME");
            if(dict==null)
            {
                dict = new SystemDict();
                dict.setDictName(dictName);
                dict.setCode("OLDPEOPLE_EXAM_TIME");
                dict.setValue(re);
                systemDictDao.save(dict);
            }
            else{
                re = dict.getValue();
            }
        }
        catch (Exception ex)
        {
            System.out.print("获取系统参数失败!");
        }
        
        return re;
    }
    
    /**
     * 保存老年人体检采集时间
     */
    public void saveOldPeopleExaminationTime(String endTime)
    {
        try{
            SystemDict dict = systemDictDao.getByDictNameAndCode(dictName,"OLDPEOPLE_EXAM_TIME");
            if(dict==null)
            {
                dict = new  SystemDict();
                dict.setDictName(dictName);
                dict.setCode("OLDPEOPLE_EXAM_TIME");
                dict.setValue(endTime);
            }
            else{
                dict.setValue(endTime);
            }
            
            systemDictDao.save(dict);
        }
        catch (Exception ex)
        {
            System.out.print("老年人体检采集时间失败!");
        }
    }
    
    /**
     * 获取随访记录采集时间
     */
    public String getFollowupSynTime()
    {
        String re = "2016-10-01 00:00:00";
        try{
            SystemDict dict = systemDictDao.getByDictNameAndCode(dictName,"FOLLOWUP_SYN_TIME");
            if(dict==null)
            {
                dict = new SystemDict();
                dict.setDictName(dictName);
                dict.setCode("FOLLOWUP_SYN_TIME");
                dict.setValue(re);
                systemDictDao.save(dict);
            }
            else{
                re = dict.getValue();
            }
        }
        catch (Exception ex)
        {
            System.out.print("获取系统参数失败!");
        }
        
        return re;
    }
    
    /**
     * 保存随访记录采集时间
     */
    public void saveFollowupSynTime(String endTime)
    {
        try{
            SystemDict dict = systemDictDao.getByDictNameAndCode(dictName,"FOLLOWUP_SYN_TIME");
            if(dict==null)
            {
                dict = new  SystemDict();
                dict.setDictName(dictName);
                dict.setCode("FOLLOWUP_SYN_TIME");
                dict.setValue(endTime);
            }
            else{
                dict.setValue(endTime);
            }
            
            systemDictDao.save(dict);
        }
        catch (Exception ex)
        {
            System.out.print("随访记录采集时间失败!");
        }
    }
    
    /**
     * 获取随访记录采集时间
     */
    public String getPatientDiseaseSynTime()
    {
        String re = "2017-01-01 00:00:00";
        try{
            SystemDict dict = systemDictDao.getByDictNameAndCode(dictName,"PATIENT_DESEASE_SYN_TIME");
            if(dict==null)
            {
                dict = new SystemDict();
                dict.setDictName(dictName);
                dict.setCode("PATIENT_DESEASE_SYN_TIME");
                dict.setValue(re);
                systemDictDao.save(dict);
            }
            else{
                re = dict.getValue();
            }
        }
        catch (Exception ex)
        {
            System.out.print("获取系统参数失败!");
        }
        
        return re;
    }
    
    /**
     * 保存随访记录采集时间
     */
    public void savePatientDiseaseSynTime(String endTime)
    {
        try{
            SystemDict dict = systemDictDao.getByDictNameAndCode(dictName,"PATIENT_DESEASE_SYN_TIME");
            if(dict==null)
            {
                dict = new  SystemDict();
                dict.setDictName(dictName);
                dict.setCode("PATIENT_DESEASE_SYN_TIME");
                dict.setValue(endTime);
            }
            else{
                dict.setValue(endTime);
            }
            
            systemDictDao.save(dict);
        }
        catch (Exception ex)
        {
            System.out.print("随访记录采集时间失败!");
        }
    }
}

+ 73 - 39
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/third/jw/JwPrescriptionService.java

@ -467,7 +467,7 @@ public class JwPrescriptionService {
                    Integer jwCode = jwData.getInteger("CODE");
                    if (1 == jwCode) {
                        JSONArray dataArray = jwData.getJSONArray("DATA");
                        logger.info("从基卫获取随访信息数量"+ dataArray.size());
                        logger.info("从基卫获取随访信息数量"+ dataArray.size()+",社区名称:"+hospitalMapping.getName());
                        for (int i = 0; i < dataArray.size(); i++) {
                            Followup followup = new Followup();
                    
@ -525,6 +525,8 @@ public class JwPrescriptionService {
                            if (doctor == null) {
                                logger.info("no mapping hospital:" + jworgCode + ",familyDoctor:" + jwdoctorCode);
                                continue;
                            }else{
                            
                            }
                            followup.setOrgCode(hm.getCode());//i健康机构编码
                            String doctorCode = doctor.getCode();//医生CODE
@ -536,6 +538,11 @@ public class JwPrescriptionService {
                    
                            String idcard = json.getString("IDENTITY_CARD_NO");//患者身份证
                            Patient patient = patientDao.findByIdcard(idcard);
                            
                            if(patient == null){
                                logger.info("no patient idcard:" + idcard);
                                continue;
                            }
                            String patientCode = patient.getCode();//患者CODE
                            String patientName = patient.getName();//患者姓名
                            followup.setIdcard(idcard);
@ -570,9 +577,8 @@ public class JwPrescriptionService {
                                continue;
                            }
                            Integer signType = Integer.parseInt(sign.getSignSource());//签约类型 1三师 2家庭
                            Long adminTeamCode = new Long(sign.getAdminTeamId());//行政团队
                            String signCode = sign.getCode();//签约表Code
                            followup.setAdminTeamCode(adminTeamCode);
                            followup.setAdminTeamCode(sign.getAdminTeamId());//行政团队
                            followup.setSignCode(signCode);
                    
                            //随访记录详
@ -668,9 +674,15 @@ public class JwPrescriptionService {
                                    followupContent7.put("CONTROL_CONSTITUTOR_JWDOCTORCODE", jwdoctorCode);//制定者本地CODE V05
                                }else{
                                    Doctor control_doctor = doctorDao.findMappingDoctor(CONTROL_CONSTITUTOR, jworgCode);
                                    followupContent7.put("CONTROL_CONSTITUTOR", control_doctor.getName());//制定者姓名 V05
                                    followupContent7.put("CONTROL_CONSTITUTOR_DOCTORCODE", control_doctor.getCode());//制定者本地CODE V05
                                    followupContent7.put("CONTROL_CONSTITUTOR_JWDOCTORCODE", CONTROL_CONSTITUTOR);//制定者本地CODE V05
                                    
                                    if(control_doctor == null){
                                        logger.info("no control doctor mapping CONTROL_CONSTITUTOR:" + CONTROL_CONSTITUTOR);
                                    }else{
                                        followupContent7.put("CONTROL_CONSTITUTOR", CONTROL_CONSTITUTOR);//制定者姓名 V05
                                        followupContent7.put("CONTROL_CONSTITUTOR_DOCTORCODE", "");//制定者本地CODE V05
                                        followupContent7.put("CONTROL_CONSTITUTOR_JWDOCTORCODE", CONTROL_CONSTITUTOR);//制定者基卫医生CODE V05
                                    }
                                }
                            }
                            
@ -709,6 +721,7 @@ public class JwPrescriptionService {
                            def.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW); // 事物隔离级别,开启新事务
                            TransactionStatus transactionStatus = transactionManager.getTransaction(def); // 获得事务状态
                            try {
                                followup.setCreateTime(new Date());
                                followup = followUpDao.save(followup);
                                Long followupId = followup.getId();
                                
@ -1120,8 +1133,9 @@ public class JwPrescriptionService {
     *@date 2017/11/1 15:17
     */
    public void esDeleteFollowUpContent(List<FollowupContentESDO> datalist) throws Exception{
        JestClient jestClient = null;
        try {
            JestClient jestClient = elasticFactory.getJestClient();
            jestClient = elasticFactory.getJestClient();
            //根据id批量删除
            Bulk.Builder bulk = new Bulk.Builder().defaultIndex(esIndex).defaultType(esType);
            for (FollowupContentESDO obj : datalist) {
@ -1134,6 +1148,11 @@ public class JwPrescriptionService {
            logger.info("delete flag:" + br.isSucceeded());
        }catch (Exception e){
            e.printStackTrace();
            logger.error(" delete error :" + e.getMessage());
        }finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
        
    }
@ -1144,25 +1163,29 @@ public class JwPrescriptionService {
     *@date 2017/11/1 19:41
     */
    public List<FollowupContentESDO>  esfindFollowUpContestsByFollowupId(String id) throws Exception {
        //根据随访ID、分类ID获取随访记录详情
        
        JestClient jestClient = null;
        List<String> resultList = new ArrayList<>();
        
        JestClient jestClient = elasticFactory.getJestClient();
        //先根据条件查找出来
        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
        searchSourceBuilder.query(
                new BoolQueryBuilder()
                        .must(QueryBuilders.matchQuery("followup_id", id))
        );
        
        Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType)
                .build();
        SearchResult result = jestClient.execute(search);
        
        List<FollowupContentESDO> followupContentESDOList = new ArrayList<>();
        jestClient.shutdownClient();
        try {
            //根据随访ID、分类ID获取随访记录详情
            jestClient = elasticFactory.getJestClient();
            //先根据条件查找出来
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            searchSourceBuilder.query(
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("followup_id", id))
            );
        
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType)
                    .build();
            SearchResult result = jestClient.execute(search);
            followupContentESDOList = result.getSourceAsObjectList(FollowupContentESDO.class);
            jestClient.shutdownClient();
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
        return followupContentESDOList;
    }
    
@ -1172,21 +1195,32 @@ public class JwPrescriptionService {
     *@date 2017/11/1 14:57
     */
    public void esSaveFollowupContentData(String followupid, List<FollowupContentESDO> newdatalist) throws Exception {
        JestClient jestClient = elasticFactory.getJestClient();
        //先根据条件查找出来
        SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
        searchSourceBuilder.query(
                new BoolQueryBuilder()
                        .must(QueryBuilders.matchQuery("followup_id", id))
        );
        Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType).build();
        SearchResult result = jestClient.execute(search);
        List<FollowupContentESDO> dataList = result.getSourceAsObjectList(FollowupContentESDO.class);
        //删除原有记录
        this.esDeleteFollowUpContent(dataList);
        //保存新的随访详情记录
        elastricSearchSave.save(newdatalist,esIndex,esType);
        jestClient.shutdownClient();
        JestClient jestClient = null;
        
        try {
            jestClient = elasticFactory.getJestClient();
            //先根据条件查找出来
            SearchSourceBuilder searchSourceBuilder = new SearchSourceBuilder();
            searchSourceBuilder.query(
                    new BoolQueryBuilder()
                            .must(QueryBuilders.matchQuery("followup_id", id))
            );
            Search search = new Search.Builder(searchSourceBuilder.toString()).addIndex(esIndex).addType(esType).build();
            SearchResult result = jestClient.execute(search);
            List<FollowupContentESDO> dataList = result.getSourceAsObjectList(FollowupContentESDO.class);
            //删除原有记录
            this.esDeleteFollowUpContent(dataList);
            //保存新的随访详情记录
            elastricSearchSave.save(newdatalist,esIndex,esType);
            jestClient.shutdownClient();
        }catch (Exception e){
            logger.error(" save error :" + e.getMessage());
            e.printStackTrace();
        } finally {
            if (jestClient != null) {
                jestClient.shutdownClient();
            }
        }
    }
    
    public HashMap<String,String> operaESFollowUpContentData(List<FollowupContentESDO> esdataList){

+ 48 - 50
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/web/quota/JobController.java

@ -507,7 +507,7 @@ public class JobController extends BaseController {
    /**
     *立即执行前一天的慢病患者定标情况同步
     *立即执行慢病患者定标情况同步
     *@author huangwenjie
     *@date 2017/9/17 14:16
     */
@ -515,7 +515,7 @@ public class JobController extends BaseController {
    @ApiOperation("立即执行前一天的慢病患者定标情况同步")
    public String executePatientDiseaseConditionSynJob() {
        try {
            quartzHelper.startNow(PatientDiseaseConditionSynJob.class, "PATIENT-DISEASE-CONDITION-SYN", null);
            quartzHelper.startNow(PatientDiseaseConditionSynJob.class, UUID.randomUUID().toString(), null);
            return write(200, "启动成功");
        } catch (Exception e) {
            error(e);
@ -531,25 +531,13 @@ public class JobController extends BaseController {
    @RequestMapping(value = "/executePatientDiseaseConditionSynJobByTime", method = RequestMethod.POST)
    @ApiOperation("根据时间范围执行慢病患者定标情况同步")
    public String executePatientDiseaseConditionSynJobByTime(
            @ApiParam(name="startdate", value="开始时间:yyyy-mm-dd")
            @ApiParam(name="startdate", value="开始时间:yyyy-mm-dd hh:mm:ss")
            @RequestParam(value = "startdate",required = true) String startdate,
            @ApiParam(name="enddate", value="结束时间:yyyy-mm-dd")
            @ApiParam(name="enddate", value="结束时间:yyyy-mm-dd hh:mm:ss")
            @RequestParam(value = "enddate",required = true) String enddate) {
        try {
            String start = "";
            String end = "";
            do{
                start = startdate + " 00:00:00";
                end = startdate + " 23:59:59";
                //根据起止时间查询家签慢病患者定标情况,并同步到本地数据库
                jwPrescriptionService.getPatientDiseaseContentMapByTime(start,end);
                startdate = DateUtil.getNextDay(startdate,1);
            }while (!startdate.equals(enddate));
            //根据起止时间查询家签慢病患者定标情况,并同步到本地数据库
            jwPrescriptionService.getPatientDiseaseContentMapByTime(startdate,enddate);
            return write(200, "执行成功");
        } catch (Exception e) {
            error(e);
@ -582,25 +570,13 @@ public class JobController extends BaseController {
    @RequestMapping(value = "/executeOldPeoplePhysicalExaminationSynByTime", method = RequestMethod.POST)
    @ApiOperation("根据时间范围同步老年人体检记录")
    public String executeOldPeoplePhysicalExaminationSynByTime(
            @ApiParam(name="startdate", value="开始时间:yyyy-mm-dd")
            @ApiParam(name="startdate", value="开始时间:yyyy-mm-dd hh:mm:ss")
            @RequestParam(value = "startdate",required = true) String startdate,
            @ApiParam(name="enddate", value="结束时间:yyyy-mm-dd")
            @ApiParam(name="enddate", value="结束时间:yyyy-mm-dd hh:mm:ss")
            @RequestParam(value = "enddate",required = true) String enddate) {
        try {
            
            String start = "";
            String end = "";
            
            do{
                start = startdate + " 00:00:00";
                end = startdate + " 23:59:59";
                //根据时间范围同步老年人体检记录,并同步到本地数据库
                jwPrescriptionService.getOldPeoplePhysicalExaminationByTime(start,end);
                
                startdate = DateUtil.getNextDay(startdate,1);
                
            }while (!startdate.equals(enddate));
            
            //根据时间范围同步老年人体检记录,并同步到本地数据库
            jwPrescriptionService.getOldPeoplePhysicalExaminationByTime(startdate,enddate);
            return write(200, "执行成功");
        } catch (Exception e) {
            error(e);
@ -608,6 +584,23 @@ public class JobController extends BaseController {
        }
    }
    
    /**
     *立即执行同步老年人体检记录
     *@author huangwenjie
     *@date 2017/9/17 14:16
     */
    @RequestMapping(value = "/executeOldPeoplePhysicalExaminationSynJob", method = RequestMethod.POST)
    @ApiOperation("立即执行前一天的同步老年人体检记录")
    public String executeOldPeoplePhysicalExaminationSynJob() {
        try {
            quartzHelper.startNow(OldPeoplePhysicalExaminationSynJob.class, UUID.randomUUID().toString(), null);
            return write(200, "启动成功");
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
    
    /**
     *根据时间范围同步居民随访记录
     *@author huangwenjie
@ -616,25 +609,13 @@ public class JobController extends BaseController {
    @RequestMapping(value = "/executeFollowUpSynByTime", method = RequestMethod.POST)
    @ApiOperation("根据时间范围同步居民随访记录")
    public String executeFollowUpSynByTime(
            @ApiParam(name="startdate", value="开始时间:yyyy-mm-dd")
            @ApiParam(name="startdate", value="开始时间:yyyy-mm-dd hh:mm:ss")
            @RequestParam(value = "startdate",required = true) String startdate,
            @ApiParam(name="enddate", value="结束时间:yyyy-mm-dd")
            @ApiParam(name="enddate", value="结束时间:yyyy-mm-dd hh:mm:ss")
            @RequestParam(value = "enddate",required = true) String enddate) {
        try {
            String start = "";
            String end = "";
            do{
                start = startdate + " 00:00:00";
                end = startdate + " 23:59:59";
                //根据时间范围同步居民随访记录
                jwPrescriptionService.getFollowUpByTime(start,end);
                startdate = DateUtil.getNextDay(startdate,1);
            }while (!startdate.equals(enddate));
            //根据时间范围同步居民随访记录
            jwPrescriptionService.getFollowUpByTime(startdate,enddate);
            return write(200, "执行成功");
        } catch (Exception e) {
            error(e);
@ -642,6 +623,23 @@ public class JobController extends BaseController {
        }
    }
    
    /**
     *立即执行居民随访记录同步
     *@author huangwenjie
     *@date 2017/9/17 14:16
     */
    @RequestMapping(value = "/executeFollowUpSynByJob", method = RequestMethod.POST)
    @ApiOperation("立即执行前一天的居民随访记录同步")
    public String executeFollowUpSynByJob() {
        try {
            quartzHelper.startNow(FollowUpSynJob.class, UUID.randomUUID().toString(), null);
            return write(200, "启动成功");
        } catch (Exception e) {
            error(e);
            return error(-1, e.getMessage());
        }
    }
    
    /**
     * 居民随访记录上传(上传到基卫)
     *@author huangwenjie