|
@ -0,0 +1,50 @@
|
|
|
|
package com.yihu.wlyy.service.third.jw;
|
|
|
|
|
|
|
|
import com.yihu.wlyy.repository.patient.PatientDao;
|
|
|
|
import com.yihu.wlyy.repository.patient.SignFamilyDao;
|
|
|
|
import com.yihu.wlyy.util.HttpClientUtil;
|
|
|
|
import org.apache.http.NameValuePair;
|
|
|
|
import org.apache.http.message.BasicNameValuePair;
|
|
|
|
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.util.ArrayList;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 基位签约信息接口
|
|
|
|
* Created by humingfen on 2018/5/22.
|
|
|
|
*/
|
|
|
|
@Service
|
|
|
|
public class JwPatientMedicareNumberService {
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(JwPatientMedicareNumberService.class);
|
|
|
|
//基卫服务地址
|
|
|
|
@Value("${sign.zysoft}")
|
|
|
|
private String jwUrl;
|
|
|
|
@Autowired
|
|
|
|
private PatientDao patientDao;
|
|
|
|
@Autowired
|
|
|
|
private SignFamilyDao signFamilyDao;
|
|
|
|
@Autowired
|
|
|
|
private HttpClientUtil httpClientUtil;
|
|
|
|
|
|
|
|
/**
|
|
|
|
* 查找所有有效签约居民的签约信息,并同步到本地数据库
|
|
|
|
*/
|
|
|
|
public void getEffectiveSignFamily () throws Exception {
|
|
|
|
List<String> idcards = signFamilyDao.findIdcardByStatus();
|
|
|
|
List<String> newIdcards = patientDao.findIdcardByMedicareNumber(idcards);
|
|
|
|
String url = jwUrl + "/third/zysoftservice/getSickCurrnetFamilySignInfo";
|
|
|
|
//医疗保险号的居民集合
|
|
|
|
HashMap<String, String> idcard_medicare_number_map = new HashMap<>();
|
|
|
|
for (String idcard : newIdcards) {
|
|
|
|
List<NameValuePair> params = new ArrayList<>();
|
|
|
|
params.add(new BasicNameValuePair("idcard", idcard));
|
|
|
|
httpClientUtil.post(url, params, "UTF-8");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|