ソースを参照

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

trick9191 7 年 前
コミット
9390e9eba7
18 ファイル変更603 行追加97 行削除
  1. 29 1
      common/common-entity/src/main/java/com/yihu/wlyy/entity/imm/ChildImmuneVaccin.java
  2. 20 5
      patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/JMController.java
  3. 10 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/event/ApplicationEvent.java
  4. 28 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/ChildImmuneVaccinJob.java
  5. 31 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/repository/imm/ChildImmuneVaccinDao.java
  6. 163 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/imm/ChildVaccinImmuneService.java
  7. 56 0
      patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/third/jw/ImmuneService.java
  8. 1 0
      patient-co/patient-co-wlyy-job/src/main/resources/application-devtest.yml
  9. 3 0
      patient-co/patient-co-wlyy-job/src/main/resources/system.properties
  10. 19 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/imm/ChildImmuneVaccinDao.java
  11. 132 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/imm/ChildFamilyImmuneService.java
  12. 2 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistScreenResultService.java
  13. 18 3
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/guahao/ImmuneService.java
  14. 24 4
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/imm/DoctorImmController.java
  15. 2 0
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/GcTokenController.java
  16. 10 2
      patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/GcTokenModel.java
  17. 51 75
      patient-co/patient-co-wlyy/src/main/resources/wechat/weixin_menu_haicang.txt
  18. 4 1
      patient-co/patient-co-wlyy/src/main/resources/wechat/weixin_menu_jimei.txt

+ 29 - 1
common/common-entity/src/main/java/com/yihu/wlyy/entity/imm/ChildImmuneVaccin.java

