| | |
| | | import com.product.admin.config.SystemCode; |
| | | import com.product.core.controller.support.AbstractBaseController; |
| | | import com.product.core.entity.FieldSetEntity; |
| | | import com.product.core.exception.BaseException; |
| | | import com.product.core.spring.context.SpringMVCContextHolder; |
| | | import com.product.module.sys.version.ApiVersion; |
| | | import com.product.saas.config.SaasCode; |
| | | import com.product.saas.config.SaasConst; |
| | | import com.product.saas.service.SaasClientService; |
| | | import com.product.saas.service.idel.ISaasClientService; |
| | | import com.product.util.BaseUtil; |
| | | |
| | | /** |
| | |
| | | return error(SystemCode.SYSTEM_CPAGES_NOT_NULL.getValue(), SystemCode.SYSTEM_CPAGES_NOT_NULL.getText()); |
| | | } |
| | | return OK_List(saasClientService.listClient(fse)); |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | | return error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return error(SaasCode.TENANT_INFO_GET_LIST_FAIL.getValue(), SaasCode.TENANT_INFO_GET_LIST_FAIL.getText() + e.getMessage()); |
| | | return error(SaasCode.CLIENT_INFO_GET_LIST_FAIL.getValue(), SaasCode.CLIENT_INFO_GET_LIST_FAIL.getText() + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 租户列表 |
| | | * 租户详情 |
| | | * @param request |
| | | * @return |
| | | */ |
| | |
| | | try { |
| | | FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, SaasConst.PRODUCT_SYS_CLIENTS); |
| | | if(BaseUtil.strIsNull(fse.getUUID())) { |
| | | return error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText()); |
| | | fse.setValue("uuid", SpringMVCContextHolder.getCurrentUser().getClient_uuid()); |
| | | // return error(SystemCode.SYSTEM_FORM_COUNT.getValue(), SystemCode.SYSTEM_FORM_COUNT.getText()); |
| | | } |
| | | return OK_List(saasClientService.findClient(fse.getUUID())); |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | | return error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return error(SaasCode.TENANT_INFO_GET_LIST_FAIL.getValue(), SaasCode.TENANT_INFO_GET_LIST_FAIL.getText() + e.getMessage()); |
| | | return error(SaasCode.CLIENT_INFO_GET_DETAIL_FAIL.getValue(), SaasCode.CLIENT_INFO_GET_DETAIL_FAIL.getText() + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 租户信息变更列表 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping("/list-client-change/{version}") |
| | | @ApiVersion(1) |
| | | public String listClientChange(HttpServletRequest request) { |
| | | try { |
| | | FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, SaasConst.PRODUCT_SYS_TENANT_CHANGE); |
| | | |
| | | return OK_List(saasClientService.listClientChange(fse)); |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | | return error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return error(SaasCode.CLIENT_CHANGE_GET_LIST_FAIL.getValue(), SaasCode.CLIENT_CHANGE_GET_LIST_FAIL.getText() + e.getMessage()); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 租户信息变更进程 |
| | | * @param request |
| | | * @return |
| | | */ |
| | | @RequestMapping("/change-process/{version}") |
| | | @ApiVersion(1) |
| | | public String clientChangeProcess(HttpServletRequest request) { |
| | | try { |
| | | FieldSetEntity fse = BaseUtil.getFieldSetEntity(request, SaasConst.PRODUCT_SYS_TENANT_CHANGE); |
| | | ISaasClientService service = (ISaasClientService)getProxyInstance(saasClientService); |
| | | boolean succ = service.clientChangeProcess(fse); |
| | | if (succ) { |
| | | return OK(); |
| | | } |
| | | return error(SaasCode.CLIENT_CHANGE_CONFIRM_SAVEFAIL.getValue(), SaasCode.CLIENT_CHANGE_CONFIRM_SAVEFAIL.getText()); |
| | | } catch (BaseException e) { |
| | | e.printStackTrace(); |
| | | return error(e); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | return error(SaasCode.CLIENT_CHANGE_CONFIRM_FAIL.getValue(), SaasCode.CLIENT_CHANGE_CONFIRM_FAIL.getText() + e.getMessage()); |
| | | } |
| | | } |
| | | } |