|
@ -102,7 +102,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
|
|
|
/**
|
|
|
* 初始化杭州老人,只保存有身份证且有手机号的数据
|
|
|
*/
|
|
|
public void initJczdPerson(){
|
|
|
public void initJczdPerson(Integer size){
|
|
|
Map<String,String> lableCodeMap = new HashMap<>();
|
|
|
Map<String,String> lableCodeNameMap = new HashMap<>();
|
|
|
lableCodeMap.put("1","1");//低保
|
|
@ -116,51 +116,27 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
|
|
|
lableCodeNameMap.put("3","独居");//独居
|
|
|
lableCodeNameMap.put("4","孤寡");//孤寡
|
|
|
lableCodeNameMap.put("7","特困");//特困
|
|
|
String sqlPatient = "select idcard from base_patient where idcard is not null";
|
|
|
List<String> list1 = jdbcTemplate.queryForList(sqlPatient,String.class);
|
|
|
|
|
|
String sqlCount = "SELECT COUNT(*) c from hz.jczd_person WHERE data_flag =1 and dead_date is null ";
|
|
|
Integer total = jdbcTemplate.queryForObject(sqlCount,Integer.class);
|
|
|
int start = 0;
|
|
|
int size = 100;
|
|
|
int num = total/size +1;
|
|
|
String hzPhoto = "group1/M00/00/04/ChIrKGIxsyeACOH4AAAj7meuq5Y176.png";
|
|
|
|
|
|
String sql = "SELECT * from hz.jczd_person WHERE id>? and data_flag =1 and certificate_number is not null and dead_date is null" +
|
|
|
" and (person_phone is not null or telephone is not null) order by id limit ?";
|
|
|
|
|
|
String sql = "select * from base_patient where openid = 'jczd' limit ?";
|
|
|
int j = 0;
|
|
|
for (int i=0;i<num;i++){
|
|
|
List<JczdPersonVo> list = jdbcTemplate.query(sql,new Object[]{start,size},new BeanPropertyRowMapper<>(JczdPersonVo.class));
|
|
|
// for (int i=0;i<num;i++){
|
|
|
List<BasePatientDO> list = jdbcTemplate.query(sql,new Object[]{size},new BeanPropertyRowMapper<>(BasePatientDO.class));
|
|
|
if (list.size()>0){
|
|
|
j = 0;
|
|
|
for (JczdPersonVo person:list){
|
|
|
String idcard = person.getCertificateNumber();
|
|
|
if(list1.contains(idcard)){
|
|
|
continue;
|
|
|
}
|
|
|
BasePatientDO patient = new BasePatientDO();
|
|
|
for (BasePatientDO patient:list){
|
|
|
String idcard = patient.getIdcard();
|
|
|
String persionTags = patient.getSsc();
|
|
|
String salt = UUID.randomUUID().toString().substring(0,5);
|
|
|
patient.setPassword(MD5.md5Hex(idcard + "{" + salt + "}"));
|
|
|
patient.setSalt(salt);
|
|
|
String mobile = StringUtil.isEmpty(person.getPersonPhone())?person.getTelephone():person.getPersonPhone();
|
|
|
patient.setMobile(mobile);
|
|
|
patient.setDel("1");
|
|
|
patient.setEnabled(1);
|
|
|
patient.setLocked(0);
|
|
|
patient.setSignStatus(0);
|
|
|
patient.setDeviceFlag(0);
|
|
|
patient.setCreateTime(new Date());
|
|
|
patient.setUpdateTime(new Date());
|
|
|
patient.setName(person.getPersonName());
|
|
|
patient.setIdcard(idcard);
|
|
|
patient.setSex(person.getSex());
|
|
|
patient.setBirthday(person.getBirthday());
|
|
|
patient.setArchiveType(1);
|
|
|
patient.setArchiveStatus(1);
|
|
|
patient.setPhoto(hzPhoto);
|
|
|
String address = StringUtil.isEmpty(person.getLiveAddress())?person.getRegistryAddress():person.getLiveAddress();
|
|
|
patient.setOpenid(null);
|
|
|
patient.setSsc(null);
|
|
|
String address = patient.getAddress();
|
|
|
patient.setAddress(address);
|
|
|
if(StringUtils.isNotBlank(address)){
|
|
|
if(!address.contains("杭州市")){
|
|
|
address = "杭州市"+address;
|
|
|
}
|
|
|
Map<String,String> map = LatitudeUtils.getGeocoderLatitude(address);
|
|
|
if(map!=null){
|
|
|
String latlon = map.get("lat")+","+map.get("lng");
|
|
@ -170,16 +146,7 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
|
|
|
}
|
|
|
patientDao.save(patient);
|
|
|
String pateintId = patient.getId();
|
|
|
WlyyPatientFamilyMemberDO wlyyPatientFamilyMemberDO = new WlyyPatientFamilyMemberDO();
|
|
|
wlyyPatientFamilyMemberDO.setIsDel(1);
|
|
|
wlyyPatientFamilyMemberDO.setPatient(pateintId);
|
|
|
wlyyPatientFamilyMemberDO.setFamilyMember(patient.getId());
|
|
|
wlyyPatientFamilyMemberDO.setFamilyRelation("7");
|
|
|
wlyyPatientFamilyMemberDO.setFamilyRelationName("本人");
|
|
|
wlyyPatientFamilyMemberDO.setCardNo(idcard);
|
|
|
familyMemberDao.save(wlyyPatientFamilyMemberDO);
|
|
|
|
|
|
String persionTags = person.getPersonTags();
|
|
|
|
|
|
if(StringUtils.isNotBlank(persionTags)){
|
|
|
String pertags[] = persionTags.split(",");
|
|
|
for (String tag:pertags){
|
|
@ -192,21 +159,23 @@ public class CarePatientService extends BaseJpaService<BasePatientDO, BasePatien
|
|
|
patientLabelDO.setLabelCode(label);
|
|
|
patientLabelDO.setLabelName(lableCodeNameMap.get(label));
|
|
|
patientLabelDao.save(patientLabelDO);
|
|
|
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
logger.info("idcard=="+patient.getIdcard());
|
|
|
j++;
|
|
|
}
|
|
|
|
|
|
logger.info("新增人数="+j);
|
|
|
|
|
|
}
|
|
|
// }
|
|
|
|
|
|
|
|
|
}
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
* 获取能力状况
|
|
|
* @param patient
|