@ -25,10 +25,13 @@ public class ChildImmuneVaccin extends IdEntity {
	private String ymkcsm;                  //疫苗库存说明(库存充足,可以预约/库存不足,不能预约)
	private String ymbm;                    //疫苗编码
	private String jzzc;                    //接种针次
	private Date jzrq;						  //接种日期
	private Integer isOut;					  //是否超过接种日期7天(0是 1不是)
	private Integer alert_tag;              //0待提醒,1已提醒
	private Date alert_time;                //提醒时间
	private Date create_time;               //创建时间
	private Date update_time;               //创建时间
	private Integer del;					  //0正常 1作废
	
	public String getCode() {
		return code;
@ -109,7 +112,24 @@ public class ChildImmuneVaccin extends IdEntity {
	public void setJzzc(String jzzc) {
		this.jzzc = jzzc;
	}
	
	public Date getJzrq() {
		return jzrq;
	}
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+08:00")
	public void setJzrq(Date jzrq) {
		this.jzrq = jzrq;
	}
	public Integer getIsOut() {
		return isOut;
	}
	public void setIsOut(Integer isOut) {
		this.isOut = isOut;
	}
	public Integer getAlert_tag() {
		return alert_tag;
	}
@ -143,4 +163,12 @@ public class ChildImmuneVaccin extends IdEntity {
	public void setAlert_time(Date alert_time) {
		this.alert_time = alert_time;
	}
	public Integer getDel() {
		return del;
	}
	public void setDel(Integer del) {
		this.del = del;
	}
}

+ 20 - 5
patient-co-service/wlyy_service/src/main/java/com/yihu/wlyy/service/controller/JMController.java

@ -1,5 +1,6 @@
package com.yihu.wlyy.service.controller;
import com.google.gson.JsonObject;
import com.yihu.wlyy.service.common.model.Result;
import com.yihu.wlyy.service.entity.PatientReservation;
import com.yihu.wlyy.service.service.JMService;
@ -8,6 +9,7 @@ import com.yihu.wlyy.service.service.guahao.GuahaoService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@ -312,8 +314,12 @@ public class JMController {
	{
		try {
			String data = jmService.findMyVaccin(deptNum,etmykh);
			return Result.success("查询儿童可预约疫苗成功!",data);
			JSONObject jsonObject = new JSONObject(data);
			if (jsonObject.getInt("msgCode")==800){
				return Result.success("查询儿童可预约疫苗成功!",data);
			}else {
				return Result.error(jsonObject.getString("msg"));
			}
		} catch (Exception ex) {
			ex.printStackTrace();
			return Result.error(ex.getMessage());
@ -327,8 +333,12 @@ public class JMController {
	{
		try {
			String data = jmService.findDept(etmykh);
			return Result.success("获取接种门诊成功!",data);
			JSONObject jsonObject = new JSONObject(data);
			if (jsonObject.getInt("msgCode")==800){
				return Result.success("获取接种门诊成功!",data);
			}else {
				return Result.error(jsonObject.getString("msg"));
			}
		} catch (Exception ex) {
			ex.printStackTrace();
			return Result.error(ex.getMessage());
@ -342,8 +352,13 @@ public class JMController {
	{
		try {
			String data = jmService.findWzymBymykh(etmykh);
			JSONObject jsonObject = new JSONObject(data);
			if (jsonObject.getInt("msgCode")==800){
				return Result.success("获取接种记录成功!",data);
			}else{
				return Result.error(jsonObject.getString("msg"));
			}
			return Result.success("获取接种记录成功!",data);
		} catch (Exception ex) {
			ex.printStackTrace();
			return Result.error(ex.getMessage());

+ 10 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/event/ApplicationEvent.java

@ -282,6 +282,16 @@ public class ApplicationEvent implements ApplicationListener<ContextRefreshedEve
                logger.info("NoticeJob  job exist");
            }
            //获取儿童可预约疫苗,每天凌晨1点执行一次
            if (!quartzHelper.isExistJob("child_immune_vaccin_job")) {
                String trigger = SystemConf.getInstance().getSystemProperties().getProperty("child_immune_vaccin_job");
                quartzHelper.addJob(ChildImmuneVaccinJob.class, trigger, "child_immune_vaccin_job", new HashMap<String, Object>());
                logger.info("child_immune_vaccin_job  job success");
            } else {
                logger.info("child_immune_vaccin_job  job exist");
            }
        } catch (Exception e) {
            logger.info("sign end job start failed");
        }

+ 28 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/job/ChildImmuneVaccinJob.java

@ -0,0 +1,28 @@
package com.yihu.wlyy.job;
import com.yihu.wlyy.service.imm.ChildVaccinImmuneService;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
public class ChildImmuneVaccinJob implements Job {
    private static final Logger logger = LoggerFactory.getLogger(ChildImmuneVaccinJob.class);
    @Autowired
    private ChildVaccinImmuneService childVaccinImmuneService;
    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        logger.info("START========每天获取儿童可预约疫苗JOB========");
        try {
            childVaccinImmuneService.getChildImmuneVaccinEveryDay();
            logger.info("END========每天获取儿童可预约疫苗JOB========");
        }catch (Exception e){
            e.printStackTrace();
            logger.info("END===ERROE===每天获取儿童可预约疫苗JOB,message:"+e.getMessage());
        }
    }
}

+ 31 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/repository/imm/ChildImmuneVaccinDao.java

@ -0,0 +1,31 @@
package com.yihu.wlyy.repository.imm;
import com.yihu.wlyy.entity.imm.ChildImmuneVaccin;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * @author zhangdan
 * @date 2018/9/27 09:38
 */
public interface ChildImmuneVaccinDao extends PagingAndSortingRepository<ChildImmuneVaccin, Long>,
		JpaSpecificationExecutor<ChildImmuneVaccin> {
	List<ChildImmuneVaccin> findByBarcode(String barcode);
	@Modifying
	@Query("update ChildImmuneVaccin  c set c.del=1 where c.code=?1")
	int updateDelByCode(String code);
	@Modifying
	@Query("update ChildImmuneVaccin  c set c.isOut=0 where c.code=?1")
	int updateIsOutByCode(String code);
	@Modifying
	@Query("update ChildImmuneVaccin  c set c.alert_tag=0 where c.code=?1")
	int updateAlertTagByCode(String code);
}

+ 163 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/imm/ChildVaccinImmuneService.java

@ -0,0 +1,163 @@
package com.yihu.wlyy.service.imm;
import com.yihu.wlyy.entity.imm.ChildFamilyImmune;
import com.yihu.wlyy.entity.imm.ChildImmuneVaccin;
import com.yihu.wlyy.entity.imm.ChildInfo;
import com.yihu.wlyy.repository.imm.ChildImmuneVaccinDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.third.jw.ImmuneService;
import com.yihu.wlyy.util.DateUtil;
import org.apache.commons.lang.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.*;
/**
 * 免疫关系业务层
 * @author zhangdan
 * @date 2018/9/27 20:01
 */
@Service
public class ChildVaccinImmuneService extends BaseService {
	
	@Autowired
	private JdbcTemplate jdbcTemplate;
	@Autowired
	private ChildImmuneVaccinDao childImmuneVaccinDao;
	@Autowired
	private ImmuneService immuneService;
	
	@Transactional(rollbackFor = Exception.class)
	public int getChildImmuneVaccinEveryDay()throws Exception{
		int result = 0;
		try {
			String sql ="SELECT" +
					" DISTINCT ci.`code`," +
					" ci.idcard," +
					" ci.`name`," +
					" ci.ssc," +
					" ci.barcode" +
					" FROM" +
					" wlyy_child_family_immune fi" +
					" LEFT JOIN wlyy_child_info ci ON fi.child_code = ci.`code`" +
					" WHERE" +
					" fi.del = 0";
			List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
			for (Map<String,Object> map : list){
				String barcode = String.valueOf(map.get("barcode"));
				System.out.println("===============barcode=============="+barcode);
				String deptStr = immuneService.findDept(barcode);
				if (StringUtils.isNotBlank(deptStr)){
					JSONObject jsonObject = new JSONObject(deptStr);
					if (jsonObject.getInt("status")==200) {
						JSONObject json = new JSONObject(jsonObject.getString("data"));
						JSONArray jsonArray = json.getJSONArray("body");
						for (int i = 0;i<jsonArray.length();i++){
							String deptNum  = jsonArray.getJSONObject(i).getString("deptNum");
							String vaccinStr = immuneService.findMyVaccin(barcode,deptNum);
							JSONObject vaccinJson = new JSONObject(vaccinStr);
							if (vaccinJson.getInt("status")==200) {
								JSONObject vaccinJson2 = new JSONObject(vaccinJson.getString("data"));
								JSONArray vaccinJsonJSONArray = vaccinJson2.getJSONArray("body");
								List<ChildImmuneVaccin> vaccinList = childImmuneVaccinDao.findByBarcode(barcode);
								//原来有的则不用新增,原来有的但是在返回回来的数据没有的话删除数据
								for (ChildImmuneVaccin childImmuneVaccin : vaccinList){
									int count = 0;
									for (int j=0;j<vaccinJsonJSONArray.length();j++){
										String ymbm = vaccinJsonJSONArray.getJSONObject(j).getString("ymBm");
										String jzzc = vaccinJsonJSONArray.getJSONObject(j).getString("jzZc");
										if (childImmuneVaccin.getYmbm().equals(ymbm) && childImmuneVaccin.getJzzc().equals(jzzc)){
											count++;
										}
									}
									//原来有的疫苗要判断是否有超过预约时间的7天,并且看提醒是否超过7天,超过7天可以重新提醒
									if (count>0 && childImmuneVaccin.getIsOut()==1){
										if (DateUtil.getPreDays(childImmuneVaccin.getJzrq(),7).before(new Date())){
											//过了预约时间7天,更新为isOut=0,则不能预约了
											childImmuneVaccinDao.updateIsOutByCode(childImmuneVaccin.getCode());
										}else {
											//判断是否过了7天提醒时间
											if (childImmuneVaccin.getAlert_tag()==1 && DateUtil.getPreDays(childImmuneVaccin.getAlert_time(),7).before(new Date())){
												childImmuneVaccinDao.updateAlertTagByCode(childImmuneVaccin.getCode());
											}
										}
									}
									if (count==0){
										result+= childImmuneVaccinDao.updateDelByCode(childImmuneVaccin.getCode());
									}
								}
								//如果本地没有就是新增的
								List<ChildImmuneVaccin> vaccins = new ArrayList<>();
								for (int j=0;j<vaccinJsonJSONArray.length();j++){
									String ymbm = vaccinJsonJSONArray.getJSONObject(j).getString("ymBm");
									String jzzc = vaccinJsonJSONArray.getJSONObject(j).getString("jzZc");
									int count = 0;
									for (ChildImmuneVaccin childImmuneVaccin : vaccinList){
										if (childImmuneVaccin.getYmbm().equals(ymbm) && childImmuneVaccin.getJzzc().equals(jzzc)){
											count++;
										}
									}
									if (count==0){
										ChildImmuneVaccin childImmuneVaccin = new ChildImmuneVaccin();
										childImmuneVaccin.setCode(UUID.randomUUID().toString().replaceAll("-", ""));
										childImmuneVaccin.setName(String.valueOf(map.get("name")));
										childImmuneVaccin.setIdcard(String.valueOf(map.get("idcard")));
										childImmuneVaccin.setSsc(String.valueOf(map.get("ssc")));
										childImmuneVaccin.setBarcode(barcode);
										childImmuneVaccin.setYmkc(vaccinJsonJSONArray.getJSONObject(j).getString("ymkc"));
										childImmuneVaccin.setYmmc(vaccinJsonJSONArray.getJSONObject(j).getString("ymmc"));
										childImmuneVaccin.setYmkcsm(vaccinJsonJSONArray.getJSONObject(j).getString("ymkcsm"));
										childImmuneVaccin.setYmbm(ymbm);
										childImmuneVaccin.setJzzc(jzzc);
										childImmuneVaccin.setJzrq(DateUtil.strToDate(vaccinJsonJSONArray.getJSONObject(j).getString("jzRq"),DateUtil.YYYY_MM_DD));
										childImmuneVaccin.setAlert_tag(0);
										childImmuneVaccin.setDel(0);
										childImmuneVaccin.setCreate_time(new Date());
										if (DateUtil.getPreDays(DateUtil.strToDate(vaccinJsonJSONArray.getJSONObject(j).getString("jzRq")),7).before(new Date())){
											//过了预约时间7天,更新为isOut=0,则不能预约了
											childImmuneVaccin.setIsOut(0);
										}else {
											childImmuneVaccin.setIsOut(1);
										}
										vaccins.add(childImmuneVaccin);
										result++;
									}
								}
								childImmuneVaccinDao.save(vaccins);
							/*for (int j=0;j<vaccinJsonJSONArray.length();j++){
								String ymbm = vaccinJsonJSONArray.getJSONObject(j).getString("ymBm");
								String jzzc = vaccinJsonJSONArray.getJSONObject(j).getString("jzZc");
								if (childImmuneVaccinDao.findByBarcodeAndYmbmAndJzzc(barcode,ymbm,jzzc)==null){
									ChildImmuneVaccin childImmuneVaccin = new ChildImmuneVaccin();
									childImmuneVaccin.setCode(getUUID());
									childImmuneVaccin.setName(String.valueOf(map.get("name")));
									childImmuneVaccin.setIdcard(String.valueOf(map.get("idcard")));
									childImmuneVaccin.setSsc(String.valueOf(map.get("ssc")));
									childImmuneVaccin.setBarcode(barcode);
									childImmuneVaccin.setYmkc(vaccinJsonJSONArray.getJSONObject(j).getString("ymkc"));
									childImmuneVaccin.setYmmc(vaccinJsonJSONArray.getJSONObject(j).getString("ymmc"));
									childImmuneVaccin.setYmkcsm(vaccinJsonJSONArray.getJSONObject(j).getString("ymkcsm"));
									childImmuneVaccin.setYmbm(ymbm);
									childImmuneVaccin.setJzzc(jzzc);
									childImmuneVaccin.setAlert_tag(0);
									childImmuneVaccin.setCreate_time(new Date());
								}
							}*/
							}
						}
					}
				}
			}
		}catch (Exception e){
			e.printStackTrace();
		}
		return result;
	}
}

+ 56 - 0
patient-co/patient-co-wlyy-job/src/main/java/com/yihu/wlyy/service/third/jw/ImmuneService.java

@ -0,0 +1,56 @@
package com.yihu.wlyy.service.third.jw;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.yihu.wlyy.entity.organization.Hospital;
import com.yihu.wlyy.repository.organization.HospitalDao;
import com.yihu.wlyy.repository.organization.HospitalMappingDao;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.HttpClientUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;
import org.dom4j.Document;
import org.dom4j.DocumentHelper;
import org.dom4j.Element;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.text.SimpleDateFormat;
import java.util.*;
/**
 * 免疫接种预约挂号
 * @author zhangdan
 * @date 2018/9/27 19:43
 */
@Service
public class ImmuneService {
	private static final Logger logger = LoggerFactory.getLogger(ImmuneService.class);
	//基卫服务地址
	@Value("${sign.check_upload}")
	private String jwUrl;
	@Autowired
	private HttpClientUtil httpClientUtil;
	public String findMyVaccin(String barcode,String deptNum) throws Exception{
		String url = jwUrl + "/third/jm/imm/findMyVaccin";
		List<NameValuePair> params = new ArrayList<>();
		params.add(new BasicNameValuePair("deptNum", deptNum));
		params.add(new BasicNameValuePair("etmykh", barcode));
		String response = httpClientUtil.post(url, params, "UTF-8");
		return response;
	}
	public String findDept(String barcode) throws Exception{
		String url = jwUrl + "/third/jm/imm/findDept";
		List<NameValuePair> params = new ArrayList<>();
		params.add(new BasicNameValuePair("etmykh", barcode));
		String response = httpClientUtil.post(url, params, "UTF-8");
		return response;
	}
}

+ 1 - 0
patient-co/patient-co-wlyy-job/src/main/resources/application-devtest.yml

@ -89,6 +89,7 @@ images:
sign:
  check_upload: http://172.19.103.88:8011/wlyy_service
  zysoft: http://59.61.92.90:8072/wlyy_sign
  #check_upload: http://localhost:8011/
quartz:
  name: schedulerFactoryBean_test_dev

+ 3 - 0
patient-co/patient-co-wlyy-job/src/main/resources/system.properties

@ -137,6 +137,9 @@ patient_confirm_receipt_job=00 0 8,12,18,21 * * ?
# 病患者医疗保险号同步JOB (每天6点执行一次)
patient_medicare_number_job=0 0 6 * * ?
# 获取儿童可预约疫苗,每天凌晨1点执行一次
child_immune_vaccin_job=0 0 1 * * ?
#统一支付平台支付成功后页面跳转地址
return_url={server}/wx/html/qygl/html/pay_result.html
#统一支付平台支付接口地址

+ 19 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/repository/imm/ChildImmuneVaccinDao.java

@ -2,9 +2,12 @@ package com.yihu.wlyy.repository.imm;
import com.yihu.wlyy.entity.imm.ChildImmuneVaccin;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.PagingAndSortingRepository;
import java.util.List;
/**
 * @author huangwenjie
 * @date 2018/6/21 09:38
@ -13,4 +16,20 @@ public interface ChildImmuneVaccinDao extends PagingAndSortingRepository<ChildIm
		JpaSpecificationExecutor<ChildImmuneVaccin> {
	@Query("select p from ChildImmuneVaccin p where p.barcode=?1")
	ChildImmuneVaccin getChildImmuneVaccinByBarcode(String barcode);
	List<ChildImmuneVaccin> findByBarcodeAndYmbmAndJzzc(String barcode,String ymbm,String jzzc);
	List<ChildImmuneVaccin> findByBarcode(String barcode);
	@Modifying
	@Query("update ChildImmuneVaccin  c set c.del=1 where c.code=?1")
	int updateDelByCode(String code);
	@Modifying
	@Query("update ChildImmuneVaccin  c set c.isOut=0 where c.code=?1")
	int updateIsOutByCode(String code);
	@Modifying
	@Query("update ChildImmuneVaccin  c set c.alert_tag=0 where c.code=?1")
	int updateAlertTagByCode(String code);
}

+ 132 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/imm/ChildFamilyImmuneService.java

@ -7,6 +7,8 @@ import com.yihu.wlyy.repository.imm.ChildFamilyImmuneDao;
import com.yihu.wlyy.repository.imm.ChildImmuneVaccinDao;
import com.yihu.wlyy.repository.imm.ChildInfoDao;
import com.yihu.wlyy.service.BaseService;
import com.yihu.wlyy.service.third.guahao.ImmuneService;
import com.yihu.wlyy.util.DateUtil;
import org.apache.commons.lang.StringUtils;
import org.json.JSONArray;
import org.json.JSONObject;
@ -15,10 +17,7 @@ import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.UUID;
import java.util.*;
/**
 * 家人免疫关系业务层
@ -36,6 +35,8 @@ public class ChildFamilyImmuneService extends BaseService {
	JdbcTemplate jdbcTemplate;
	@Autowired
	private ChildImmuneVaccinDao childImmuneVaccinDao;
	@Autowired
	private ImmuneService immuneService;
	
	/**
	 * 绑定家庭成员免疫关系
@ -122,4 +123,131 @@ public class ChildFamilyImmuneService extends BaseService {
	public ChildImmuneVaccin getChildImmuneVaccinByBarcode(String barcode){
		return childImmuneVaccinDao.getChildImmuneVaccinByBarcode(barcode);
	}
	@Transactional(rollbackFor = Exception.class)
	public int getChildImmuneVaccinEveryDay()throws Exception{
		int result = 0;
		try {
			String sql ="SELECT" +
					" DISTINCT ci.`code`," +
					" ci.idcard," +
					" ci.`name`," +
					" ci.ssc," +
					" ci.barcode" +
					" FROM" +
					" wlyy_child_family_immune fi" +
					" LEFT JOIN wlyy_child_info ci ON fi.child_code = ci.`code`" +
					" WHERE" +
					" fi.del = 0";
			List<Map<String,Object>> list = jdbcTemplate.queryForList(sql);
			for (Map<String,Object> map : list){
				String barcode = String.valueOf(map.get("barcode"));
				System.out.println("===============barcode=============="+barcode);
				String deptStr = immuneService.findDept(barcode);
				if (StringUtils.isNotBlank(deptStr)){
					JSONObject jsonObject = new JSONObject(deptStr);
					if (jsonObject.getInt("status")==200) {
						JSONObject json = new JSONObject(jsonObject.getString("data"));
						JSONArray jsonArray = json.getJSONArray("body");
						for (int i = 0;i<jsonArray.length();i++){
							String deptNum  = jsonArray.getJSONObject(i).getString("deptNum");
							String vaccinStr = immuneService.findMyVaccin(barcode,deptNum);
							JSONObject vaccinJson = new JSONObject(vaccinStr);
							if (vaccinJson.getInt("status")==200) {
								JSONObject vaccinJson2 = new JSONObject(vaccinJson.getString("data"));
								JSONArray vaccinJsonJSONArray = vaccinJson2.getJSONArray("body");
								List<ChildImmuneVaccin> vaccinList = childImmuneVaccinDao.findByBarcode(barcode);
								//原来有的则不用新增,原来有的但是在返回回来的数据没有的话删除数据
								for (ChildImmuneVaccin childImmuneVaccin : vaccinList){
									int count = 0;
									for (int j=0;j<vaccinJsonJSONArray.length();j++){
										String ymbm = vaccinJsonJSONArray.getJSONObject(j).getString("ymBm");
										String jzzc = vaccinJsonJSONArray.getJSONObject(j).getString("jzZc");
										if (childImmuneVaccin.getYmbm().equals(ymbm) && childImmuneVaccin.getJzzc().equals(jzzc)){
											count++;
										}
									}
									//原来有的疫苗要判断是否有超过预约时间的7天,并且看提醒是否超过7天,超过7天可以重新提醒
									if (count>0 && childImmuneVaccin.getIsOut()==1){
										if (DateUtil.getPreDays(childImmuneVaccin.getJzrq(),7).before(new Date())){
											//过了预约时间7天,更新为isOut=0,则不能预约了
											childImmuneVaccinDao.updateIsOutByCode(childImmuneVaccin.getCode());
										}else {
											//判断是否过了7天提醒时间
											if (childImmuneVaccin.getAlert_tag()==1 && DateUtil.getPreDays(childImmuneVaccin.getAlert_time(),7).before(new Date())){
												childImmuneVaccinDao.updateAlertTagByCode(childImmuneVaccin.getCode());
											}
										}
									}
									if (count==0){
										result+= childImmuneVaccinDao.updateDelByCode(childImmuneVaccin.getCode());
									}
								}
								//如果本地没有就是新增的
								List<ChildImmuneVaccin> vaccins = new ArrayList<>();
								for (int j=0;j<vaccinJsonJSONArray.length();j++){
									String ymbm = vaccinJsonJSONArray.getJSONObject(j).getString("ymBm");
									String jzzc = vaccinJsonJSONArray.getJSONObject(j).getString("jzZc");
									int count = 0;
									for (ChildImmuneVaccin childImmuneVaccin : vaccinList){
										if (childImmuneVaccin.getYmbm().equals(ymbm) && childImmuneVaccin.getJzzc().equals(jzzc)){
											count++;
										}
									}
									if (count==0){
										ChildImmuneVaccin childImmuneVaccin = new ChildImmuneVaccin();
										childImmuneVaccin.setCode(getUUID());
										childImmuneVaccin.setName(String.valueOf(map.get("name")));
										childImmuneVaccin.setIdcard(String.valueOf(map.get("idcard")));
										childImmuneVaccin.setSsc(String.valueOf(map.get("ssc")));
										childImmuneVaccin.setBarcode(barcode);
										childImmuneVaccin.setYmkc(vaccinJsonJSONArray.getJSONObject(j).getString("ymkc"));
										childImmuneVaccin.setYmmc(vaccinJsonJSONArray.getJSONObject(j).getString("ymmc"));
										childImmuneVaccin.setYmkcsm(vaccinJsonJSONArray.getJSONObject(j).getString("ymkcsm"));
										childImmuneVaccin.setYmbm(ymbm);
										childImmuneVaccin.setJzzc(jzzc);
										childImmuneVaccin.setJzrq(DateUtil.strToDate(vaccinJsonJSONArray.getJSONObject(j).getString("jzRq"),DateUtil.YYYY_MM_DD));
										childImmuneVaccin.setAlert_tag(0);
										childImmuneVaccin.setDel(0);
										childImmuneVaccin.setCreate_time(new Date());
										if (DateUtil.getPreDays(DateUtil.strToDate(vaccinJsonJSONArray.getJSONObject(j).getString("jzRq")),7).before(new Date())){
											//过了预约时间7天,更新为isOut=0,则不能预约了
											childImmuneVaccin.setIsOut(0);
										}else {
											childImmuneVaccin.setIsOut(1);
										}
										vaccins.add(childImmuneVaccin);
										result++;
									}
								}
								childImmuneVaccinDao.save(vaccins);
							/*for (int j=0;j<vaccinJsonJSONArray.length();j++){
								String ymbm = vaccinJsonJSONArray.getJSONObject(j).getString("ymBm");
								String jzzc = vaccinJsonJSONArray.getJSONObject(j).getString("jzZc");
								if (childImmuneVaccinDao.findByBarcodeAndYmbmAndJzzc(barcode,ymbm,jzzc)==null){
									ChildImmuneVaccin childImmuneVaccin = new ChildImmuneVaccin();
									childImmuneVaccin.setCode(getUUID());
									childImmuneVaccin.setName(String.valueOf(map.get("name")));
									childImmuneVaccin.setIdcard(String.valueOf(map.get("idcard")));
									childImmuneVaccin.setSsc(String.valueOf(map.get("ssc")));
									childImmuneVaccin.setBarcode(barcode);
									childImmuneVaccin.setYmkc(vaccinJsonJSONArray.getJSONObject(j).getString("ymkc"));
									childImmuneVaccin.setYmmc(vaccinJsonJSONArray.getJSONObject(j).getString("ymmc"));
									childImmuneVaccin.setYmkcsm(vaccinJsonJSONArray.getJSONObject(j).getString("ymkcsm"));
									childImmuneVaccin.setYmbm(ymbm);
									childImmuneVaccin.setJzzc(jzzc);
									childImmuneVaccin.setAlert_tag(0);
									childImmuneVaccin.setCreate_time(new Date());
								}
							}*/
							}
						}
					}
				}
			}
		}catch (Exception e){
			e.printStackTrace();
		}
		return result;
	}
}

+ 2 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/specialist/SpecialistScreenResultService.java

@ -82,7 +82,7 @@ public class SpecialistScreenResultService extends BaseService {
        param.put("pageSize", size);
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/getScreenResult", param);
        JSONObject rs = new JSONObject(response.getContent());
        if ("succes".equals(rs.getString("message"))) {
        if ("success".equals(rs.getString("message"))) {
            return  rs.getJSONArray("detailModelList");
        }
        return null;
@ -95,7 +95,7 @@ public class SpecialistScreenResultService extends BaseService {
        param.put("doctor", doctor);
        HttpResponse response = HttpUtils.doGet(specialistUrl + "svr-specialist/getScreenCount", param);
        JSONObject rs = new JSONObject(response.getContent());
        if ("succes".equals(rs.getString("message"))) {
        if ("success".equals(rs.getString("message"))) {
            jsonObject =  rs.getJSONObject("obj");
            return  jsonObject;
        }

+ 18 - 3
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/service/third/guahao/ImmuneService.java

@ -767,13 +767,28 @@ public class ImmuneService {
	 * @return
	 * @throws Exception
	 */
	public String findWzymBymykh(String barcode) throws Exception{
		String url = jwUrl + "/third/jm/imm/findWzymBymykh";
	public String findYzymBymykh(String barcode) throws Exception{
		String url = jwUrl + "/third/jm/imm/findYzymBymykh";
		List<NameValuePair> params = new ArrayList<>();
		params.add(new BasicNameValuePair("barCode", barcode));
		params.add(new BasicNameValuePair("etmykh", barcode));
		String response = httpClientUtil.post(url, params, "UTF-8");
		return response;
	}
	public String findMyVaccin(String barcode,String deptNum) throws Exception{
		String url = jwUrl + "/third/jm/imm/findMyVaccin";
		List<NameValuePair> params = new ArrayList<>();
		params.add(new BasicNameValuePair("deptNum", deptNum));
		params.add(new BasicNameValuePair("etmykh", barcode));
		String response = httpClientUtil.post(url, params, "UTF-8");
		return response;
	}
	public String findDept(String barcode) throws Exception{
		String url = jwUrl + "/third/jm/imm/findDept";
		List<NameValuePair> params = new ArrayList<>();
		params.add(new BasicNameValuePair("etmykh", barcode));
		String response = httpClientUtil.post(url, params, "UTF-8");
		return response;
	}
}

+ 24 - 4
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/doctor/imm/DoctorImmController.java

@ -162,7 +162,7 @@ public class DoctorImmController extends BaseController {
		}
	}
	@RequestMapping(value = "/imm/findWzymBymykh", method = RequestMethod.GET)
	@RequestMapping(value = "/imm/findYzymBymykh", method = RequestMethod.GET)
	@ResponseBody
	@ObserverRequired
	@ApiOperation("计免:获取计划免疫接种记录")
@ -170,12 +170,32 @@ public class DoctorImmController extends BaseController {
								  @RequestParam(value = "barCode", required = true) String barCode){
		try{
			String re = immuneService.findWzymBymykh(barCode);
			return write(200, "查询成功","data",re);
			String re = immuneService.findYzymBymykh(barCode);
			JSONObject jsonObject = new JSONObject(re);
			if (jsonObject.getInt("status")==200){
				JSONObject json = new JSONObject(jsonObject.getString("data"));
				return write(200, "查询成功","data",json.getJSONArray("body"));
			}else {
				return error(-1,jsonObject.getString("error")+"--"+jsonObject.getString("message") );
			}
		}catch (Exception e){
			error(e);
			return error(-1, e.getMessage());
		}
	}
	@RequestMapping(value = "/imm/getChildImmuneVaccinEveryDay", method = RequestMethod.GET)
	@ResponseBody
	@ObserverRequired
	@ApiOperation("每天获取可预约疫苗test")
	public String getChildImmuneVaccinEveryDay (){
		try{
			int res = childFamilyImmuneService.getChildImmuneVaccinEveryDay();
			return write(200,"获取成功!","data",res);
		}catch (Exception e){
			error(e);
			return error(-1, e.getMessage());
		}
	}
	
}

+ 2 - 0
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/controller/GcTokenController.java

@ -6,6 +6,7 @@ import com.yihu.wlyy.entity.gateway.GcToken;
import com.yihu.wlyy.repository.gateway.GcHttpLogDao;
import com.yihu.wlyy.service.gateway.GcClientDetailsService;
import com.yihu.wlyy.service.gateway.GcTokenService;
import com.yihu.wlyy.util.DateUtil;
import com.yihu.wlyy.util.NetworkUtil;
import com.yihu.wlyy.web.third.gateway.vo.GcClientDetailsModel;
import com.yihu.wlyy.web.third.gateway.vo.GcTokenModel;
@ -78,6 +79,7 @@ public class GcTokenController {
            }
            GcTokenModel gcTokenModel = new GcTokenModel();
            BeanUtils.copyProperties(gcToken, gcTokenModel);
            gcTokenModel.setOutTime(gcToken.getOutTime().getTime());
            return new ResultOneModel(gcTokenModel);
        } catch (Exception e) {
            saveHttpLog(ip, new JSONObject(request.getParameterMap()).toString(), "", "", request.getRequestURI(), 0, BaseResultModel.statusEm.login_system_error.getMessage());

+ 10 - 2
patient-co/patient-co-wlyy/src/main/java/com/yihu/wlyy/web/third/gateway/vo/GcTokenModel.java

@ -15,7 +15,7 @@ public class GcTokenModel {
    @ApiModelProperty(value = "创建时间", required = false, access = "response")
    private Date createTime;
    @ApiModelProperty(value = "过期时间", required = false, access = "response")
    private Date outTime;
    private Long outTime;
    public String getAccesstoken() {
        return accesstoken;
@ -33,11 +33,19 @@ public class GcTokenModel {
        this.createTime = createTime;
    }
    public Date getOutTime() {
    /*public Date getOutTime() {
        return outTime;
    }
    public void setOutTime(Date outTime) {
        this.outTime = outTime;
    }*/
    public Long getOutTime() {
        return outTime;
    }
    public void setOutTime(Long outTime) {
        this.outTime = outTime;
    }
}

+ 51 - 75
patient-co/patient-co-wlyy/src/main/resources/wechat/weixin_menu_haicang.txt

@ -2,95 +2,71 @@
"button":[
   {
	  "name":"家庭医生",
	  "sub_button":[
	      {
            "type":"view",
            "name":"健康评估",
            "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjkpg%2fhtml%2fjkpg.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
          },
		  {
			"type":"view",
			"name":"签约管理",
			"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fqygl%2fhtml%2fsigning_management.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		  },
		  {
			"type":"view",
			"name":"医生咨询",
			"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fyszx%2fhtml%2fdoctor-consultation.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		  },
		  {
			"type":"view",
			"name":"医生指导",
			"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fyszd%2fhtml%2fdoctor-guidance.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		  },
		  {
            "type":"view",
            "name":"健教文库",
            "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjkjy%2fhtml%2farticle_list.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
          }
	  ]
	  "type":"view",
      "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fhome%2fhtml%2findex.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
   },
   {
	  "name":"健康管理",
	  "name":"快捷服务",
	  "sub_button":[
		 {
			  "type":"view",
			  "name":"预约挂号",
			  "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fwdyy%2fhtml%2fappointment-register.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		 },
         		"type":"view",
         		"name":"预约挂号",
         		"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fwdyy%2fhtml%2fappointment-register.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
		 {
            	"type":"view",
         	    "name":"医生咨询",
         		"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fyszx%2fhtml%2fdoctor-consultation.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
		 {
               "type":"view",
               "name":"健康记录",
               "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjkjl%2fhtml%2fhealth-record.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                "type":"view",
               	"name":"健康评估",
               	"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjkpg%2fhtml%2fjkpg.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
         {
                "type":"view",
                "name":"康复管理",
                "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fkfgl%2fhtml%2frecover_manage.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
		{
			"type":"click",
			"name":"健康档案",
			"key":"jiankangdangan"
		},
         {
            "type":"view",
            "name":"慢病管理",
            "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjbsq%2fhtml%2fslow-disease-manage.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
                  },
        {
            "type":"click",
            "name":"妇幼保健",
            "key":"fuyoubaojian"
        }
                "type":"view",
                "name":"慢病管理",
                "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjbsq%2fhtml%2fslow-disease-manage.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         }
	  ]
   },
   {
	  "name":"我的",
	  "sub_button":[
		{
           "type":"view",
           "name":"电子健康卡",
           "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fgrzx%2fhtml%2fmy-health-card.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
        },
		{
		   "type":"view",
		   "name":"我的资料",
		   "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fgrzx%2fhtml%2fmy-detail.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		},
        {
           "type":"view",
           "name":"我的家庭",
           "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjtgx%2fhtml%2ffamily.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
        },
		{
		   "type":"view",
		   "name":"我的设备",
		   "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fwdsb%2fhtml%2fmy-equipments.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		},
		{
		   "type":"view",
		   "name":"健康银行",
		   "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjkjf%2fhtml%2findex.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
		}
		 {
                "type":"view",
                "name":"电子健康卡",
                "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fgrzx%2fhtml%2fmy-health-card.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
         {
        		"type":"view",
        		"name":"我的资料",
        		"url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fgrzx%2fhtml%2fmy-detail.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
		 {
        	    "type":"view",
        	    "name":"健康银行",
        	    "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fjkjf%2fhtml%2funopened.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         },
         {
                "type":"click",
                "name":"用户指南",
                "key":"caozuoshuoming"
         },
         {
               	"type":"view",
                "name":"意见反馈",
                "url":"https://open.weixin.qq.com/connect/oauth2/authorize?appid=appId&redirect_uri=server_url%2fwx%2fhtml%2fwdyy%2fhtml%2fmy-appointment.html&response_type=code&scope=snsapi_base&state=STATE#wechat_redirect"
         }
	 ]
  }],
  }
],
    "matchrule":{
      "tag_id":"104"
      }

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

@ -66,5 +66,8 @@
         }
	 ]
  }
]
],
     "matchrule":{
       "tag_id":"101"
       }
}