| | |
| | | import com.ltkj.common.enums.BusinessType; |
| | | import com.ltkj.common.enums.DataSourceType; |
| | | import com.ltkj.common.utils.SecurityUtils; |
| | | import com.ltkj.db.DataSourceContextHolder; |
| | | import com.ltkj.framework.config.MatchUtils; |
| | | import com.ltkj.framework.datasource.DynamicDataSourceContextHolder; |
| | | import com.ltkj.hosp.domain.HisApiConfig; |
| | |
| | | tjCustomer1.setTjType(tjReservation.getTjType()); |
| | | tjCustomer1.setCusName(tjReservation.getName()); |
| | | tjCustomer1.setCusSex(Long.valueOf(tjReservation.getSex())); |
| | | tjCustomer1.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjReservation.getIdCard()), "yyyy-MM-dd")); |
| | | try { |
| | | tjCustomer1.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjReservation.getIdCard()), "yyyy-MM-dd")); |
| | | } catch (Exception e) { |
| | | return AjaxResult.error("身份证号不正确"); |
| | | } |
| | | tjCustomer1.setCusPhone(tjReservation.getPhoe()); |
| | | tjCustomer1.setCusEmail(tjReservation.getEmail()); |
| | | tjCustomer1.setCusAddr(tjReservation.getAddress()); |
| | |
| | | tjCustomer1.setGroupingId(tjReservation.getGroupingId()); |
| | | |
| | | // if(null !=tjReservation.getCompanyId())tjCustomer1.setDictCompId(Long.valueOf(tjReservation.getCompanyId())); |
| | | // if(null !=tjReservation.getCompany())tjCustomer1.setCompName(tjReservation.getCompany()); |
| | | if(null !=tjReservation.getCompany())tjCustomer1.setCompName(tjReservation.getCompany()); |
| | | |
| | | // tjCustomerService.updateById(tjCustomer1); |
| | | |
| | |
| | | tjCustomer.setCusIdcard(tjReservation.getIdCard()); |
| | | tjCustomer.setCusName(tjReservation.getName()); |
| | | tjCustomer.setCusSex(Long.valueOf(tjReservation.getSex())); |
| | | tjCustomer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjReservation.getIdCard()), "yyyy-MM-dd")); |
| | | try { |
| | | tjCustomer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjReservation.getIdCard()), "yyyy-MM-dd")); |
| | | } catch (Exception e) { |
| | | return AjaxResult.error("身份证号不正确"); |
| | | } |
| | | tjCustomer.setCusPhone(tjReservation.getPhoe()); |
| | | tjCustomer.setCusEmail(tjReservation.getEmail()); |
| | | tjCustomer.setCusAddr(tjReservation.getAddress()); |
| | |
| | | tjCustomer.setCusPassword(substring); |
| | | tjCustomer.setTjType(tjReservation.getTjType()); |
| | | tjCustomer.setPym(PinyinUtil.getFirstLetter(tjReservation.getName(),"")); |
| | | // if(null !=tjReservation.getCompanyId())tjCustomer.setDictCompId(Long.valueOf(tjReservation.getCompanyId())); |
| | | // if(null !=tjReservation.getCompany())tjCustomer.setCompName(tjReservation.getCompany()); |
| | | if(null !=tjReservation.getCompanyId())tjCustomer.setCompId(tjReservation.getCompanyId()); |
| | | if(null !=tjReservation.getCompany())tjCustomer.setCompName(tjReservation.getCompany()); |
| | | |
| | | if (null != key && key.equals("Y")) { |
| | | AjaxResult result = controller.Outpincreateapply(tjCustomer); |
| | |
| | | String substring = cusIdcard.substring(cusIdcard.length() - 6); |
| | | substring = DigestUtils.md5DigestAsHex(substring.getBytes()); |
| | | tjCustomer.setCusPassword(substring); |
| | | if(cusIdcard.length()==18)tjCustomer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjCustomer.getCusIdcard()), "yyyy-MM-dd")); |
| | | if(cusIdcard.length()==18) { |
| | | try { |
| | | tjCustomer.setCusBrithday(DateUtil.parse(MatchUtils.getBirthDayByIdCard(tjCustomer.getCusIdcard()), "yyyy-MM-dd")); |
| | | } catch (Exception e) { |
| | | return AjaxResult.error("身份证号不正确"); |
| | | } |
| | | } |
| | | tjCustomer.setCusNumber(0L); |
| | | tjCustomer.setPym(PinyinUtil.getFirstLetter(tjCustomer.getCusName(),"")); |
| | | String config = sysConfigService.selectConfigByKey("sfkqdyhis"); |
| | | logger.info("config ->{}",config); |
| | | String dataSourceType = DataSourceContextHolder.getDataSourceKey(); |
| | | logger.info("登记当前数据源 ->{}",dataSourceType); |
| | | if (null != config && config.equals("Y")) { |
| | | AjaxResult tjCustomer1 = suijieHisXinXi(tjCustomer, date); |
| | | if (tjCustomer1 != null) return tjCustomer1; |
| | | } else { |
| | | String s = sysConfigService.selectConfigByKey("is_request_common_his_api"); |
| | | logger.info("s ->{}",s); |
| | | if (null != s && s.equals("Y")){ |
| | | TjCustomer requestCommonHisApi = isRequestCommonHisApi(tjCustomer); |
| | | if (null !=requestCommonHisApi){ |