| | |
| | | user.setClinicId(clinic.getId()); |
| | | userMapper.insert(user); |
| | | |
| | | // Integer provinceCode = parseRegionCode(clinic.getProvinceCode(), "省编码"); |
| | | // Integer cityCode = parseRegionCode(clinic.getCityCode(), "市编码"); |
| | | // Integer areaCode = parseRegionCode(clinic.getDistrictCode(), "区县编码"); |
| | | // log.info("调用微赞创建门店,入参 title={}, provinceCode={}, cityCode={}, areaCode={}, address={}, telephone={}", |
| | | // clinic.getName(), provinceCode, cityCode, areaCode, clinic.getAddress(), clinic.getContactPhone()); |
| | | // try { |
| | | // JsonNode vzanResponse = vzanHttpUtil.createStore(clinic.getName(), provinceCode, cityCode, areaCode, clinic.getAddress(), clinic.getContactPhone()); |
| | | // log.info("微赞创建门店成功,出参={}", vzanResponse); |
| | | // } catch (RuntimeException ex) { |
| | | // log.error("微赞创建门店失败,本地事务将回滚,入参 title={}, provinceCode={}, cityCode={}, areaCode={}, address={}, telephone={}", |
| | | // clinic.getName(), provinceCode, cityCode, areaCode, clinic.getAddress(), clinic.getContactPhone(), ex); |
| | | // throw new IllegalStateException("微赞创建门店失败", ex); |
| | | // } |
| | | Integer provinceCode = parseRegionCode(clinic.getProvinceCode(), "省编码"); |
| | | Integer cityCode = parseRegionCode(clinic.getCityCode(), "市编码"); |
| | | Integer areaCode = parseRegionCode(clinic.getDistrictCode(), "区县编码"); |
| | | log.info("调用微赞创建门店,入参 title={}, provinceCode={}, cityCode={}, areaCode={}, address={}, telephone={}" |
| | | , clinic.getName(), provinceCode, cityCode, areaCode, clinic.getAddress(), clinic.getContactPhone()); |
| | | try { |
| | | JsonNode vzanResponse = vzanHttpUtil.createStore(clinic.getName(), provinceCode, cityCode, areaCode, clinic.getAddress(), clinic.getContactPhone()); |
| | | log.info("微赞创建门店成功,出参={}", vzanResponse); |
| | | // 注册阶段暂未绑定区域代理,parentMobile 传空,由微赞按一级代理处理。 |
| | | log.info("调用微赞创建一级代理,入参 agentMobile={}, agentName={}, levelCode=1, storeName={}, parentMobile=null", |
| | | clinic.getContactPhone(), clinic.getName(), clinic.getName()); |
| | | JsonNode vzanAgentResponse = vzanHttpUtil.createAgent( |
| | | clinic.getContactPhone(), clinic.getName(), 1, "18510939636", clinic.getName()); |
| | | log.info("微赞创建一级代理成功,出参={}", vzanAgentResponse); |
| | | } catch (RuntimeException ex) { |
| | | log.error("微赞创建门店或一级代理失败,本地事务将回滚,clinicId={}", clinic.getId(), ex); |
| | | throw new IllegalStateException("微赞门店或一级代理创建失败", ex); |
| | | } |
| | | |
| | | clearDraft(request.getRegisterTicket()); |
| | | return createLoginResponse(user); |