Merge branch 'master' of https://github.com/java110/MicroCommunity
| New file |
| | |
| | | package com.java110.api.listener.app; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.common.constant.*; |
| | | import com.java110.common.exception.ListenerExecuteException; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.common.util.BeanConvertUtil; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.core.smo.app.IAppInnerServiceSMO; |
| | | import com.java110.dto.app.AppDto; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import com.java110.core.annotation.Java110Listener; |
| | | /** |
| | | * 保存小区侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("deleteAppListener") |
| | | public class DeleteAppListener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private IAppInnerServiceSMO appInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "appId", "应用Id不能为空"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | AppDto appDto = BeanConvertUtil.covertBean(reqJson, AppDto.class); |
| | | |
| | | appDto.setStatusCd(StatusConstant.STATUS_CD_INVALID); |
| | | |
| | | int count = appInnerServiceSMOImpl.deleteApp(appDto); |
| | | |
| | | |
| | | |
| | | if (count < 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "删除数据失败"); |
| | | } |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("", HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeAppConstant.DELETE_APP; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | public IAppInnerServiceSMO getAppInnerServiceSMOImpl() { |
| | | return appInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setAppInnerServiceSMOImpl(IAppInnerServiceSMO appInnerServiceSMOImpl) { |
| | | this.appInnerServiceSMOImpl = appInnerServiceSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.app; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.common.constant.ServiceCodeAppConstant; |
| | | import com.java110.common.constant.ServiceCodeConstant; |
| | | import com.java110.common.util.BeanConvertUtil; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.app.IAppInnerServiceSMO; |
| | | import com.java110.dto.app.AppDto; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.vo.api.app.ApiAppDataVo; |
| | | import com.java110.vo.api.app.ApiAppVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import com.java110.common.constant.CommonConstant; |
| | | import com.java110.common.constant.BusinessTypeConstant; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 查询小区侦听类 |
| | | */ |
| | | @Java110Listener("listAppsListener") |
| | | public class ListAppsListener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private IAppInnerServiceSMO appInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeAppConstant.LIST_APPS; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.GET; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | public IAppInnerServiceSMO getAppInnerServiceSMOImpl() { |
| | | return appInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setAppInnerServiceSMOImpl(IAppInnerServiceSMO appInnerServiceSMOImpl) { |
| | | this.appInnerServiceSMOImpl = appInnerServiceSMOImpl; |
| | | } |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | super.validatePageInfo(reqJson); |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | AppDto appDto = BeanConvertUtil.covertBean(reqJson, AppDto.class); |
| | | |
| | | int count = appInnerServiceSMOImpl.queryAppsCount(appDto); |
| | | |
| | | List<ApiAppDataVo> apps = null; |
| | | |
| | | if (count > 0) { |
| | | apps = BeanConvertUtil.covertBeanList(appInnerServiceSMOImpl.queryApps(appDto), ApiAppDataVo.class); |
| | | } else { |
| | | apps = new ArrayList<>(); |
| | | } |
| | | |
| | | ApiAppVo apiAppVo = new ApiAppVo(); |
| | | |
| | | apiAppVo.setTotal(count); |
| | | apiAppVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row"))); |
| | | apiAppVo.setApps(apps); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiAppVo), HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.app; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.common.constant.*; |
| | | import com.java110.common.exception.ListenerExecuteException; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.common.util.BeanConvertUtil; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.core.smo.app.IAppInnerServiceSMO; |
| | | import com.java110.dto.app.AppDto; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.vo.api.app.ApiAppDataVo; |
| | | import com.java110.vo.api.app.ApiAppVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | |
| | | import com.java110.core.annotation.Java110Listener; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 保存小区侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("saveAppListener") |
| | | public class SaveAppListener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private IAppInnerServiceSMO appInnerServiceSMOImpl; |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "name", "必填,请填写应用名称"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | AppDto appDto = BeanConvertUtil.covertBean(reqJson, AppDto.class); |
| | | |
| | | appDto.setAppId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_id)); |
| | | |
| | | int count = appInnerServiceSMOImpl.saveApp(appDto); |
| | | |
| | | |
| | | |
| | | if (count < 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "保存数据失败"); |
| | | } |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("", HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeAppConstant.ADD_APP; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | public IAppInnerServiceSMO getAppInnerServiceSMOImpl() { |
| | | return appInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setAppInnerServiceSMOImpl(IAppInnerServiceSMO appInnerServiceSMOImpl) { |
| | | this.appInnerServiceSMOImpl = appInnerServiceSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.app; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.common.constant.*; |
| | | import com.java110.common.exception.ListenerExecuteException; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.common.util.BeanConvertUtil; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.app.IAppInnerServiceSMO; |
| | | import com.java110.dto.app.AppDto; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 保存应用侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("updateAppListener") |
| | | public class UpdateAppListener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private IAppInnerServiceSMO appInnerServiceSMOImpl; |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "appId", "应用Id不能为空"); |
| | | Assert.hasKeyAndValue(reqJson, "name", "必填,请填写应用名称"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | AppDto appDto = BeanConvertUtil.covertBean(reqJson, AppDto.class); |
| | | |
| | | |
| | | int count = appInnerServiceSMOImpl.updateApp(appDto); |
| | | |
| | | |
| | | |
| | | if (count < 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "修改数据失败"); |
| | | } |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("", HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeAppConstant.UPDATE_APP; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | |
| | | public IAppInnerServiceSMO getAppInnerServiceSMOImpl() { |
| | | return appInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setAppInnerServiceSMOImpl(IAppInnerServiceSMO appInnerServiceSMOImpl) { |
| | | this.appInnerServiceSMOImpl = appInnerServiceSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.service; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.common.constant.*; |
| | | import com.java110.common.exception.ListenerExecuteException; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.common.util.BeanConvertUtil; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.service.IServiceInnerServiceSMO; |
| | | import com.java110.dto.service.ServiceDto; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | import com.java110.core.annotation.Java110Listener; |
| | | |
| | | /** |
| | | * 保存小区侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("deleteServiceListener") |
| | | public class DeleteServiceListener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private IServiceInnerServiceSMO serviceInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "serviceId", "服务ID不能为空"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | ServiceDto serviceDto = BeanConvertUtil.covertBean(reqJson, ServiceDto.class); |
| | | |
| | | serviceDto.setStatusCd(StatusConstant.STATUS_CD_INVALID); |
| | | |
| | | int count = serviceInnerServiceSMOImpl.deleteService(serviceDto); |
| | | |
| | | |
| | | |
| | | if (count < 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "删除数据失败"); |
| | | } |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("", HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeServiceConstant.DELETE_SERVICE; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | public IServiceInnerServiceSMO getServiceInnerServiceSMOImpl() { |
| | | return serviceInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setServiceInnerServiceSMOImpl(IServiceInnerServiceSMO serviceInnerServiceSMOImpl) { |
| | | this.serviceInnerServiceSMOImpl = serviceInnerServiceSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.service; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.common.constant.ServiceCodeConstant; |
| | | import com.java110.common.util.BeanConvertUtil; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.service.IServiceInnerServiceSMO; |
| | | import com.java110.dto.service.ServiceDto; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import com.java110.vo.api.service.ApiServiceDataVo; |
| | | import com.java110.vo.api.service.ApiServiceVo; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | import com.java110.common.constant.CommonConstant; |
| | | import com.java110.common.constant.BusinessTypeConstant; |
| | | import com.java110.common.constant.ServiceCodeServiceConstant; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | |
| | | /** |
| | | * 查询小区侦听类 |
| | | */ |
| | | @Java110Listener("listServicesListener") |
| | | public class ListServicesListener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private IServiceInnerServiceSMO serviceInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeServiceConstant.LIST_SERVICES; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.GET; |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | public IServiceInnerServiceSMO getServiceInnerServiceSMOImpl() { |
| | | return serviceInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setServiceInnerServiceSMOImpl(IServiceInnerServiceSMO serviceInnerServiceSMOImpl) { |
| | | this.serviceInnerServiceSMOImpl = serviceInnerServiceSMOImpl; |
| | | } |
| | | |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | super.validatePageInfo(reqJson); |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | ServiceDto serviceDto = BeanConvertUtil.covertBean(reqJson, ServiceDto.class); |
| | | |
| | | int count = serviceInnerServiceSMOImpl.queryServicesCount(serviceDto); |
| | | |
| | | List<ApiServiceDataVo> services = null; |
| | | |
| | | if (count > 0) { |
| | | services = BeanConvertUtil.covertBeanList(serviceInnerServiceSMOImpl.queryServices(serviceDto), ApiServiceDataVo.class); |
| | | } else { |
| | | services = new ArrayList<>(); |
| | | } |
| | | |
| | | ApiServiceVo apiServiceVo = new ApiServiceVo(); |
| | | |
| | | apiServiceVo.setTotal(count); |
| | | apiServiceVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row"))); |
| | | apiServiceVo.setServices(services); |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiServiceVo), HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.service; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.common.constant.*; |
| | | import com.java110.common.exception.ListenerExecuteException; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.common.util.BeanConvertUtil; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.factory.GenerateCodeFactory; |
| | | import com.java110.core.smo.service.IServiceInnerServiceSMO; |
| | | import com.java110.dto.service.ServiceDto; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | |
| | | import com.java110.core.annotation.Java110Listener; |
| | | /** |
| | | * 保存小区侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("saveServiceListener") |
| | | public class SaveServiceListener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private IServiceInnerServiceSMO serviceInnerServiceSMOImpl; |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | //Assert.hasKeyAndValue(reqJson, "xxx", "xxx"); |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "name", "必填,请填写服务名称"); |
| | | Assert.hasKeyAndValue(reqJson, "serviceCode", "必填,请填写服务编码如 service.saveService"); |
| | | Assert.hasKeyAndValue(reqJson, "businessTypeCd", "可填,请填写秘钥,如果填写了需要加密传输"); |
| | | Assert.hasKeyAndValue(reqJson, "seq", "必填,请填写序列"); |
| | | Assert.hasKeyAndValue(reqJson, "isInstance", "可填,请填写实例 Y 或N"); |
| | | Assert.hasKeyAndValue(reqJson, "method", "必填,请填写调用方式"); |
| | | Assert.hasKeyAndValue(reqJson, "timeout", "必填,请填写超时时间"); |
| | | Assert.hasKeyAndValue(reqJson, "retryCount", "必填,请填写重试次数"); |
| | | Assert.hasKeyAndValue(reqJson, "provideAppId", "必填,请填写提供服务"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | ServiceDto serviceDto = BeanConvertUtil.covertBean(reqJson, ServiceDto.class); |
| | | |
| | | serviceDto.setServiceId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_service_id)); |
| | | |
| | | int count = serviceInnerServiceSMOImpl.saveService(serviceDto); |
| | | |
| | | |
| | | |
| | | if (count < 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "保存数据失败"); |
| | | } |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("", HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeServiceConstant.ADD_SERVICE; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | public IServiceInnerServiceSMO getServiceInnerServiceSMOImpl() { |
| | | return serviceInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setServiceInnerServiceSMOImpl(IServiceInnerServiceSMO serviceInnerServiceSMOImpl) { |
| | | this.serviceInnerServiceSMOImpl = serviceInnerServiceSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.api.listener.service; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.api.listener.AbstractServiceApiListener; |
| | | import com.java110.common.constant.*; |
| | | import com.java110.common.exception.ListenerExecuteException; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.common.util.BeanConvertUtil; |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.core.context.DataFlowContext; |
| | | import com.java110.core.smo.service.IServiceInnerServiceSMO; |
| | | import com.java110.dto.service.ServiceDto; |
| | | import com.java110.entity.center.AppService; |
| | | import com.java110.event.service.api.ServiceDataFlowEvent; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.HttpStatus; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 保存服务侦听 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Java110Listener("updateServiceListener") |
| | | public class UpdateServiceListener extends AbstractServiceApiListener { |
| | | |
| | | @Autowired |
| | | private IServiceInnerServiceSMO serviceInnerServiceSMOImpl; |
| | | @Override |
| | | protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) { |
| | | |
| | | Assert.hasKeyAndValue(reqJson, "serviceId", "服务ID不能为空"); |
| | | Assert.hasKeyAndValue(reqJson, "name", "必填,请填写服务名称"); |
| | | Assert.hasKeyAndValue(reqJson, "serviceCode", "必填,请填写服务编码如 service.saveService"); |
| | | Assert.hasKeyAndValue(reqJson, "businessTypeCd", "可填,请填写秘钥,如果填写了需要加密传输"); |
| | | Assert.hasKeyAndValue(reqJson, "seq", "必填,请填写序列"); |
| | | Assert.hasKeyAndValue(reqJson, "isInstance", "可填,请填写实例 Y 或N"); |
| | | Assert.hasKeyAndValue(reqJson, "method", "必填,请填写调用方式"); |
| | | Assert.hasKeyAndValue(reqJson, "timeout", "必填,请填写超时时间"); |
| | | Assert.hasKeyAndValue(reqJson, "retryCount", "必填,请填写重试次数"); |
| | | Assert.hasKeyAndValue(reqJson, "provideAppId", "必填,请填写提供服务"); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) { |
| | | |
| | | ServiceDto serviceDto = BeanConvertUtil.covertBean(reqJson, ServiceDto.class); |
| | | |
| | | |
| | | int count = serviceInnerServiceSMOImpl.updateService(serviceDto); |
| | | |
| | | |
| | | |
| | | if (count < 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "修改数据失败"); |
| | | } |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("", HttpStatus.OK); |
| | | |
| | | context.setResponseEntity(responseEntity); |
| | | } |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeServiceConstant.UPDATE_SERVICE; |
| | | } |
| | | |
| | | @Override |
| | | public HttpMethod getHttpMethod() { |
| | | return HttpMethod.POST; |
| | | } |
| | | |
| | | @Override |
| | | public int getOrder() { |
| | | return DEFAULT_ORDER; |
| | | } |
| | | |
| | | |
| | | public IServiceInnerServiceSMO getServiceInnerServiceSMOImpl() { |
| | | return serviceInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setServiceInnerServiceSMOImpl(IServiceInnerServiceSMO serviceInnerServiceSMOImpl) { |
| | | this.serviceInnerServiceSMOImpl = serviceInnerServiceSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.community.dao; |
| | | |
| | | |
| | | import com.java110.common.exception.DAOException; |
| | | import com.java110.entity.merchant.BoMerchant; |
| | | import com.java110.entity.merchant.BoMerchantAttr; |
| | | import com.java110.entity.merchant.Merchant; |
| | | import com.java110.entity.merchant.MerchantAttr; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 应用组件内部之间使用,没有给外围系统提供服务能力 |
| | | * 应用服务接口类,要求全部以字符串传输,方便微服务化 |
| | | * 新建客户,修改客户,删除客户,查询客户等功能 |
| | | * |
| | | * Created by wuxw on 2016/12/27. |
| | | */ |
| | | public interface IAppServiceDao { |
| | | |
| | | /** |
| | | * 保存 应用信息 |
| | | * @param businessAppInfo 应用信息 封装 |
| | | * @throws DAOException 操作数据库异常 |
| | | */ |
| | | int saveAppInfo(Map businessAppInfo) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询应用信息(business过程) |
| | | * 根据bId 查询应用信息 |
| | | * @param info bId 信息 |
| | | * @return 应用信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getBusinessAppInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存 应用信息 Business数据到 Instance中 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveAppInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询应用信息(instance过程) |
| | | * 根据bId 查询应用信息 |
| | | * @param info bId 信息 |
| | | * @return 应用信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getAppInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改应用信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | int updateAppInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询应用总数 |
| | | * |
| | | * @param info 应用信息 |
| | | * @return 应用数量 |
| | | */ |
| | | int queryAppsCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.community.dao; |
| | | |
| | | |
| | | import com.java110.common.exception.DAOException; |
| | | import com.java110.entity.merchant.BoMerchant; |
| | | import com.java110.entity.merchant.BoMerchantAttr; |
| | | import com.java110.entity.merchant.Merchant; |
| | | import com.java110.entity.merchant.MerchantAttr; |
| | | |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 服务组件内部之间使用,没有给外围系统提供服务能力 |
| | | * 服务服务接口类,要求全部以字符串传输,方便微服务化 |
| | | * 新建客户,修改客户,删除客户,查询客户等功能 |
| | | * |
| | | * Created by wuxw on 2016/12/27. |
| | | */ |
| | | public interface IServiceServiceDao { |
| | | |
| | | /** |
| | | * 保存 服务信息 |
| | | * @param businessServiceInfo 服务信息 封装 |
| | | * @throws DAOException 操作数据库异常 |
| | | */ |
| | | int saveServiceInfo(Map businessServiceInfo) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询服务信息(business过程) |
| | | * 根据bId 查询服务信息 |
| | | * @param info bId 信息 |
| | | * @return 服务信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getBusinessServiceInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存 服务信息 Business数据到 Instance中 |
| | | * @param info |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | void saveServiceInfoInstance(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | |
| | | /** |
| | | * 查询服务信息(instance过程) |
| | | * 根据bId 查询服务信息 |
| | | * @param info bId 信息 |
| | | * @return 服务信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | List<Map> getServiceInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | |
| | | /** |
| | | * 修改服务信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | int updateServiceInfo(Map info) throws DAOException; |
| | | |
| | | |
| | | /** |
| | | * 查询服务总数 |
| | | * |
| | | * @param info 服务信息 |
| | | * @return 服务数量 |
| | | */ |
| | | int queryServicesCount(Map info); |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.community.dao.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.ResponseConstant; |
| | | import com.java110.common.exception.DAOException; |
| | | import com.java110.common.util.DateUtil; |
| | | import com.java110.community.dao.IAppServiceDao; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.transaction.annotation.Transactional; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 应用服务 与数据库交互 |
| | | * Created by wuxw on 2017/4/5. |
| | | */ |
| | | @Service("appServiceDaoImpl") |
| | | //@Transactional |
| | | public class AppServiceDaoImpl extends BaseServiceDao implements IAppServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(AppServiceDaoImpl.class); |
| | | |
| | | /** |
| | | * 应用信息封装 |
| | | * @param businessAppInfo 应用信息 封装 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public int saveAppInfo(Map businessAppInfo) throws DAOException { |
| | | businessAppInfo.put("month", DateUtil.getCurrentMonth()); |
| | | // 查询business_user 数据是否已经存在 |
| | | logger.debug("保存应用信息 入参 businessAppInfo : {}",businessAppInfo); |
| | | int saveFlag = sqlSessionTemplate.insert("appServiceDaoImpl.saveAppInfo",businessAppInfo); |
| | | |
| | | return saveFlag; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询应用信息 |
| | | * @param info bId 信息 |
| | | * @return 应用信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getBusinessAppInfo(Map info) throws DAOException { |
| | | |
| | | logger.debug("查询应用信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessAppInfos = sqlSessionTemplate.selectList("appServiceDaoImpl.getBusinessAppInfo",info); |
| | | |
| | | return businessAppInfos; |
| | | } |
| | | |
| | | |
| | | |
| | | /** |
| | | * 保存应用信息 到 instance |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveAppInfoInstance(Map info) throws DAOException { |
| | | logger.debug("保存应用信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("appServiceDaoImpl.saveAppInfoInstance",info); |
| | | |
| | | if(saveFlag < 1){ |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存应用信息Instance数据失败:"+ JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询应用信息(instance) |
| | | * @param info bId 信息 |
| | | * @return List<Map> |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getAppInfo(Map info) throws DAOException { |
| | | logger.debug("查询应用信息 入参 info : {}",info); |
| | | |
| | | List<Map> businessAppInfos = sqlSessionTemplate.selectList("appServiceDaoImpl.getAppInfo",info); |
| | | |
| | | return businessAppInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改应用信息 |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public int updateAppInfo(Map info) throws DAOException { |
| | | logger.debug("修改应用信息Instance 入参 info : {}",info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("appServiceDaoImpl.updateAppInfo",info); |
| | | |
| | | return saveFlag; |
| | | } |
| | | |
| | | /** |
| | | * 查询应用数量 |
| | | * @param info 应用信息 |
| | | * @return 应用数量 |
| | | */ |
| | | @Override |
| | | public int queryAppsCount(Map info) { |
| | | logger.debug("查询应用数据 入参 info : {}",info); |
| | | |
| | | List<Map> businessAppInfos = sqlSessionTemplate.selectList("appServiceDaoImpl.queryAppsCount", info); |
| | | if (businessAppInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessAppInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.community.dao.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.ResponseConstant; |
| | | import com.java110.common.exception.DAOException; |
| | | import com.java110.common.util.DateUtil; |
| | | import com.java110.community.dao.IServiceServiceDao; |
| | | import com.java110.core.base.dao.BaseServiceDao; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 服务服务 与数据库交互 |
| | | * Created by wuxw on 2017/4/5. |
| | | */ |
| | | @Service("serviceServiceDaoImpl") |
| | | //@Transactional |
| | | public class ServiceServiceDaoImpl extends BaseServiceDao implements IServiceServiceDao { |
| | | |
| | | private static Logger logger = LoggerFactory.getLogger(ServiceServiceDaoImpl.class); |
| | | |
| | | /** |
| | | * 服务信息封装 |
| | | * |
| | | * @param businessServiceInfo 服务信息 封装 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public int saveServiceInfo(Map businessServiceInfo) throws DAOException { |
| | | businessServiceInfo.put("month", DateUtil.getCurrentMonth()); |
| | | // 查询business_user 数据是否已经存在 |
| | | logger.debug("保存服务信息 入参 businessServiceInfo : {}", businessServiceInfo); |
| | | int saveFlag = sqlSessionTemplate.insert("serviceServiceDaoImpl.saveServiceInfo", businessServiceInfo); |
| | | |
| | | return saveFlag; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询服务信息 |
| | | * |
| | | * @param info bId 信息 |
| | | * @return 服务信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getBusinessServiceInfo(Map info) throws DAOException { |
| | | |
| | | logger.debug("查询服务信息 入参 info : {}", info); |
| | | |
| | | List<Map> businessServiceInfos = sqlSessionTemplate.selectList("serviceServiceDaoImpl.getBusinessServiceInfo", info); |
| | | |
| | | return businessServiceInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 保存服务信息 到 instance |
| | | * |
| | | * @param info bId 信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public void saveServiceInfoInstance(Map info) throws DAOException { |
| | | logger.debug("保存服务信息Instance 入参 info : {}", info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.insert("serviceServiceDaoImpl.saveServiceInfoInstance", info); |
| | | |
| | | if (saveFlag < 1) { |
| | | throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存服务信息Instance数据失败:" + JSONObject.toJSONString(info)); |
| | | } |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询服务信息(instance) |
| | | * |
| | | * @param info bId 信息 |
| | | * @return List<Map> |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public List<Map> getServiceInfo(Map info) throws DAOException { |
| | | logger.debug("查询服务信息 入参 info : {}", info); |
| | | |
| | | List<Map> businessServiceInfos = sqlSessionTemplate.selectList("serviceServiceDaoImpl.getServiceInfo", info); |
| | | |
| | | return businessServiceInfos; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 修改服务信息 |
| | | * |
| | | * @param info 修改信息 |
| | | * @throws DAOException DAO异常 |
| | | */ |
| | | @Override |
| | | public int updateServiceInfo(Map info) throws DAOException { |
| | | logger.debug("修改服务信息Instance 入参 info : {}", info); |
| | | |
| | | int saveFlag = sqlSessionTemplate.update("serviceServiceDaoImpl.updateServiceInfo", info); |
| | | |
| | | return saveFlag; |
| | | } |
| | | |
| | | /** |
| | | * 查询服务数量 |
| | | * |
| | | * @param info 服务信息 |
| | | * @return 服务数量 |
| | | */ |
| | | @Override |
| | | public int queryServicesCount(Map info) { |
| | | logger.debug("查询服务数据 入参 info : {}", info); |
| | | |
| | | List<Map> businessServiceInfos = sqlSessionTemplate.selectList("serviceServiceDaoImpl.queryServicesCount", info); |
| | | if (businessServiceInfos.size() < 1) { |
| | | return 0; |
| | | } |
| | | |
| | | return Integer.parseInt(businessServiceInfos.get(0).get("count").toString()); |
| | | } |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.community.smo.impl; |
| | | |
| | | |
| | | import com.java110.common.util.BeanConvertUtil; |
| | | import com.java110.community.dao.IAppServiceDao; |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.core.smo.app.IAppInnerServiceSMO; |
| | | import com.java110.core.smo.user.IUserInnerServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.UserDto; |
| | | import com.java110.dto.app.AppDto; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName FloorInnerServiceSMOImpl |
| | | * @Description 应用内部服务实现类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:20 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @RestController |
| | | public class AppInnerServiceSMOImpl extends BaseServiceSMO implements IAppInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private IAppServiceDao appServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public List<AppDto> queryApps(@RequestBody AppDto appDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = appDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | appDto.setPage((page - 1) * appDto.getRow()); |
| | | appDto.setRow(page * appDto.getRow()); |
| | | } |
| | | |
| | | List<AppDto> apps = BeanConvertUtil.covertBeanList(appServiceDaoImpl.getAppInfo(BeanConvertUtil.beanCovertMap(appDto)), AppDto.class); |
| | | |
| | | |
| | | return apps; |
| | | } |
| | | |
| | | /** |
| | | * 从用户列表中查询用户,将用户中的信息 刷新到 floor对象中 |
| | | * |
| | | * @param app 小区应用信息 |
| | | * @param users 用户列表 |
| | | */ |
| | | private void refreshApp(AppDto app, List<UserDto> users) { |
| | | for (UserDto user : users) { |
| | | if (app.getUserId().equals(user.getUserId())) { |
| | | BeanConvertUtil.covertBean(user, app); |
| | | } |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * 获取批量userId |
| | | * |
| | | * @param apps 小区楼信息 |
| | | * @return 批量userIds 信息 |
| | | */ |
| | | private String[] getUserIds(List<AppDto> apps) { |
| | | List<String> userIds = new ArrayList<String>(); |
| | | for (AppDto app : apps) { |
| | | userIds.add(app.getUserId()); |
| | | } |
| | | |
| | | return userIds.toArray(new String[userIds.size()]); |
| | | } |
| | | |
| | | @Override |
| | | public int queryAppsCount(@RequestBody AppDto appDto) { |
| | | return appServiceDaoImpl.queryAppsCount(BeanConvertUtil.beanCovertMap(appDto)); } |
| | | |
| | | @Override |
| | | public int updateApp(@RequestBody AppDto appDto) { |
| | | return appServiceDaoImpl.updateAppInfo(BeanConvertUtil.beanCovertMap(appDto)); |
| | | } |
| | | |
| | | @Override |
| | | public int saveApp(@RequestBody AppDto appDto) { |
| | | return appServiceDaoImpl.saveAppInfo(BeanConvertUtil.beanCovertMap(appDto)); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteApp(@RequestBody AppDto appDto) { |
| | | appDto.setStatusCd("1"); |
| | | return appServiceDaoImpl.updateAppInfo(BeanConvertUtil.beanCovertMap(appDto)); |
| | | } |
| | | |
| | | public IAppServiceDao getAppServiceDaoImpl() { |
| | | return appServiceDaoImpl; |
| | | } |
| | | |
| | | public void setAppServiceDaoImpl(IAppServiceDao appServiceDaoImpl) { |
| | | this.appServiceDaoImpl = appServiceDaoImpl; |
| | | } |
| | | |
| | | public IUserInnerServiceSMO getUserInnerServiceSMOImpl() { |
| | | return userInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) { |
| | | this.userInnerServiceSMOImpl = userInnerServiceSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.community.smo.impl; |
| | | |
| | | |
| | | import com.java110.common.util.BeanConvertUtil; |
| | | import com.java110.community.dao.IServiceServiceDao; |
| | | import com.java110.core.base.smo.BaseServiceSMO; |
| | | import com.java110.core.smo.service.IServiceInnerServiceSMO; |
| | | import com.java110.core.smo.user.IUserInnerServiceSMO; |
| | | import com.java110.dto.PageDto; |
| | | import com.java110.dto.UserDto; |
| | | import com.java110.dto.service.ServiceDto; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName FloorInnerServiceSMOImpl |
| | | * @Description 服务内部服务实现类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:20 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @RestController |
| | | public class ServiceInnerServiceSMOImpl extends BaseServiceSMO implements IServiceInnerServiceSMO { |
| | | |
| | | @Autowired |
| | | private IServiceServiceDao serviceServiceDaoImpl; |
| | | |
| | | @Autowired |
| | | private IUserInnerServiceSMO userInnerServiceSMOImpl; |
| | | |
| | | @Override |
| | | public List<ServiceDto> queryServices(@RequestBody ServiceDto serviceDto) { |
| | | |
| | | //校验是否传了 分页信息 |
| | | |
| | | int page = serviceDto.getPage(); |
| | | |
| | | if (page != PageDto.DEFAULT_PAGE) { |
| | | serviceDto.setPage((page - 1) * serviceDto.getRow()); |
| | | serviceDto.setRow(page * serviceDto.getRow()); |
| | | } |
| | | |
| | | List<ServiceDto> services = BeanConvertUtil.covertBeanList(serviceServiceDaoImpl.getServiceInfo(BeanConvertUtil.beanCovertMap(serviceDto)), ServiceDto.class); |
| | | |
| | | |
| | | return services; |
| | | } |
| | | |
| | | |
| | | |
| | | @Override |
| | | public int queryServicesCount(@RequestBody ServiceDto serviceDto) { |
| | | return serviceServiceDaoImpl.queryServicesCount(BeanConvertUtil.beanCovertMap(serviceDto)); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public int updateService(@RequestBody ServiceDto serviceDto) { |
| | | return serviceServiceDaoImpl.updateServiceInfo(BeanConvertUtil.beanCovertMap(serviceDto)); |
| | | } |
| | | |
| | | @Override |
| | | public int saveService(@RequestBody ServiceDto serviceDto) { |
| | | return serviceServiceDaoImpl.saveServiceInfo(BeanConvertUtil.beanCovertMap(serviceDto)); |
| | | } |
| | | |
| | | @Override |
| | | public int deleteService(@RequestBody ServiceDto serviceDto) { |
| | | serviceDto.setStatusCd("1"); |
| | | return serviceServiceDaoImpl.updateServiceInfo(BeanConvertUtil.beanCovertMap(serviceDto)); |
| | | } |
| | | |
| | | public IServiceServiceDao getServiceServiceDaoImpl() { |
| | | return serviceServiceDaoImpl; |
| | | } |
| | | |
| | | public void setServiceServiceDaoImpl(IServiceServiceDao serviceServiceDaoImpl) { |
| | | this.serviceServiceDaoImpl = serviceServiceDaoImpl; |
| | | } |
| | | |
| | | public IUserInnerServiceSMO getUserInnerServiceSMOImpl() { |
| | | return userInnerServiceSMOImpl; |
| | | } |
| | | |
| | | public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) { |
| | | this.userInnerServiceSMOImpl = userInnerServiceSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.app; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.app.IAddAppSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 添加应用组件 |
| | | */ |
| | | @Component("addApp") |
| | | public class AddAppComponent { |
| | | |
| | | @Autowired |
| | | private IAddAppSMO addAppSMOImpl; |
| | | |
| | | /** |
| | | * 添加应用数据 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> save(IPageData pd){ |
| | | return addAppSMOImpl.saveApp(pd); |
| | | } |
| | | |
| | | public IAddAppSMO getAddAppSMOImpl() { |
| | | return addAppSMOImpl; |
| | | } |
| | | |
| | | public void setAddAppSMOImpl(IAddAppSMO addAppSMOImpl) { |
| | | this.addAppSMOImpl = addAppSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.app; |
| | | |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.app.IListAppsSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * 应用组件管理类 |
| | | * <p> |
| | | * add by wuxw |
| | | * <p> |
| | | * 2019-06-29 |
| | | */ |
| | | @Component("appManage") |
| | | public class AppManageComponent { |
| | | |
| | | @Autowired |
| | | private IListAppsSMO listAppsSMOImpl; |
| | | |
| | | /** |
| | | * 查询应用列表 |
| | | * |
| | | * @param pd 页面数据封装 |
| | | * @return 返回 ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> list(IPageData pd) { |
| | | return listAppsSMOImpl.listApps(pd); |
| | | } |
| | | |
| | | public IListAppsSMO getListAppsSMOImpl() { |
| | | return listAppsSMOImpl; |
| | | } |
| | | |
| | | public void setListAppsSMOImpl(IListAppsSMO listAppsSMOImpl) { |
| | | this.listAppsSMOImpl = listAppsSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.app; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.app.IDeleteAppSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 添加应用组件 |
| | | */ |
| | | @Component("deleteApp") |
| | | public class DeleteAppComponent { |
| | | |
| | | @Autowired |
| | | private IDeleteAppSMO deleteAppSMOImpl; |
| | | |
| | | /** |
| | | * 添加应用数据 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> delete(IPageData pd){ |
| | | return deleteAppSMOImpl.deleteApp(pd); |
| | | } |
| | | |
| | | public IDeleteAppSMO getDeleteAppSMOImpl() { |
| | | return deleteAppSMOImpl; |
| | | } |
| | | |
| | | public void setDeleteAppSMOImpl(IDeleteAppSMO deleteAppSMOImpl) { |
| | | this.deleteAppSMOImpl = deleteAppSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.app; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.app.IEditAppSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 编辑小区组件 |
| | | */ |
| | | @Component("editApp") |
| | | public class EditAppComponent { |
| | | |
| | | @Autowired |
| | | private IEditAppSMO editAppSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区数据 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> update(IPageData pd){ |
| | | return editAppSMOImpl.updateApp(pd); |
| | | } |
| | | |
| | | public IEditAppSMO getEditAppSMOImpl() { |
| | | return editAppSMOImpl; |
| | | } |
| | | |
| | | public void setEditAppSMOImpl(IEditAppSMO editAppSMOImpl) { |
| | | this.editAppSMOImpl = editAppSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.service; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.service.IAddServiceSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 添加服务组件 |
| | | */ |
| | | @Component("addService") |
| | | public class AddServiceComponent { |
| | | |
| | | @Autowired |
| | | private IAddServiceSMO addServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加服务数据 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> save(IPageData pd){ |
| | | return addServiceSMOImpl.saveService(pd); |
| | | } |
| | | |
| | | public IAddServiceSMO getAddServiceSMOImpl() { |
| | | return addServiceSMOImpl; |
| | | } |
| | | |
| | | public void setAddServiceSMOImpl(IAddServiceSMO addServiceSMOImpl) { |
| | | this.addServiceSMOImpl = addServiceSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.service; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.service.IDeleteServiceSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 添加服务组件 |
| | | */ |
| | | @Component("deleteService") |
| | | public class DeleteServiceComponent { |
| | | |
| | | @Autowired |
| | | private IDeleteServiceSMO deleteServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加服务数据 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> delete(IPageData pd){ |
| | | return deleteServiceSMOImpl.deleteService(pd); |
| | | } |
| | | |
| | | public IDeleteServiceSMO getDeleteServiceSMOImpl() { |
| | | return deleteServiceSMOImpl; |
| | | } |
| | | |
| | | public void setDeleteServiceSMOImpl(IDeleteServiceSMO deleteServiceSMOImpl) { |
| | | this.deleteServiceSMOImpl = deleteServiceSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.service; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.service.IEditServiceSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | /** |
| | | * 编辑小区组件 |
| | | */ |
| | | @Component("editService") |
| | | public class EditServiceComponent { |
| | | |
| | | @Autowired |
| | | private IEditServiceSMO editServiceSMOImpl; |
| | | |
| | | /** |
| | | * 添加小区数据 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> update(IPageData pd){ |
| | | return editServiceSMOImpl.updateService(pd); |
| | | } |
| | | |
| | | public IEditServiceSMO getEditServiceSMOImpl() { |
| | | return editServiceSMOImpl; |
| | | } |
| | | |
| | | public void setEditServiceSMOImpl(IEditServiceSMO editServiceSMOImpl) { |
| | | this.editServiceSMOImpl = editServiceSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.components.service; |
| | | |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.smo.service.IListServicesSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | |
| | | /** |
| | | * 服务组件管理类 |
| | | * <p> |
| | | * add by wuxw |
| | | * <p> |
| | | * 2019-06-29 |
| | | */ |
| | | @Component("serviceManage") |
| | | public class ServiceManageComponent { |
| | | |
| | | @Autowired |
| | | private IListServicesSMO listServicesSMOImpl; |
| | | |
| | | /** |
| | | * 查询服务列表 |
| | | * |
| | | * @param pd 页面数据封装 |
| | | * @return 返回 ResponseEntity 对象 |
| | | */ |
| | | public ResponseEntity<String> list(IPageData pd) { |
| | | return listServicesSMOImpl.listServices(pd); |
| | | } |
| | | |
| | | public IListServicesSMO getListServicesSMOImpl() { |
| | | return listServicesSMOImpl; |
| | | } |
| | | |
| | | public void setListServicesSMOImpl(IListServicesSMO listServicesSMOImpl) { |
| | | this.listServicesSMOImpl = listServicesSMOImpl; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.app; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 添加应用接口 |
| | | * |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | public interface IAddAppSMO { |
| | | |
| | | /** |
| | | * 添加应用 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | ResponseEntity<String> saveApp(IPageData pd); |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.app; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 添加应用接口 |
| | | * |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | public interface IDeleteAppSMO { |
| | | |
| | | /** |
| | | * 添加应用 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | ResponseEntity<String> deleteApp(IPageData pd); |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.app; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 修改应用接口 |
| | | * |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | public interface IEditAppSMO { |
| | | |
| | | /** |
| | | * 修改小区 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | ResponseEntity<String> updateApp(IPageData pd); |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.app; |
| | | |
| | | import com.java110.common.exception.SMOException; |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 应用管理服务接口类 |
| | | * |
| | | * add by wuxw 2019-06-29 |
| | | */ |
| | | public interface IListAppsSMO { |
| | | |
| | | /** |
| | | * 查询应用信息 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象数据 |
| | | * @throws SMOException 业务代码层 |
| | | */ |
| | | ResponseEntity<String> listApps(IPageData pd) throws SMOException; |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.app.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.PrivilegeCodeConstant; |
| | | import com.java110.common.constant.ServiceConstant; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.web.smo.app.IAddAppSMO; |
| | | import org.springframework.web.client.RestTemplate; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.core.AbstractComponentSMO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 添加小区服务实现类 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Service("addAppSMOImpl") |
| | | public class AddAppSMOImpl extends AbstractComponentSMO implements IAddAppSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | |
| | | //super.validatePageInfo(pd); |
| | | |
| | | //Assert.hasKeyAndValue(paramIn, "xxx", "xxx"); |
| | | Assert.hasKeyAndValue(paramIn, "name", "必填,请填写应用名称"); |
| | | |
| | | |
| | | |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_APP); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) { |
| | | ResponseEntity<String> responseEntity = null; |
| | | super.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), |
| | | ServiceConstant.SERVICE_API_URL + "/api/app.saveApp", |
| | | HttpMethod.POST); |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> saveApp(IPageData pd) { |
| | | return super.businessProcess(pd); |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.app.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.PrivilegeCodeConstant; |
| | | import com.java110.common.constant.ServiceConstant; |
| | | import com.java110.common.util.Assert; |
| | | import org.springframework.web.client.RestTemplate; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.core.AbstractComponentSMO; |
| | | import com.java110.web.smo.app.IDeleteAppSMO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 添加小区服务实现类 |
| | | * delete by wuxw 2019-06-30 |
| | | */ |
| | | @Service("deleteAppSMOImpl") |
| | | public class DeleteAppSMOImpl extends AbstractComponentSMO implements IDeleteAppSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | |
| | | //super.validatePageInfo(pd); |
| | | |
| | | //Assert.hasKeyAndValue(paramIn, "xxx", "xxx"); |
| | | Assert.hasKeyAndValue(paramIn, "appId", "应用Id不能为空"); |
| | | |
| | | |
| | | |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_APP); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) { |
| | | ResponseEntity<String> responseEntity = null; |
| | | super.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), |
| | | ServiceConstant.SERVICE_API_URL + "/api/app.deleteApp", |
| | | HttpMethod.POST); |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> deleteApp(IPageData pd) { |
| | | return super.businessProcess(pd); |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.app.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.PrivilegeCodeConstant; |
| | | import com.java110.common.constant.ServiceConstant; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.core.AbstractComponentSMO; |
| | | import com.java110.web.smo.app.IEditAppSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | /** |
| | | * 添加应用服务实现类 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Service("eidtAppSMOImpl") |
| | | public class EditAppSMOImpl extends AbstractComponentSMO implements IEditAppSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | |
| | | //super.validatePageInfo(pd); |
| | | |
| | | Assert.hasKeyAndValue(paramIn, "appId", "应用Id不能为空"); |
| | | Assert.hasKeyAndValue(paramIn, "name", "必填,请填写应用名称"); |
| | | |
| | | |
| | | |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_APP); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) { |
| | | ResponseEntity<String> responseEntity = null; |
| | | super.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), |
| | | ServiceConstant.SERVICE_API_URL + "/api/app.updateApp", |
| | | HttpMethod.POST); |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> updateApp(IPageData pd) { |
| | | return super.businessProcess(pd); |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.app.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.PrivilegeCodeConstant; |
| | | import com.java110.common.constant.ServiceConstant; |
| | | import com.java110.common.exception.SMOException; |
| | | import com.java110.common.util.BeanConvertUtil; |
| | | import com.java110.web.smo.app.IListAppsSMO; |
| | | import org.springframework.web.client.RestTemplate; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.entity.component.ComponentValidateResult; |
| | | import com.java110.web.core.AbstractComponentSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 查询app服务类 |
| | | */ |
| | | @Service("listAppsSMOImpl") |
| | | public class ListAppsSMOImpl extends AbstractComponentSMO implements IListAppsSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | public ResponseEntity<String> listApps(IPageData pd) throws SMOException { |
| | | return businessProcess(pd); |
| | | } |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | |
| | | super.validatePageInfo(pd); |
| | | |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_APP); |
| | | } |
| | | |
| | | @Override |
| | | protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) { |
| | | ComponentValidateResult result = super.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | |
| | | Map paramMap = BeanConvertUtil.beanCovertMap(result); |
| | | paramIn.putAll(paramMap); |
| | | |
| | | String apiUrl = ServiceConstant.SERVICE_API_URL + "/api/app.listApps" + mapToUrlParam(paramIn); |
| | | |
| | | |
| | | ResponseEntity<String> responseEntity = this.callCenterService(restTemplate, pd, "", |
| | | apiUrl, |
| | | HttpMethod.GET); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.service; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 添加服务接口 |
| | | * |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | public interface IAddServiceSMO { |
| | | |
| | | /** |
| | | * 添加服务 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | ResponseEntity<String> saveService(IPageData pd); |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.service; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 添加服务接口 |
| | | * |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | public interface IDeleteServiceSMO { |
| | | |
| | | /** |
| | | * 添加服务 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | ResponseEntity<String> deleteService(IPageData pd); |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.service; |
| | | |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 修改服务接口 |
| | | * |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | public interface IEditServiceSMO { |
| | | |
| | | /** |
| | | * 修改小区 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象 |
| | | */ |
| | | ResponseEntity<String> updateService(IPageData pd); |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.service; |
| | | |
| | | import com.java110.common.exception.SMOException; |
| | | import com.java110.core.context.IPageData; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 服务管理服务接口类 |
| | | * |
| | | * add by wuxw 2019-06-29 |
| | | */ |
| | | public interface IListServicesSMO { |
| | | |
| | | /** |
| | | * 查询服务信息 |
| | | * @param pd 页面数据封装 |
| | | * @return ResponseEntity 对象数据 |
| | | * @throws SMOException 业务代码层 |
| | | */ |
| | | ResponseEntity<String> listServices(IPageData pd) throws SMOException; |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.PrivilegeCodeConstant; |
| | | import com.java110.common.constant.ServiceConstant; |
| | | import com.java110.common.util.Assert; |
| | | import org.springframework.web.client.RestTemplate; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.core.AbstractComponentSMO; |
| | | import com.java110.web.smo.service.IAddServiceSMO; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | |
| | | /** |
| | | * 添加小区服务实现类 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Service("addServiceSMOImpl") |
| | | public class AddServiceSMOImpl extends AbstractComponentSMO implements IAddServiceSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | |
| | | //super.validatePageInfo(pd); |
| | | |
| | | //Assert.hasKeyAndValue(paramIn, "xxx", "xxx"); |
| | | Assert.hasKeyAndValue(paramIn, "name", "必填,请填写服务名称"); |
| | | Assert.hasKeyAndValue(paramIn, "serviceCode", "必填,请填写服务编码如 service.saveService"); |
| | | Assert.hasKeyAndValue(paramIn, "businessTypeCd", "可填,请填写秘钥,如果填写了需要加密传输"); |
| | | Assert.hasKeyAndValue(paramIn, "seq", "必填,请填写序列"); |
| | | Assert.hasKeyAndValue(paramIn, "isInstance", "可填,请填写实例 Y 或N"); |
| | | Assert.hasKeyAndValue(paramIn, "method", "必填,请填写调用方式"); |
| | | Assert.hasKeyAndValue(paramIn, "timeout", "必填,请填写超时时间"); |
| | | Assert.hasKeyAndValue(paramIn, "retryCount", "必填,请填写重试次数"); |
| | | Assert.hasKeyAndValue(paramIn, "provideAppId", "必填,请填写提供服务"); |
| | | |
| | | |
| | | |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_SERVICE); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) { |
| | | ResponseEntity<String> responseEntity = null; |
| | | super.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), |
| | | ServiceConstant.SERVICE_API_URL + "/api/service.saveService", |
| | | HttpMethod.POST); |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> saveService(IPageData pd) { |
| | | return super.businessProcess(pd); |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.PrivilegeCodeConstant; |
| | | import com.java110.common.constant.ServiceConstant; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.core.AbstractComponentSMO; |
| | | import com.java110.web.smo.service.IDeleteServiceSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | /** |
| | | * 添加小区服务实现类 |
| | | * delete by wuxw 2019-06-30 |
| | | */ |
| | | @Service("deleteServiceSMOImpl") |
| | | public class DeleteServiceSMOImpl extends AbstractComponentSMO implements IDeleteServiceSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | |
| | | //super.validatePageInfo(pd); |
| | | |
| | | //Assert.hasKeyAndValue(paramIn, "xxx", "xxx"); |
| | | Assert.hasKeyAndValue(paramIn, "serviceId", "服务ID不能为空"); |
| | | |
| | | |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_SERVICE); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) { |
| | | ResponseEntity<String> responseEntity = null; |
| | | super.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), |
| | | ServiceConstant.SERVICE_API_URL + "/api/service.deleteService", |
| | | HttpMethod.POST); |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> deleteService(IPageData pd) { |
| | | return super.businessProcess(pd); |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.PrivilegeCodeConstant; |
| | | import com.java110.common.constant.ServiceConstant; |
| | | import com.java110.common.util.Assert; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.web.core.AbstractComponentSMO; |
| | | import com.java110.web.smo.service.IEditServiceSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | /** |
| | | * 添加服务服务实现类 |
| | | * add by wuxw 2019-06-30 |
| | | */ |
| | | @Service("eidtServiceSMOImpl") |
| | | public class EditServiceSMOImpl extends AbstractComponentSMO implements IEditServiceSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | |
| | | //super.validatePageInfo(pd); |
| | | |
| | | Assert.hasKeyAndValue(paramIn, "serviceId", "服务ID不能为空"); |
| | | Assert.hasKeyAndValue(paramIn, "name", "必填,请填写服务名称"); |
| | | Assert.hasKeyAndValue(paramIn, "serviceCode", "必填,请填写服务编码如 service.saveService"); |
| | | Assert.hasKeyAndValue(paramIn, "businessTypeCd", "可填,请填写秘钥,如果填写了需要加密传输"); |
| | | Assert.hasKeyAndValue(paramIn, "seq", "必填,请填写序列"); |
| | | Assert.hasKeyAndValue(paramIn, "isInstance", "可填,请填写实例 Y 或N"); |
| | | Assert.hasKeyAndValue(paramIn, "method", "必填,请填写调用方式"); |
| | | Assert.hasKeyAndValue(paramIn, "timeout", "必填,请填写超时时间"); |
| | | Assert.hasKeyAndValue(paramIn, "retryCount", "必填,请填写重试次数"); |
| | | Assert.hasKeyAndValue(paramIn, "provideAppId", "必填,请填写提供服务"); |
| | | |
| | | |
| | | |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_SERVICE); |
| | | |
| | | } |
| | | |
| | | @Override |
| | | protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) { |
| | | ResponseEntity<String> responseEntity = null; |
| | | super.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | |
| | | responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(), |
| | | ServiceConstant.SERVICE_API_URL + "/api/service.updateService", |
| | | HttpMethod.POST); |
| | | return responseEntity; |
| | | } |
| | | |
| | | @Override |
| | | public ResponseEntity<String> updateService(IPageData pd) { |
| | | return super.businessProcess(pd); |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.web.smo.service.impl; |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.java110.common.constant.PrivilegeCodeConstant; |
| | | import com.java110.common.constant.ServiceConstant; |
| | | import com.java110.common.exception.SMOException; |
| | | import com.java110.common.util.BeanConvertUtil; |
| | | import com.java110.core.context.IPageData; |
| | | import com.java110.entity.component.ComponentValidateResult; |
| | | import com.java110.web.core.AbstractComponentSMO; |
| | | import com.java110.web.smo.service.IListServicesSMO; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.web.client.RestTemplate; |
| | | |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 查询service服务类 |
| | | */ |
| | | @Service("listServicesSMOImpl") |
| | | public class ListServicesSMOImpl extends AbstractComponentSMO implements IListServicesSMO { |
| | | |
| | | @Autowired |
| | | private RestTemplate restTemplate; |
| | | |
| | | @Override |
| | | public ResponseEntity<String> listServices(IPageData pd) throws SMOException { |
| | | return businessProcess(pd); |
| | | } |
| | | |
| | | @Override |
| | | protected void validate(IPageData pd, JSONObject paramIn) { |
| | | |
| | | super.validatePageInfo(pd); |
| | | |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_SERVICE); |
| | | } |
| | | |
| | | @Override |
| | | protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) { |
| | | ComponentValidateResult result = super.validateStoreStaffCommunityRelationship(pd, restTemplate); |
| | | |
| | | Map paramMap = BeanConvertUtil.beanCovertMap(result); |
| | | paramIn.putAll(paramMap); |
| | | |
| | | String apiUrl = ServiceConstant.SERVICE_API_URL + "/api/service.listServices" + mapToUrlParam(paramIn); |
| | | |
| | | |
| | | ResponseEntity<String> responseEntity = this.callCenterService(restTemplate, pd, "", |
| | | apiUrl, |
| | | HttpMethod.GET); |
| | | |
| | | return responseEntity; |
| | | } |
| | | |
| | | public RestTemplate getRestTemplate() { |
| | | return restTemplate; |
| | | } |
| | | |
| | | public void setRestTemplate(RestTemplate restTemplate) { |
| | | this.restTemplate = restTemplate; |
| | | } |
| | | } |
| New file |
| | |
| | | <div id = "addAppModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" > |
| | | <div class="modal-dialog modal-lg"> |
| | | <div class="modal-content"> |
| | | <div class="modal-body"> |
| | | <h3 class="m-t-none m-b ">添加应用</h3> |
| | | <div class="ibox-content"> |
| | | <div> |
| | | <div> |
| | | <!--<div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">楼名称</label> |
| | | <div class="col-sm-10"><input v-model="addFloorInfo.name" type="text" placeholder="必填,请填写名称" class="form-control"></div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">楼编号</label> |
| | | <div class="col-sm-10"><input v-model="addFloorInfo.floorNum" type="email" placeholder="必填,请填写编号" class="form-control"></div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">备注</label> |
| | | <div class="col-sm-10"><input v-model="addFloorInfo.remark" type="tel" placeholder="可填,请填写备注" class="form-control"></div> |
| | | </div>--> |
| | | |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">应用名称</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addAppInfo.name" type="text" placeholder="必填,请填写应用名称" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">秘钥</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addAppInfo.securityCode" type="text" placeholder="选填,请填写秘钥" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">白名单</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addAppInfo.whileListIp" type="text" placeholder="选填,请填写白名单" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">黑名单</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addAppInfo.blackListIp" type="text" placeholder="选填,请填写黑名单" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">备注</label> |
| | | <div class="col-sm-10"> |
| | | <textarea placeholder="选填,请填写备注" class="form-control" v-model="addAppInfo.remark"></textarea> </div> |
| | | </div> |
| | | |
| | | <div class="ibox-content"> |
| | | <button class="btn btn-primary float-right" type="button" v-on:click="saveAppInfo()" ><i class="fa fa-check"></i> 保存</button> |
| | | <button type="button" class="btn btn-warning float-right" style="margin-right:20px;" data-dismiss="modal">取消</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | (function(vc){ |
| | | |
| | | vc.extends({ |
| | | data:{ |
| | | addAppInfo:{ |
| | | name:'', |
| | | securityCode:'', |
| | | whileListIp:'', |
| | | blackListIp:'', |
| | | remark:'', |
| | | |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('addApp','openAddAppModal',function(){ |
| | | $('#addAppModel').modal('show'); |
| | | }); |
| | | }, |
| | | methods:{ |
| | | addAppValidate(){ |
| | | return vc.validate.validate({ |
| | | addAppInfo:vc.component.addAppInfo |
| | | },{ |
| | | 'addAppInfo.name':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"应用名称不能为空" |
| | | }, |
| | | { |
| | | limit:"maxin", |
| | | param:"2,50", |
| | | errInfo:"应用名称必须在2至50字符之间" |
| | | }, |
| | | ], |
| | | 'addAppInfo.securityCode':[ |
| | | { |
| | | limit:"maxLength", |
| | | param:"64", |
| | | errInfo:"秘钥太长超过64位" |
| | | }, |
| | | ], |
| | | 'addAppInfo.whileListIp':[ |
| | | { |
| | | limit:"maxLength", |
| | | param:"200", |
| | | errInfo:"白名单内容不能超过200" |
| | | }, |
| | | ], |
| | | 'addAppInfo.blackListIp':[ |
| | | { |
| | | limit:"maxLength", |
| | | param:"200", |
| | | errInfo:"黑名单内容不能超过200" |
| | | }, |
| | | ], |
| | | 'addAppInfo.remark':[ |
| | | { |
| | | limit:"maxLength", |
| | | param:"200", |
| | | errInfo:"备注内容不能超过200" |
| | | }, |
| | | ], |
| | | |
| | | |
| | | |
| | | |
| | | }); |
| | | }, |
| | | saveAppInfo:function(){ |
| | | if(!vc.component.addAppValidate()){ |
| | | vc.message(vc.validate.errInfo); |
| | | |
| | | return ; |
| | | } |
| | | |
| | | vc.component.addAppInfo.communityId = vc.getCurrentCommunity().communityId; |
| | | |
| | | vc.http.post( |
| | | 'addApp', |
| | | 'save', |
| | | JSON.stringify(vc.component.addAppInfo), |
| | | { |
| | | emulateJSON:true |
| | | }, |
| | | function(json,res){ |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if(res.status == 200){ |
| | | //关闭model |
| | | $('#addAppModel').modal('hide'); |
| | | vc.component.clearAddAppInfo(); |
| | | vc.emit('appManage','listApp',{}); |
| | | |
| | | return ; |
| | | } |
| | | vc.message(json); |
| | | |
| | | }, |
| | | function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | |
| | | vc.message(errInfo); |
| | | |
| | | }); |
| | | }, |
| | | clearAddAppInfo:function(){ |
| | | vc.component.addAppInfo = { |
| | | name:'', |
| | | securityCode:'', |
| | | whileListIp:'', |
| | | blackListIp:'', |
| | | remark:'', |
| | | |
| | | }; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | })(window.vc); |
| New file |
| | |
| | | <div id = "addServiceModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" > |
| | | <div class="modal-dialog modal-lg"> |
| | | <div class="modal-content"> |
| | | <div class="modal-body"> |
| | | <h3 class="m-t-none m-b ">添加服务</h3> |
| | | <div class="ibox-content"> |
| | | <div> |
| | | <div> |
| | | <!--<div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">楼名称</label> |
| | | <div class="col-sm-10"><input v-model="addFloorInfo.name" type="text" placeholder="必填,请填写名称" class="form-control"></div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">楼编号</label> |
| | | <div class="col-sm-10"><input v-model="addFloorInfo.floorNum" type="email" placeholder="必填,请填写编号" class="form-control"></div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">备注</label> |
| | | <div class="col-sm-10"><input v-model="addFloorInfo.remark" type="tel" placeholder="可填,请填写备注" class="form-control"></div> |
| | | </div>--> |
| | | |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">服务名称</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addServiceInfo.name" type="text" placeholder="必填,请填写服务名称" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">服务编码</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addServiceInfo.serviceCode" type="text" placeholder="必填,请填写服务编码" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">消息队列</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addServiceInfo.messageQueueName" type="text" placeholder="选填,请填写消息队列" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">是否实例</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addServiceInfo.isInstance" type="text" placeholder="必填,请填写是否实例" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">调用地址</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addServiceInfo.url" type="text" placeholder="选填,请填写调用地址" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">调用方式</label> |
| | | <div class="col-sm-10"> |
| | | <select class="custom-select" v-model="addServiceInfo.method"> |
| | | <option selected disabled value="">必填,请选择调用方式</option> |
| | | <option value="GET">http get</option> |
| | | <option value="POST">http post</option> |
| | | </select> </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">超时时间</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addServiceInfo.timeout" type="text" placeholder="必填,请填写超时时间" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">重试次数</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="addServiceInfo.retryCount" type="text" placeholder="必填,请填写重试次数" class="form-control"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="ibox-content"> |
| | | <button class="btn btn-primary float-right" type="button" v-on:click="saveServiceInfo()" ><i class="fa fa-check"></i> 保存</button> |
| | | <button type="button" class="btn btn-warning float-right" style="margin-right:20px;" data-dismiss="modal">取消</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | (function(vc){ |
| | | |
| | | vc.extends({ |
| | | data:{ |
| | | addServiceInfo:{ |
| | | name:'', |
| | | serviceCode:'', |
| | | businessTypeCd:'API', |
| | | seq:'1', |
| | | messageQueueName:'', |
| | | isInstance:'Y', |
| | | url:'http://order-service/orderApi/service', |
| | | method:'', |
| | | timeout:'60', |
| | | retryCount:'3', |
| | | provideAppId:'8000418002', |
| | | |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('addService','openAddServiceModal',function(){ |
| | | $('#addServiceModel').modal('show'); |
| | | }); |
| | | }, |
| | | methods:{ |
| | | addServiceValidate(){ |
| | | return vc.validate.validate({ |
| | | addServiceInfo:vc.component.addServiceInfo |
| | | },{ |
| | | 'addServiceInfo.name':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"服务名称不能为空" |
| | | }, |
| | | { |
| | | limit:"maxLength", |
| | | param:"50", |
| | | errInfo:"服务名称不能超过50" |
| | | }, |
| | | ], |
| | | 'addServiceInfo.serviceCode':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"服务编码不能为空" |
| | | }, |
| | | { |
| | | limit:"maxin", |
| | | param:"2,50", |
| | | errInfo:"服务编码必须在2至50字符之间" |
| | | }, |
| | | ], |
| | | 'addServiceInfo.businessTypeCd':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"秘钥不能为空" |
| | | }, |
| | | { |
| | | limit:"maxin", |
| | | param:"2,4", |
| | | errInfo:"业务类型必须为API" |
| | | }, |
| | | ], |
| | | 'addServiceInfo.seq':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"序列不能为空" |
| | | }, |
| | | { |
| | | limit:"maxLength", |
| | | param:"1", |
| | | errInfo:"序列格式错误" |
| | | }, |
| | | ], |
| | | 'addServiceInfo.messageQueueName':[ |
| | | { |
| | | limit:"maxLength", |
| | | param:"50", |
| | | errInfo:"消息队列不能超过50" |
| | | }, |
| | | ], |
| | | 'addServiceInfo.isInstance':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"是否实例不能为空" |
| | | }, |
| | | { |
| | | limit:"maxLength", |
| | | param:"50", |
| | | errInfo:"实例不能超过50" |
| | | }, |
| | | ], |
| | | 'addServiceInfo.url':[ |
| | | { |
| | | limit:"maxLength", |
| | | param:"200", |
| | | errInfo:"调用地址不能超过200" |
| | | }, |
| | | ], |
| | | 'addServiceInfo.method':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"调用方式不能为空" |
| | | }, |
| | | { |
| | | limit:"maxLength", |
| | | param:"50", |
| | | errInfo:"调用方式不能超过50" |
| | | }, |
| | | ], |
| | | 'addServiceInfo.timeout':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"超时时间不能为空" |
| | | }, |
| | | { |
| | | limit:"num", |
| | | param:"", |
| | | errInfo:"超时时间必须为数字" |
| | | }, |
| | | ], |
| | | 'addServiceInfo.retryCount':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"重试次数不能为空" |
| | | }, |
| | | { |
| | | limit:"num", |
| | | param:"", |
| | | errInfo:"重试次数必须为数字" |
| | | }, |
| | | ], |
| | | 'addServiceInfo.provideAppId':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"提供服务不能为空" |
| | | }, |
| | | { |
| | | limit:"num", |
| | | param:"", |
| | | errInfo:"重试次数必须为数字" |
| | | }, |
| | | ], |
| | | |
| | | |
| | | |
| | | |
| | | }); |
| | | }, |
| | | saveServiceInfo:function(){ |
| | | if(!vc.component.addServiceValidate()){ |
| | | vc.message(vc.validate.errInfo); |
| | | |
| | | return ; |
| | | } |
| | | |
| | | vc.component.addServiceInfo.communityId = vc.getCurrentCommunity().communityId; |
| | | |
| | | vc.http.post( |
| | | 'addService', |
| | | 'save', |
| | | JSON.stringify(vc.component.addServiceInfo), |
| | | { |
| | | emulateJSON:true |
| | | }, |
| | | function(json,res){ |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if(res.status == 200){ |
| | | //关闭model |
| | | $('#addServiceModel').modal('hide'); |
| | | vc.component.clearAddServiceInfo(); |
| | | vc.emit('serviceManage','listService',{}); |
| | | |
| | | return ; |
| | | } |
| | | vc.message(json); |
| | | |
| | | }, |
| | | function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | |
| | | vc.message(errInfo); |
| | | |
| | | }); |
| | | }, |
| | | clearAddServiceInfo:function(){ |
| | | vc.component.addServiceInfo = { |
| | | name:'', |
| | | serviceCode:'', |
| | | businessTypeCd:'API', |
| | | seq:'1', |
| | | messageQueueName:'', |
| | | isInstance:'Y', |
| | | url:'http://order-service/orderApi/service', |
| | | method:'', |
| | | timeout:'60', |
| | | retryCount:'3', |
| | | provideAppId:'8000418002', |
| | | |
| | | }; |
| | | } |
| | | } |
| | | }); |
| | | |
| | | })(window.vc); |
| New file |
| | |
| | | <div id="component" class="wrapper wrapper-content animated fadeInRight ecommerce"> |
| | | <div class="row"> |
| | | <div class="col-lg-12"> |
| | | <div class="ibox"> |
| | | <div class="ibox-title"> |
| | | <h5>应用信息</h5> |
| | | <div class="ibox-tools" style="top:10px;"> |
| | | <button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddAppModal()"> |
| | | <i class="glyphicon glyphicon-plus"></i> |
| | | 添加应用 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | |
| | | <table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15"> |
| | | <thead> |
| | | <tr> |
| | | <th>应用Id</th> |
| | | <th>应用名称</th> |
| | | <th>秘钥</th> |
| | | <th>白名单</th> |
| | | <th>黑名单</th> |
| | | <th>备注</th> |
| | | <th class="text-right">操作</th> |
| | | |
| | | |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <tr v-for="app in appManageInfo.apps"> |
| | | <td>{{app.appId}}</td> |
| | | <td>{{app.name}}</td> |
| | | <td>{{app.securityCode}}</td> |
| | | <td>{{app.whileListIp}}</td> |
| | | <td>{{app.blackListIp}}</td> |
| | | <td>{{app.remark}}</td> |
| | | <td><div class="btn-group"> |
| | | <button class="btn-white btn btn-xs" v-on:click="_openEditAppModel(app)">修改</button> |
| | | </div> |
| | | <div class="btn-group"> |
| | | <button class="btn-white btn btn-xs" v-on:click="_openDeleteAppModel(app)">删除</button> |
| | | </div></td> |
| | | |
| | | </tr> |
| | | </tbody> |
| | | <tfoot> |
| | | <tr> |
| | | <td colspan="7"> |
| | | <ul class="pagination float-right"></ul> |
| | | </td> |
| | | </tr> |
| | | </tfoot> |
| | | </table> |
| | | <!-- 分页 --> |
| | | <vc:create name="pagination"></vc:create> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <vc:create name="addApp"></vc:create> |
| | | <vc:create name="editApp"></vc:create> |
| | | <vc:create name="deleteApp"></vc:create> |
| | | |
| | | </div> |
| New file |
| | |
| | | /** |
| | | 入驻小区 |
| | | **/ |
| | | (function(vc){ |
| | | var DEFAULT_PAGE = 1; |
| | | var DEFAULT_ROWS = 10; |
| | | vc.extends({ |
| | | data:{ |
| | | appManageInfo:{ |
| | | apps:[], |
| | | total:0, |
| | | records:1 |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | vc.component._listApps(DEFAULT_PAGE, DEFAULT_ROWS); |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('appManage','listApp',function(_param){ |
| | | vc.component._listApps(DEFAULT_PAGE, DEFAULT_ROWS); |
| | | }); |
| | | vc.on('pagination','page_event',function(_currentPage){ |
| | | vc.component._listApps(_currentPage,DEFAULT_ROWS); |
| | | }); |
| | | }, |
| | | methods:{ |
| | | _listApps:function(_page, _rows){ |
| | | var param = { |
| | | params:{ |
| | | page:_page, |
| | | row:_rows |
| | | } |
| | | |
| | | } |
| | | //发送get请求 |
| | | vc.http.get('appManage', |
| | | 'list', |
| | | param, |
| | | function(json,res){ |
| | | var _appManageInfo=JSON.parse(json); |
| | | vc.component.appManageInfo.total = _appManageInfo.total; |
| | | vc.component.appManageInfo.records = _appManageInfo.records; |
| | | vc.component.appManageInfo.apps = _appManageInfo.apps; |
| | | vc.emit('pagination','init',{ |
| | | total:vc.component.appManageInfo.records, |
| | | currentPage:_page |
| | | }); |
| | | },function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | } |
| | | ); |
| | | }, |
| | | _openAddAppModal:function(){ |
| | | vc.emit('addApp','openAddAppModal',{}); |
| | | }, |
| | | _openEditAppModel:function(_app){ |
| | | vc.emit('editApp','openEditAppModal',_app); |
| | | }, |
| | | _openDeleteAppModel:function(_app){ |
| | | vc.emit('deleteApp','openDeleteAppModal',_app); |
| | | } |
| | | } |
| | | }); |
| | | })(window.vc); |
| New file |
| | |
| | | <div class="modal fade" id="deleteAppModel" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> |
| | | <div class="modal-dialog" role="document"> |
| | | <div class="modal-content"> |
| | | <div class="modal-header"> |
| | | <h5 class="modal-title" id="exampleModalLabel">请确认您的操作!</h5> |
| | | <button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
| | | <span aria-hidden="true">×</span> |
| | | </button> |
| | | </div> |
| | | <div class="modal-body"> |
| | | <tr align="center"><th>确定删除应用</th></tr> |
| | | </div> |
| | | <div class="modal-footer"> |
| | | <button type="button" class="btn btn-secondary" data-dismiss="modal" v-on:click="closeDeleteAppModel()">点错了</button> |
| | | <button type="button" class="btn btn-primary" v-on:click="deleteApp()">确认删除</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | (function(vc,vm){ |
| | | |
| | | vc.extends({ |
| | | data:{ |
| | | deleteAppInfo:{ |
| | | |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('deleteApp','openDeleteAppModal',function(_params){ |
| | | |
| | | vc.component.deleteAppInfo = _params; |
| | | $('#deleteAppModel').modal('show'); |
| | | |
| | | }); |
| | | }, |
| | | methods:{ |
| | | deleteApp:function(){ |
| | | vc.component.deleteAppInfo.communityId=vc.getCurrentCommunity().communityId; |
| | | vc.http.post( |
| | | 'deleteApp', |
| | | 'delete', |
| | | JSON.stringify(vc.component.deleteAppInfo), |
| | | { |
| | | emulateJSON:true |
| | | }, |
| | | function(json,res){ |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if(res.status == 200){ |
| | | //关闭model |
| | | $('#deleteAppModel').modal('hide'); |
| | | vc.emit('appManage','listApp',{}); |
| | | return ; |
| | | } |
| | | vc.message(json); |
| | | }, |
| | | function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | vc.message(json); |
| | | |
| | | }); |
| | | }, |
| | | closeDeleteAppModel:function(){ |
| | | $('#deleteAppModel').modal('hide'); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | })(window.vc,window.vc.component); |
| New file |
| | |
| | | <div class="modal fade" id="deleteServiceModel" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true"> |
| | | <div class="modal-dialog" role="document"> |
| | | <div class="modal-content"> |
| | | <div class="modal-header"> |
| | | <h5 class="modal-title" id="exampleModalLabel">请确认您的操作!</h5> |
| | | <button type="button" class="close" data-dismiss="modal" aria-label="Close"> |
| | | <span aria-hidden="true">×</span> |
| | | </button> |
| | | </div> |
| | | <div class="modal-body"> |
| | | <tr align="center"><th>确定删除服务</th></tr> |
| | | </div> |
| | | <div class="modal-footer"> |
| | | <button type="button" class="btn btn-secondary" data-dismiss="modal" v-on:click="closeDeleteServiceModel()">点错了</button> |
| | | <button type="button" class="btn btn-primary" v-on:click="deleteService()">确认删除</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | (function(vc,vm){ |
| | | |
| | | vc.extends({ |
| | | data:{ |
| | | deleteServiceInfo:{ |
| | | |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('deleteService','openDeleteServiceModal',function(_params){ |
| | | |
| | | vc.component.deleteServiceInfo = _params; |
| | | $('#deleteServiceModel').modal('show'); |
| | | |
| | | }); |
| | | }, |
| | | methods:{ |
| | | deleteService:function(){ |
| | | vc.component.deleteServiceInfo.communityId=vc.getCurrentCommunity().communityId; |
| | | vc.http.post( |
| | | 'deleteService', |
| | | 'delete', |
| | | JSON.stringify(vc.component.deleteServiceInfo), |
| | | { |
| | | emulateJSON:true |
| | | }, |
| | | function(json,res){ |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if(res.status == 200){ |
| | | //关闭model |
| | | $('#deleteServiceModel').modal('hide'); |
| | | vc.emit('serviceManage','listService',{}); |
| | | return ; |
| | | } |
| | | vc.message(json); |
| | | }, |
| | | function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | vc.message(json); |
| | | |
| | | }); |
| | | }, |
| | | closeDeleteServiceModel:function(){ |
| | | $('#deleteServiceModel').modal('hide'); |
| | | } |
| | | } |
| | | }); |
| | | |
| | | })(window.vc,window.vc.component); |
| New file |
| | |
| | | <div id = "editAppModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" > |
| | | <div class="modal-dialog modal-lg"> |
| | | <div class="modal-content"> |
| | | <div class="modal-body"> |
| | | <h3 class="m-t-none m-b ">修改应用</h3> |
| | | <div class="ibox-content"> |
| | | <div> |
| | | <div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">应用名称</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="editAppInfo.name" type="text" placeholder="必填,请填写应用名称" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">秘钥</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="editAppInfo.securityCode" type="text" placeholder="选填,请填写秘钥" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">白名单</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="editAppInfo.whileListIp" type="text" placeholder="选填,请填写白名单" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">黑名单</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="editAppInfo.blackListIp" type="text" placeholder="选填,请填写黑名单" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">备注</label> |
| | | <div class="col-sm-10"> |
| | | <textarea placeholder="选填,请填写备注" class="form-control" v-model="editAppInfo.remark"></textarea> </div> |
| | | </div> |
| | | |
| | | <div class="ibox-content"> |
| | | <button class="btn btn-primary float-right" type="button" v-on:click="editApp()" ><i class="fa fa-check"></i> 保存</button> |
| | | <button type="button" class="btn btn-warning float-right" style="margin-right:20px;" data-dismiss="modal">取消</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | (function(vc,vm){ |
| | | |
| | | vc.extends({ |
| | | data:{ |
| | | editAppInfo:{ |
| | | appId:'', |
| | | name:'', |
| | | securityCode:'', |
| | | whileListIp:'', |
| | | blackListIp:'', |
| | | remark:'', |
| | | |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('editApp','openEditAppModal',function(_params){ |
| | | vc.component.refreshEditAppInfo(); |
| | | $('#editAppModel').modal('show'); |
| | | vc.component.editAppInfo = _params; |
| | | vc.component.editAppInfo.communityId = vc.getCurrentCommunity().communityId; |
| | | }); |
| | | }, |
| | | methods:{ |
| | | editAppValidate:function(){ |
| | | return vc.validate.validate({ |
| | | editAppInfo:vc.component.editAppInfo |
| | | },{ |
| | | 'editAppInfo.name':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"应用名称不能为空" |
| | | }, |
| | | { |
| | | limit:"maxin", |
| | | param:"2,50", |
| | | errInfo:"应用名称必须在2至50字符之间" |
| | | }, |
| | | ], |
| | | 'editAppInfo.securityCode':[ |
| | | { |
| | | limit:"maxLength", |
| | | param:"64", |
| | | errInfo:"秘钥太长超过64位" |
| | | }, |
| | | ], |
| | | 'editAppInfo.whileListIp':[ |
| | | { |
| | | limit:"maxLength", |
| | | param:"200", |
| | | errInfo:"白名单内容不能超过200" |
| | | }, |
| | | ], |
| | | 'editAppInfo.blackListIp':[ |
| | | { |
| | | limit:"maxLength", |
| | | param:"200", |
| | | errInfo:"黑名单内容不能超过200" |
| | | }, |
| | | ], |
| | | 'editAppInfo.remark':[ |
| | | { |
| | | limit:"maxLength", |
| | | param:"200", |
| | | errInfo:"备注内容不能超过200" |
| | | }, |
| | | ], |
| | | 'editAppInfo.appId':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"应用Id不能为空" |
| | | }] |
| | | |
| | | }); |
| | | }, |
| | | editApp:function(){ |
| | | if(!vc.component.editAppValidate()){ |
| | | vc.message(vc.validate.errInfo); |
| | | return ; |
| | | } |
| | | |
| | | vc.http.post( |
| | | 'editApp', |
| | | 'update', |
| | | JSON.stringify(vc.component.editAppInfo), |
| | | { |
| | | emulateJSON:true |
| | | }, |
| | | function(json,res){ |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if(res.status == 200){ |
| | | //关闭model |
| | | $('#editAppModel').modal('hide'); |
| | | vc.emit('appManage','listApp',{}); |
| | | return ; |
| | | } |
| | | vc.message(json); |
| | | }, |
| | | function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | |
| | | vc.message(errInfo); |
| | | }); |
| | | }, |
| | | refreshEditAppInfo:function(){ |
| | | vc.component.editAppInfo= { |
| | | appId:'', |
| | | name:'', |
| | | securityCode:'', |
| | | whileListIp:'', |
| | | blackListIp:'', |
| | | remark:'', |
| | | |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | })(window.vc,window.vc.component); |
| New file |
| | |
| | | <div id = "editServiceModel" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true" > |
| | | <div class="modal-dialog modal-lg"> |
| | | <div class="modal-content"> |
| | | <div class="modal-body"> |
| | | <h3 class="m-t-none m-b ">修改服务</h3> |
| | | <div class="ibox-content"> |
| | | <div> |
| | | <div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">服务名称</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="editServiceInfo.name" type="text" placeholder="必填,请填写服务名称" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">服务编码</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="editServiceInfo.serviceCode" type="text" placeholder="必填,请填写服务编码" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">消息队列</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="editServiceInfo.messageQueueName" type="text" placeholder="选填,请填写消息队列" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">是否实例</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="editServiceInfo.isInstance" type="text" placeholder="必填,请填写是否实例" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">调用地址</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="editServiceInfo.url" type="text" placeholder="选填,请填写调用地址" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">调用方式</label> |
| | | <div class="col-sm-10"> |
| | | <select class="custom-select" v-model="editServiceInfo.method"> |
| | | <option selected disabled value="">必填,请选择调用方式</option> |
| | | <option value="GET">http get</option> |
| | | <option value="POST">http post</option> |
| | | </select> </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">超时时间</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="editServiceInfo.timeout" type="text" placeholder="必填,请填写超时时间" class="form-control"> |
| | | </div> |
| | | </div> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">重试次数</label> |
| | | <div class="col-sm-10"> |
| | | <input v-model="editServiceInfo.retryCount" type="text" placeholder="必填,请填写重试次数" class="form-control"> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="ibox-content"> |
| | | <button class="btn btn-primary float-right" type="button" v-on:click="editService()" ><i class="fa fa-check"></i> 保存</button> |
| | | <button type="button" class="btn btn-warning float-right" style="margin-right:20px;" data-dismiss="modal">取消</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| New file |
| | |
| | | (function(vc,vm){ |
| | | |
| | | vc.extends({ |
| | | data:{ |
| | | editServiceInfo:{ |
| | | serviceId:'', |
| | | name:'', |
| | | serviceCode:'', |
| | | businessTypeCd:'API', |
| | | seq:'1', |
| | | messageQueueName:'', |
| | | isInstance:'Y', |
| | | url:'http://order-service/orderApi/service', |
| | | method:'', |
| | | timeout:'60', |
| | | retryCount:'3', |
| | | provideAppId:'8000418002', |
| | | |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('editService','openEditServiceModal',function(_params){ |
| | | vc.component.refreshEditServiceInfo(); |
| | | $('#editServiceModel').modal('show'); |
| | | vc.copyObject(_params, vc.component.editServiceInfo); |
| | | vc.component.editServiceInfo.communityId = vc.getCurrentCommunity().communityId; |
| | | }); |
| | | }, |
| | | methods:{ |
| | | editServiceValidate:function(){ |
| | | return vc.validate.validate({ |
| | | editServiceInfo:vc.component.editServiceInfo |
| | | },{ |
| | | 'editServiceInfo.name':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"服务名称不能为空" |
| | | }, |
| | | { |
| | | limit:"maxLength", |
| | | param:"50", |
| | | errInfo:"服务名称不能超过50" |
| | | }, |
| | | ], |
| | | 'editServiceInfo.serviceCode':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"服务编码不能为空" |
| | | }, |
| | | { |
| | | limit:"maxin", |
| | | param:"2,50", |
| | | errInfo:"服务编码必须在2至50字符之间" |
| | | }, |
| | | ], |
| | | 'editServiceInfo.businessTypeCd':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"秘钥不能为空" |
| | | }, |
| | | { |
| | | limit:"maxin", |
| | | param:"2,4", |
| | | errInfo:"业务类型必须为API" |
| | | }, |
| | | ], |
| | | 'editServiceInfo.seq':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"序列不能为空" |
| | | }, |
| | | { |
| | | limit:"maxLength", |
| | | param:"1", |
| | | errInfo:"序列格式错误" |
| | | }, |
| | | ], |
| | | 'editServiceInfo.messageQueueName':[ |
| | | { |
| | | limit:"maxLength", |
| | | param:"50", |
| | | errInfo:"消息队列不能超过50" |
| | | }, |
| | | ], |
| | | 'editServiceInfo.isInstance':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"是否实例不能为空" |
| | | }, |
| | | { |
| | | limit:"maxLength", |
| | | param:"50", |
| | | errInfo:"实例不能超过50" |
| | | }, |
| | | ], |
| | | 'editServiceInfo.url':[ |
| | | { |
| | | limit:"maxLength", |
| | | param:"200", |
| | | errInfo:"调用地址不能超过200" |
| | | }, |
| | | ], |
| | | 'editServiceInfo.method':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"调用方式不能为空" |
| | | }, |
| | | { |
| | | limit:"maxLength", |
| | | param:"50", |
| | | errInfo:"调用方式不能超过50" |
| | | }, |
| | | ], |
| | | 'editServiceInfo.timeout':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"超时时间不能为空" |
| | | }, |
| | | { |
| | | limit:"num", |
| | | param:"", |
| | | errInfo:"超时时间必须为数字" |
| | | }, |
| | | ], |
| | | 'editServiceInfo.retryCount':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"重试次数不能为空" |
| | | }, |
| | | { |
| | | limit:"num", |
| | | param:"", |
| | | errInfo:"重试次数必须为数字" |
| | | }, |
| | | ], |
| | | 'editServiceInfo.provideAppId':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"提供服务不能为空" |
| | | }, |
| | | { |
| | | limit:"num", |
| | | param:"", |
| | | errInfo:"重试次数必须为数字" |
| | | }, |
| | | ], |
| | | 'editServiceInfo.serviceId':[ |
| | | { |
| | | limit:"required", |
| | | param:"", |
| | | errInfo:"服务ID不能为空" |
| | | }] |
| | | |
| | | }); |
| | | }, |
| | | editService:function(){ |
| | | if(!vc.component.editServiceValidate()){ |
| | | vc.message(vc.validate.errInfo); |
| | | return ; |
| | | } |
| | | |
| | | vc.http.post( |
| | | 'editService', |
| | | 'update', |
| | | JSON.stringify(vc.component.editServiceInfo), |
| | | { |
| | | emulateJSON:true |
| | | }, |
| | | function(json,res){ |
| | | //vm.menus = vm.refreshMenuActive(JSON.parse(json),0); |
| | | if(res.status == 200){ |
| | | //关闭model |
| | | $('#editServiceModel').modal('hide'); |
| | | vc.emit('serviceManage','listService',{}); |
| | | return ; |
| | | } |
| | | vc.message(json); |
| | | }, |
| | | function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | |
| | | vc.message(errInfo); |
| | | }); |
| | | }, |
| | | refreshEditServiceInfo:function(){ |
| | | vc.component.editServiceInfo= { |
| | | serviceId:'', |
| | | name:'', |
| | | serviceCode:'', |
| | | businessTypeCd:'API', |
| | | seq:'1', |
| | | messageQueueName:'', |
| | | isInstance:'Y', |
| | | url:'http://order-service/orderApi/service', |
| | | method:'', |
| | | timeout:'60', |
| | | retryCount:'3', |
| | | provideAppId:'8000418002', |
| | | |
| | | } |
| | | } |
| | | } |
| | | }); |
| | | |
| | | })(window.vc,window.vc.component); |
| New file |
| | |
| | | <div id="component" class="wrapper wrapper-content animated fadeInRight ecommerce"> |
| | | <div class="row"> |
| | | <div class="col-lg-12"> |
| | | <div class="ibox"> |
| | | <div class="ibox-title"> |
| | | <h5>服务信息</h5> |
| | | <div class="ibox-tools" style="top:10px;"> |
| | | <button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddServiceModal()"> |
| | | <i class="glyphicon glyphicon-plus"></i> |
| | | 添加服务 |
| | | </button> |
| | | </div> |
| | | </div> |
| | | <div class="ibox-content"> |
| | | |
| | | <table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15"> |
| | | <thead> |
| | | <tr> |
| | | <th>服务ID</th> |
| | | <th>服务名称</th> |
| | | <th>服务编码</th> |
| | | <th>秘钥</th> |
| | | <th>序列</th> |
| | | <th>消息队列</th> |
| | | <th>是否实例</th> |
| | | <th>调用地址</th> |
| | | <th>调用方式</th> |
| | | <th>超时时间</th> |
| | | <th>重试次数</th> |
| | | <th>提供服务</th> |
| | | <th class="text-right">操作</th> |
| | | |
| | | |
| | | </tr> |
| | | </thead> |
| | | <tbody> |
| | | <tr v-for="service in serviceManageInfo.services"> |
| | | <td>{{service.serviceId}}</td> |
| | | <td>{{service.name}}</td> |
| | | <td>{{service.serviceCode}}</td> |
| | | <td>{{service.businessTypeCd}}</td> |
| | | <td>{{service.seq}}</td> |
| | | <td>{{service.messageQueueName}}</td> |
| | | <td>{{service.isInstance}}</td> |
| | | <td>{{service.url}}</td> |
| | | <td>{{service.method}}</td> |
| | | <td>{{service.timeout}}</td> |
| | | <td>{{service.retryCount}}</td> |
| | | <td>{{service.provideAppId}}</td> |
| | | <td><div class="btn-group"> |
| | | <button class="btn-white btn btn-xs" v-on:click="_openEditServiceModel(service)">修改</button> |
| | | </div> |
| | | <div class="btn-group"> |
| | | <button class="btn-white btn btn-xs" v-on:click="_openDeleteServiceModel(service)">删除</button> |
| | | </div></td> |
| | | |
| | | </tr> |
| | | </tbody> |
| | | <tfoot> |
| | | <tr> |
| | | <td colspan="7"> |
| | | <ul class="pagination float-right"></ul> |
| | | </td> |
| | | </tr> |
| | | </tfoot> |
| | | </table> |
| | | <!-- 分页 --> |
| | | <vc:create name="pagination"></vc:create> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | <vc:create name="addService"></vc:create> |
| | | <vc:create name="editService"></vc:create> |
| | | <vc:create name="deleteService"></vc:create> |
| | | |
| | | </div> |
| New file |
| | |
| | | /** |
| | | 入驻小区 |
| | | **/ |
| | | (function(vc){ |
| | | var DEFAULT_PAGE = 1; |
| | | var DEFAULT_ROWS = 10; |
| | | vc.extends({ |
| | | data:{ |
| | | serviceManageInfo:{ |
| | | services:[], |
| | | total:0, |
| | | records:1 |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | | vc.component._listServices(DEFAULT_PAGE, DEFAULT_ROWS); |
| | | }, |
| | | _initEvent:function(){ |
| | | vc.on('serviceManage','listService',function(_param){ |
| | | vc.component._listServices(DEFAULT_PAGE, DEFAULT_ROWS); |
| | | }); |
| | | vc.on('pagination','page_event',function(_currentPage){ |
| | | vc.component._listServices(_currentPage,DEFAULT_ROWS); |
| | | }); |
| | | }, |
| | | methods:{ |
| | | _listServices:function(_page, _rows){ |
| | | var param = { |
| | | params:{ |
| | | page:_page, |
| | | row:_rows |
| | | } |
| | | |
| | | } |
| | | //发送get请求 |
| | | vc.http.get('serviceManage', |
| | | 'list', |
| | | param, |
| | | function(json,res){ |
| | | var _serviceManageInfo=JSON.parse(json); |
| | | vc.component.serviceManageInfo.total = _serviceManageInfo.total; |
| | | vc.component.serviceManageInfo.records = _serviceManageInfo.records; |
| | | vc.component.serviceManageInfo.services = _serviceManageInfo.services; |
| | | vc.emit('pagination','init',{ |
| | | total:vc.component.serviceManageInfo.records, |
| | | currentPage:_page |
| | | }); |
| | | },function(errInfo,error){ |
| | | console.log('请求失败处理'); |
| | | } |
| | | ); |
| | | }, |
| | | _openAddServiceModal:function(){ |
| | | vc.emit('addService','openAddServiceModal',{}); |
| | | }, |
| | | _openEditServiceModel:function(_service){ |
| | | vc.emit('editService','openEditServiceModal',_service); |
| | | }, |
| | | _openDeleteServiceModel:function(_service){ |
| | | vc.emit('deleteService','openDeleteServiceModal',_service); |
| | | } |
| | | } |
| | | }); |
| | | })(window.vc); |
| New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en" |
| | | xmlns="http://www.w3.org/1999/xhtml" |
| | | xmlns:th="http://www.thymeleaf.org" |
| | | xmlns:vc="http://www.thymeleaf.org"> |
| | | <head> |
| | | <meta charset="UTF-8"/> |
| | | <title>应用初始化|java110</title> |
| | | <vc:create name="commonTop"></vc:create> |
| | | </head> |
| | | <body> |
| | | <vc:create name="bodyTop"></vc:create> |
| | | <div id="wrapper"> |
| | | <vc:create name="menu"></vc:create> |
| | | |
| | | |
| | | <div id="page-wrapper" class="gray-bg dashbard-1"> |
| | | <div class="row border-bottom"> |
| | | <vc:create name="nav"></vc:create> |
| | | </div> |
| | | <!-- id="component" --> |
| | | <div class="wrapper wrapper-content animated fadeInRight"> |
| | | <vc:create name="appManage"></vc:create> |
| | | </div> |
| | | |
| | | <vc:create name="copyright"></vc:create> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <vc:create name="commonBottom"></vc:create> |
| | | </body> |
| | | </html> |
| New file |
| | |
| | | <!DOCTYPE html> |
| | | <html lang="en" |
| | | xmlns="http://www.w3.org/1999/xhtml" |
| | | xmlns:th="http://www.thymeleaf.org" |
| | | xmlns:vc="http://www.thymeleaf.org"> |
| | | <head> |
| | | <meta charset="UTF-8"/> |
| | | <title>服务初始化|java110</title> |
| | | <vc:create name="commonTop"></vc:create> |
| | | </head> |
| | | <body> |
| | | <vc:create name="bodyTop"></vc:create> |
| | | <div id="wrapper"> |
| | | <vc:create name="menu"></vc:create> |
| | | |
| | | |
| | | <div id="page-wrapper" class="gray-bg dashbard-1"> |
| | | <div class="row border-bottom"> |
| | | <vc:create name="nav"></vc:create> |
| | | </div> |
| | | <!-- id="component" --> |
| | | <div class="wrapper wrapper-content animated fadeInRight"> |
| | | <vc:create name="serviceManage"></vc:create> |
| | | </div> |
| | | |
| | | <vc:create name="copyright"></vc:create> |
| | | |
| | | </div> |
| | | </div> |
| | | |
| | | <vc:create name="commonBottom"></vc:create> |
| | | </body> |
| | | </html> |
| New file |
| | |
| | | package com.java110.dto.app; |
| | | |
| | | import com.java110.dto.PageDto; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName FloorDto |
| | | * @Description 应用数据层封装 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 8:52 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | public class AppDto extends PageDto implements Serializable { |
| | | |
| | | private String appId; |
| | | private String blackListIp; |
| | | private String name; |
| | | private String securityCode; |
| | | private String remark; |
| | | private String userId; |
| | | private String whileListIp; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getAppId() { |
| | | return appId; |
| | | } |
| | | public void setAppId(String appId) { |
| | | this.appId = appId; |
| | | } |
| | | public String getBlackListIp() { |
| | | return blackListIp; |
| | | } |
| | | public void setBlackListIp(String blackListIp) { |
| | | this.blackListIp = blackListIp; |
| | | } |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | public String getSecurityCode() { |
| | | return securityCode; |
| | | } |
| | | public void setSecurityCode(String securityCode) { |
| | | this.securityCode = securityCode; |
| | | } |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | public String getUserId() { |
| | | return userId; |
| | | } |
| | | public void setUserId(String userId) { |
| | | this.userId = userId; |
| | | } |
| | | public String getWhileListIp() { |
| | | return whileListIp; |
| | | } |
| | | public void setWhileListIp(String whileListIp) { |
| | | this.whileListIp = whileListIp; |
| | | } |
| | | |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.dto.service; |
| | | |
| | | import com.java110.dto.PageDto; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * @ClassName FloorDto |
| | | * @Description 服务数据层封装 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 8:52 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | public class ServiceDto extends PageDto implements Serializable { |
| | | |
| | | private String businessTypeCd; |
| | | private String method; |
| | | private String provideAppId; |
| | | private String serviceCode; |
| | | private String retryCount; |
| | | private String messageQueueName; |
| | | private String url; |
| | | private String timeout; |
| | | private String isInstance; |
| | | private String name; |
| | | private String serviceId; |
| | | private String seq; |
| | | |
| | | |
| | | private Date createTime; |
| | | |
| | | private String statusCd = "0"; |
| | | |
| | | |
| | | public String getBusinessTypeCd() { |
| | | return businessTypeCd; |
| | | } |
| | | public void setBusinessTypeCd(String businessTypeCd) { |
| | | this.businessTypeCd = businessTypeCd; |
| | | } |
| | | public String getMethod() { |
| | | return method; |
| | | } |
| | | public void setMethod(String method) { |
| | | this.method = method; |
| | | } |
| | | public String getProvideAppId() { |
| | | return provideAppId; |
| | | } |
| | | public void setProvideAppId(String provideAppId) { |
| | | this.provideAppId = provideAppId; |
| | | } |
| | | public String getServiceCode() { |
| | | return serviceCode; |
| | | } |
| | | public void setServiceCode(String serviceCode) { |
| | | this.serviceCode = serviceCode; |
| | | } |
| | | public String getRetryCount() { |
| | | return retryCount; |
| | | } |
| | | public void setRetryCount(String retryCount) { |
| | | this.retryCount = retryCount; |
| | | } |
| | | public String getMessageQueueName() { |
| | | return messageQueueName; |
| | | } |
| | | public void setMessageQueueName(String messageQueueName) { |
| | | this.messageQueueName = messageQueueName; |
| | | } |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | public String getTimeout() { |
| | | return timeout; |
| | | } |
| | | public void setTimeout(String timeout) { |
| | | this.timeout = timeout; |
| | | } |
| | | public String getIsInstance() { |
| | | return isInstance; |
| | | } |
| | | public void setIsInstance(String isInstance) { |
| | | this.isInstance = isInstance; |
| | | } |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | public String getServiceId() { |
| | | return serviceId; |
| | | } |
| | | public void setServiceId(String serviceId) { |
| | | this.serviceId = serviceId; |
| | | } |
| | | public String getSeq() { |
| | | return seq; |
| | | } |
| | | public void setSeq(String seq) { |
| | | this.seq = seq; |
| | | } |
| | | |
| | | |
| | | public Date getCreateTime() { |
| | | return createTime; |
| | | } |
| | | |
| | | public void setCreateTime(Date createTime) { |
| | | this.createTime = createTime; |
| | | } |
| | | |
| | | public String getStatusCd() { |
| | | return statusCd; |
| | | } |
| | | |
| | | public void setStatusCd(String statusCd) { |
| | | this.statusCd = statusCd; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.vo.api.app; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | public class ApiAppDataVo implements Serializable { |
| | | |
| | | private String appId; |
| | | private String name; |
| | | private String securityCode; |
| | | private String whileListIp; |
| | | private String blackListIp; |
| | | private String remark; |
| | | public String getAppId() { |
| | | return appId; |
| | | } |
| | | public void setAppId(String appId) { |
| | | this.appId = appId; |
| | | } |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | public String getSecurityCode() { |
| | | return securityCode; |
| | | } |
| | | public void setSecurityCode(String securityCode) { |
| | | this.securityCode = securityCode; |
| | | } |
| | | public String getWhileListIp() { |
| | | return whileListIp; |
| | | } |
| | | public void setWhileListIp(String whileListIp) { |
| | | this.whileListIp = whileListIp; |
| | | } |
| | | public String getBlackListIp() { |
| | | return blackListIp; |
| | | } |
| | | public void setBlackListIp(String blackListIp) { |
| | | this.blackListIp = blackListIp; |
| | | } |
| | | public String getRemark() { |
| | | return remark; |
| | | } |
| | | public void setRemark(String remark) { |
| | | this.remark = remark; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.vo.api.app; |
| | | |
| | | import com.java110.vo.MorePageVo; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | public class ApiAppVo extends MorePageVo implements Serializable { |
| | | List<ApiAppDataVo> apps; |
| | | |
| | | |
| | | public List<ApiAppDataVo> getApps() { |
| | | return apps; |
| | | } |
| | | |
| | | public void setApps(List<ApiAppDataVo> apps) { |
| | | this.apps = apps; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110.vo.api.service; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.Date; |
| | | |
| | | public class ApiServiceDataVo implements Serializable { |
| | | |
| | | private String serviceId; |
| | | private String name; |
| | | private String serviceCode; |
| | | private String businessTypeCd; |
| | | private String seq; |
| | | private String messageQueueName; |
| | | private String isInstance; |
| | | private String url; |
| | | private String method; |
| | | private String timeout; |
| | | private String retryCount; |
| | | private String provideAppId; |
| | | public String getServiceId() { |
| | | return serviceId; |
| | | } |
| | | public void setServiceId(String serviceId) { |
| | | this.serviceId = serviceId; |
| | | } |
| | | public String getName() { |
| | | return name; |
| | | } |
| | | public void setName(String name) { |
| | | this.name = name; |
| | | } |
| | | public String getServiceCode() { |
| | | return serviceCode; |
| | | } |
| | | public void setServiceCode(String serviceCode) { |
| | | this.serviceCode = serviceCode; |
| | | } |
| | | public String getBusinessTypeCd() { |
| | | return businessTypeCd; |
| | | } |
| | | public void setBusinessTypeCd(String businessTypeCd) { |
| | | this.businessTypeCd = businessTypeCd; |
| | | } |
| | | public String getSeq() { |
| | | return seq; |
| | | } |
| | | public void setSeq(String seq) { |
| | | this.seq = seq; |
| | | } |
| | | public String getMessageQueueName() { |
| | | return messageQueueName; |
| | | } |
| | | public void setMessageQueueName(String messageQueueName) { |
| | | this.messageQueueName = messageQueueName; |
| | | } |
| | | public String getIsInstance() { |
| | | return isInstance; |
| | | } |
| | | public void setIsInstance(String isInstance) { |
| | | this.isInstance = isInstance; |
| | | } |
| | | public String getUrl() { |
| | | return url; |
| | | } |
| | | public void setUrl(String url) { |
| | | this.url = url; |
| | | } |
| | | public String getMethod() { |
| | | return method; |
| | | } |
| | | public void setMethod(String method) { |
| | | this.method = method; |
| | | } |
| | | public String getTimeout() { |
| | | return timeout; |
| | | } |
| | | public void setTimeout(String timeout) { |
| | | this.timeout = timeout; |
| | | } |
| | | public String getRetryCount() { |
| | | return retryCount; |
| | | } |
| | | public void setRetryCount(String retryCount) { |
| | | this.retryCount = retryCount; |
| | | } |
| | | public String getProvideAppId() { |
| | | return provideAppId; |
| | | } |
| | | public void setProvideAppId(String provideAppId) { |
| | | this.provideAppId = provideAppId; |
| | | } |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.vo.api.service; |
| | | |
| | | import com.java110.vo.MorePageVo; |
| | | |
| | | import java.io.Serializable; |
| | | import java.util.List; |
| | | |
| | | public class ApiServiceVo extends MorePageVo implements Serializable { |
| | | List<ApiServiceDataVo> services; |
| | | |
| | | |
| | | public List<ApiServiceDataVo> getServices() { |
| | | return services; |
| | | } |
| | | |
| | | public void setServices(List<ApiServiceDataVo> services) { |
| | | this.services = services; |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110; |
| | | |
| | | |
| | | import com.java110.code.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Hello world! |
| | | */ |
| | | public class AppGeneratorApplication { |
| | | |
| | | protected AppGeneratorApplication() { |
| | | // prevents calls from subclass |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | /** |
| | | * 代码生成器 入口方法 |
| | | * |
| | | * @param args 参数 |
| | | */ |
| | | public static void main(String[] args) { |
| | | Data data = new Data(); |
| | | data.setId("appId"); |
| | | data.setName("app"); |
| | | data.setDesc("应用"); |
| | | data.setShareParam("appId"); |
| | | data.setShareColumn("app_id"); |
| | | data.setNewBusinessTypeCd("BUSINESS_TYPE_SAVE_NOTICE"); |
| | | data.setUpdateBusinessTypeCd("BUSINESS_TYPE_UPDATE_NOTICE"); |
| | | data.setDeleteBusinessTypeCd("BUSINESS_TYPE_DELETE_NOTICE"); |
| | | data.setNewBusinessTypeCdValue("550100030001"); |
| | | data.setUpdateBusinessTypeCdValue("550100040001"); |
| | | data.setDeleteBusinessTypeCdValue("550100050001"); |
| | | data.setBusinessTableName("business_app"); |
| | | data.setTableName("c_app"); |
| | | Map<String, String> param = new HashMap<String, String>(); |
| | | param.put("appId", "app_id"); |
| | | param.put("name", "name"); |
| | | param.put("securityCode", "security_code"); |
| | | param.put("whileListIp", "while_list_ip"); |
| | | param.put("blackListIp", "black_list_ip"); |
| | | param.put("remark", "remark"); |
| | | param.put("userId", "user_id"); |
| | | param.put("statusCd", "status_cd"); |
| | | param.put("operate", "operate"); |
| | | data.setParams(param); |
| | | GeneratorSaveInfoListener generatorSaveInfoListener = new GeneratorSaveInfoListener(); |
| | | generatorSaveInfoListener.generator(data); |
| | | |
| | | GeneratorAbstractBussiness generatorAbstractBussiness = new GeneratorAbstractBussiness(); |
| | | generatorAbstractBussiness.generator(data); |
| | | |
| | | GeneratorIServiceDaoListener generatorIServiceDaoListener = new GeneratorIServiceDaoListener(); |
| | | generatorIServiceDaoListener.generator(data); |
| | | |
| | | GeneratorServiceDaoImplListener generatorServiceDaoImplListener = new GeneratorServiceDaoImplListener(); |
| | | generatorServiceDaoImplListener.generator(data); |
| | | |
| | | GeneratorServiceDaoImplMapperListener generatorServiceDaoImplMapperListener = null; |
| | | generatorServiceDaoImplMapperListener = new GeneratorServiceDaoImplMapperListener(); |
| | | generatorServiceDaoImplMapperListener.generator(data); |
| | | |
| | | GeneratorUpdateInfoListener generatorUpdateInfoListener = new GeneratorUpdateInfoListener(); |
| | | generatorUpdateInfoListener.generator(data); |
| | | |
| | | GeneratorDeleteInfoListener generatorDeleteInfoListener = new GeneratorDeleteInfoListener(); |
| | | generatorDeleteInfoListener.generator(data); |
| | | |
| | | GeneratorInnerServiceSMOImpl generatorInnerServiceSMOImpl = new GeneratorInnerServiceSMOImpl(); |
| | | generatorInnerServiceSMOImpl.generator(data); |
| | | |
| | | GeneratorDtoBean generatorDtoBean = new GeneratorDtoBean(); |
| | | generatorDtoBean.generator(data); |
| | | |
| | | GeneratorIInnerServiceSMO generatorIInnerServiceSMO = new GeneratorIInnerServiceSMO(); |
| | | generatorIInnerServiceSMO.generator(data); |
| | | } |
| | | } |
| New file |
| | |
| | | package com.java110; |
| | | |
| | | |
| | | import com.java110.code.*; |
| | | |
| | | import java.util.HashMap; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Hello world! |
| | | */ |
| | | public class ServiceGeneratorApplication { |
| | | |
| | | protected ServiceGeneratorApplication() { |
| | | // prevents calls from subclass |
| | | throw new UnsupportedOperationException(); |
| | | } |
| | | |
| | | /** |
| | | * 代码生成器 入口方法 |
| | | * |
| | | * @param args 参数 |
| | | */ |
| | | public static void main(String[] args) { |
| | | Data data = new Data(); |
| | | data.setId("serviceId"); |
| | | data.setName("service"); |
| | | data.setDesc("服务"); |
| | | data.setShareParam("serviceId"); |
| | | data.setShareColumn("service_id"); |
| | | data.setNewBusinessTypeCd("BUSINESS_TYPE_SAVE_NOTICE"); |
| | | data.setUpdateBusinessTypeCd("BUSINESS_TYPE_UPDATE_NOTICE"); |
| | | data.setDeleteBusinessTypeCd("BUSINESS_TYPE_DELETE_NOTICE"); |
| | | data.setNewBusinessTypeCdValue("550100030001"); |
| | | data.setUpdateBusinessTypeCdValue("550100040001"); |
| | | data.setDeleteBusinessTypeCdValue("550100050001"); |
| | | data.setBusinessTableName("business_service"); |
| | | data.setTableName("c_service"); |
| | | Map<String, String> param = new HashMap<String, String>(); |
| | | param.put("serviceId", "service_id"); |
| | | param.put("serviceCode", "service_code"); |
| | | param.put("businessTypeCd", "business_type_cd"); |
| | | param.put("name", "name"); |
| | | param.put("seq", "seq"); |
| | | param.put("messageQueueName", "messageQueueName"); |
| | | param.put("isInstance", "is_instance"); |
| | | param.put("url", "url"); |
| | | param.put("method", "method"); |
| | | param.put("timeout", "timeout"); |
| | | param.put("retryCount", "retry_count"); |
| | | param.put("provideAppId", "provide_app_id"); |
| | | param.put("statusCd", "status_cd"); |
| | | param.put("operate", "operate"); |
| | | data.setParams(param); |
| | | GeneratorSaveInfoListener generatorSaveInfoListener = new GeneratorSaveInfoListener(); |
| | | generatorSaveInfoListener.generator(data); |
| | | |
| | | GeneratorAbstractBussiness generatorAbstractBussiness = new GeneratorAbstractBussiness(); |
| | | generatorAbstractBussiness.generator(data); |
| | | |
| | | GeneratorIServiceDaoListener generatorIServiceDaoListener = new GeneratorIServiceDaoListener(); |
| | | generatorIServiceDaoListener.generator(data); |
| | | |
| | | GeneratorServiceDaoImplListener generatorServiceDaoImplListener = new GeneratorServiceDaoImplListener(); |
| | | generatorServiceDaoImplListener.generator(data); |
| | | |
| | | GeneratorServiceDaoImplMapperListener generatorServiceDaoImplMapperListener = null; |
| | | generatorServiceDaoImplMapperListener = new GeneratorServiceDaoImplMapperListener(); |
| | | generatorServiceDaoImplMapperListener.generator(data); |
| | | |
| | | GeneratorUpdateInfoListener generatorUpdateInfoListener = new GeneratorUpdateInfoListener(); |
| | | generatorUpdateInfoListener.generator(data); |
| | | |
| | | GeneratorDeleteInfoListener generatorDeleteInfoListener = new GeneratorDeleteInfoListener(); |
| | | generatorDeleteInfoListener.generator(data); |
| | | |
| | | GeneratorInnerServiceSMOImpl generatorInnerServiceSMOImpl = new GeneratorInnerServiceSMOImpl(); |
| | | generatorInnerServiceSMOImpl.generator(data); |
| | | |
| | | GeneratorDtoBean generatorDtoBean = new GeneratorDtoBean(); |
| | | generatorDtoBean.generator(data); |
| | | |
| | | GeneratorIInnerServiceSMO generatorIInnerServiceSMO = new GeneratorIInnerServiceSMO(); |
| | | generatorIInnerServiceSMO.generator(data); |
| | | } |
| | | } |
| | |
| | | genneratorListSmoImpl(data); |
| | | genneratorListListener(data); |
| | | |
| | | genneratorServiceCodeConstant(data); |
| | | |
| | | |
| | | |
| | | } |
| | | |
| | | /** |
| | | * 生成常量类 |
| | | * @param data |
| | | */ |
| | | private void genneratorServiceCodeConstant(JSONObject data) { |
| | | StringBuffer sb = readFile(GeneratorStart.class.getResource("/web/constant/ServiceCodeConstant.java").getFile()); |
| | | String fileContext = sb.toString(); |
| | | |
| | | fileContext = super.replaceTemplateContext(fileContext, data); |
| | | |
| | | String writePath = this.getClass().getResource("/").getPath() |
| | | + "out/web/constant/" + data.getString("templateCode") + "/ServiceCode" + toUpperCaseFirstOne(data.getString("templateCode")) + "Constant.java"; |
| | | System.out.printf("writePath: " + writePath); |
| | | writeFile(writePath, |
| | | fileContext); |
| | | |
| | | } |
| | | |
| | |
| | | JSONArray columns = data.getJSONArray("columns"); |
| | | for (int columnIndex = 0; columnIndex < columns.size(); columnIndex++) { |
| | | JSONObject column = columns.getJSONObject(columnIndex); |
| | | if (column.getBoolean("hasDefaultValue")) { |
| | | if ("none".equals(column.getString("inputType"))) { |
| | | continue; |
| | | } |
| | | String required = column.getBoolean("required") ? "必填" : "选填"; |
| | |
| | | " <option selected disabled value=\"\">"+ required + ",请选择" + column.getString("cnCode") + "</option>\n" + |
| | | " " +option+ |
| | | " </select>"; |
| | | } else if("textarea".equals(column.getString("inputType"))){ |
| | | inputStr = "<textarea placeholder=\"" + required + ",请填写" + column.getString("cnCode") + "\" class=\"form-control\""+ |
| | | " v-model=\"add" + toUpperCaseFirstOne(data.getString("templateCode")) + "Info."+column.getString("code")+"\">"+ |
| | | "</textarea>"; |
| | | } else { |
| | | inputStr = " <input v-model=\"add" + toUpperCaseFirstOne(data.getString("templateCode")) + "Info."+column.getString("code")+"\" " + |
| | | " type=\"text\" placeholder=\"" + required + ",请填写" + column.getString("cnCode") + "\" class=\"form-control\">\n"; |
| | |
| | | JSONArray columns = data.getJSONArray("columns"); |
| | | for (int columnIndex = 0; columnIndex < columns.size(); columnIndex++) { |
| | | JSONObject column = columns.getJSONObject(columnIndex); |
| | | if (column.getBoolean("hasDefaultValue")) { |
| | | if ("none".equals(column.getString("inputType"))) { |
| | | continue; |
| | | } |
| | | String required = column.getBoolean("required") ? "必填" : "选填"; |
| | |
| | | " <option selected disabled value=\"\">"+ required + ",请选择" + column.getString("cnCode") + "</option>\n" + |
| | | " " +option+ |
| | | " </select>"; |
| | | } else if("textarea".equals(column.getString("inputType"))){ |
| | | inputStr = "<textarea placeholder=\"" + required + ",请填写" + column.getString("cnCode") + "\" class=\"form-control\""+ |
| | | " v-model=\"edit" + toUpperCaseFirstOne(data.getString("templateCode")) + "Info."+column.getString("code")+"\">"+ |
| | | "</textarea>"; |
| | | } else { |
| | | inputStr = " <input v-model=\"edit" + toUpperCaseFirstOne(data.getString("templateCode")) + "Info."+column.getString("code")+"\" " + |
| | | " type=\"text\" placeholder=\"" + required + ",请填写" + column.getString("cnCode") + "\" class=\"form-control\">\n"; |
| | |
| | | import com.java110.common.constant.CommonConstant; |
| | | import com.java110.common.constant.ServiceCodeConstant; |
| | | import com.java110.common.constant.BusinessTypeConstant; |
| | | import com.java110.common.constant.ServiceCode@@TemplateCode@@Constant; |
| | | |
| | | |
| | | |
| | | |
| | |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeConstant.SERVICE_CODE_SAVE_@@TEMPLATECODE@@; |
| | | return ServiceCode@@TemplateCode@@Constant.ADD_@@TEMPLATECODE@@; |
| | | } |
| | | |
| | | @Override |
| New file |
| | |
| | | package com.java110.common.constant; |
| | | |
| | | /** |
| | | * @@templateName@@常量类 |
| | | * Created by wuxw on 2017/5/20. |
| | | */ |
| | | public class ServiceCode@@TemplateCode@@Constant { |
| | | |
| | | /** |
| | | * 添加 @@templateName@@ |
| | | */ |
| | | public static final String ADD_@@TEMPLATECODE@@ = "@@templateCode@@.save@@TemplateCode@@"; |
| | | |
| | | |
| | | /** |
| | | * 修改 @@templateName@@ |
| | | */ |
| | | public static final String UPDATE_@@TEMPLATECODE@@ = "@@templateCode@@.update@@TemplateCode@@"; |
| | | /** |
| | | * 删除 @@templateName@@ |
| | | */ |
| | | public static final String DELETE_@@TEMPLATECODE@@ = "@@templateCode@@.delete@@TemplateCode@@"; |
| | | |
| | | |
| | | /** |
| | | * 查询 @@templateName@@ |
| | | */ |
| | | public static final String LIST_@@TEMPLATECODE@@S = "@@templateCode@@.list@@TemplateCode@@s"; |
| | | |
| | | |
| | | } |
| | |
| | | import com.java110.common.constant.BusinessTypeConstant; |
| | | |
| | | import com.java110.core.annotation.Java110Listener; |
| | | import com.java110.common.constant.ServiceCode@@TemplateCode@@Constant; |
| | | |
| | | /** |
| | | * 保存小区侦听 |
| | | * add by wuxw 2019-06-30 |
| | |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeConstant.SERVICE_CODE_DELETE_@@TEMPLATECODE@@; |
| | | return ServiceCode@@TemplateCode@@Constant.DELETE_@@TEMPLATECODE@@; |
| | | } |
| | | |
| | | @Override |
| | |
| | | @@validateTemplateColumns@@ |
| | | |
| | | |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_COMMUNITY); |
| | | super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST__@@TEMPLATECODE@@); |
| | | |
| | | } |
| | | |
| | |
| | | import org.springframework.http.HttpHeaders; |
| | | import org.springframework.http.HttpMethod; |
| | | import org.springframework.http.ResponseEntity; |
| | | import com.java110.common.constant.ServiceCode@@TemplateCode@@Constant; |
| | | |
| | | /** |
| | | * 保存@@templateName@@侦听 |
| | |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeConstant.SERVICE_CODE_UPDATE_@@TEMPLATECODE@@; |
| | | return ServiceCode@@TemplateCode@@Constant.UPDATE_@@TEMPLATECODE@@; |
| | | } |
| | | |
| | | @Override |
| | |
| | | vc.on('edit@@TemplateCode@@','openEdit@@TemplateCode@@Modal',function(_params){ |
| | | vc.component.refreshEdit@@TemplateCode@@Info(); |
| | | $('#edit@@TemplateCode@@Model').modal('show'); |
| | | vc.component.edit@@TemplateCode@@Info = _params; |
| | | vc.copyObject(_params, vc.component.edit@@TemplateCode@@Info ); |
| | | vc.component.edit@@TemplateCode@@Info.communityId = vc.getCurrentCommunity().communityId; |
| | | }); |
| | | }, |
| | |
| | | import org.springframework.http.ResponseEntity; |
| | | import com.java110.common.constant.CommonConstant; |
| | | import com.java110.common.constant.BusinessTypeConstant; |
| | | import com.java110.common.constant.ServiceCode@@TemplateCode@@Constant; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | |
| | | |
| | | @Override |
| | | public String getServiceCode() { |
| | | return ServiceCodeConstant.SERVICE_CODE_LIST_@@TEMPLATECODE@@S; |
| | | return ServiceCode@@TemplateCode@@Constant.LIST_@@TEMPLATECODE@@S; |
| | | } |
| | | |
| | | @Override |
| | |
| | | { |
| | | "templateName":"公告", |
| | | "templateCode":"notice", |
| | | "templateKey":"noticeId", |
| | | "templateKeyName":"公告ID", |
| | | "templateName":"服务", |
| | | "templateCode":"service", |
| | | "templateKey":"serviceId", |
| | | "templateKeyName":"服务ID", |
| | | "columns":[ |
| | | { |
| | | "code":"title", |
| | | "cnCode":"标题", |
| | | "desc":"必填,请填写标题", |
| | | "code":"name", |
| | | "cnCode":"服务名称", |
| | | "desc":"必填,请填写服务名称", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType":"input", |
| | | "limit":"maxLength", |
| | | "limitParam":"50", |
| | | "limitErrInfo":"服务名称不能超过50" |
| | | }, |
| | | { |
| | | "code":"serviceCode", |
| | | "cnCode":"服务编码", |
| | | "desc":"必填,请填写服务编码如 service.saveService", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType":"input", |
| | | "limit":"maxin", |
| | | "limitParam":"4,100", |
| | | "limitErrInfo":"小区名称必须在4至100字符之间" |
| | | "limitParam":"2,50", |
| | | "limitErrInfo":"服务编码必须在2至50字符之间" |
| | | }, |
| | | { |
| | | "code":"noticeTypeCd", |
| | | "cnCode":"公告类型", |
| | | "desc":"必填,请选择公告类型", |
| | | "code":"businessTypeCd", |
| | | "cnCode":"秘钥", |
| | | "desc":"可填,请填写秘钥,如果填写了需要加密传输", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType":"select", |
| | | "selectValue":"1000,1001,1002", |
| | | "selectValueName":"业主通知,员工通知,小区通知", |
| | | "hasDefaultValue":true, |
| | | "defaultValue":"API", |
| | | "inputType":"none", |
| | | "limit":"maxin", |
| | | "limitParam":"2,4", |
| | | "limitErrInfo":"业务类型必须为API" |
| | | }, |
| | | |
| | | { |
| | | "code":"seq", |
| | | "cnCode":"序列", |
| | | "desc":"必填,请填写序列", |
| | | "required":true, |
| | | "hasDefaultValue":true, |
| | | "defaultValue":"1", |
| | | "inputType":"none", |
| | | "limit":"maxLength", |
| | | "limitParam":"200", |
| | | "limitErrInfo":"公告类型错误" |
| | | "limitParam":"1", |
| | | "limitErrInfo":"序列格式错误" |
| | | }, |
| | | |
| | | { |
| | | "code":"context", |
| | | "cnCode":"公告内容", |
| | | "desc":"必填,请填写公告内容", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType":"input", |
| | | "limit":"maxLength", |
| | | "limitParam":"500", |
| | | "limitErrInfo":"公告内容不能超过500个字" |
| | | }, |
| | | { |
| | | "code":"startTime", |
| | | "cnCode":"开始时间", |
| | | "desc":"必选,请填写开始时间 2019-01-02", |
| | | "required":true, |
| | | "code":"messageQueueName", |
| | | "cnCode":"消息队列", |
| | | "desc":"可填,请填写消息队列,订单在异步调用时使用", |
| | | "required":false, |
| | | "hasDefaultValue":false, |
| | | "defaultValue":"", |
| | | "inputType":"input", |
| | | "limit":"date", |
| | | "limit":"maxLength", |
| | | "limitParam":"50", |
| | | "limitErrInfo":"消息队列不能超过50" |
| | | } |
| | | , |
| | | |
| | | { |
| | | "code":"isInstance", |
| | | "cnCode":"是否实例", |
| | | "desc":"可填,请填写实例 Y 或N", |
| | | "required":true, |
| | | "hasDefaultValue":true, |
| | | "defaultValue":"Y", |
| | | "inputType":"input", |
| | | "limit":"maxLength", |
| | | "limitParam":"50", |
| | | "limitErrInfo":"实例不能超过50" |
| | | } |
| | | , |
| | | |
| | | { |
| | | "code":"url", |
| | | "cnCode":"调用地址", |
| | | "desc":"可填,请填写调用地址", |
| | | "required":false, |
| | | "hasDefaultValue":true, |
| | | "defaultValue":"http://order-service/orderApi/service", |
| | | "inputType":"input", |
| | | "limit":"maxLength", |
| | | "limitParam":"200", |
| | | "limitErrInfo":"调用地址不能超过200" |
| | | }, |
| | | { |
| | | "code":"method", |
| | | "cnCode":"调用方式", |
| | | "desc":"必填,请填写调用方式", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType":"select", |
| | | "selectValue":"GET,POST", |
| | | "selectValueName":"http get,http post", |
| | | "limit":"maxLength", |
| | | "limitParam":"50", |
| | | "limitErrInfo":"调用方式不能超过50" |
| | | }, |
| | | { |
| | | "code":"timeout", |
| | | "cnCode":"超时时间", |
| | | "desc":"必填,请填写超时时间", |
| | | "required":true, |
| | | "hasDefaultValue":true, |
| | | "defaultValue":"60", |
| | | "inputType":"input", |
| | | "limit":"num", |
| | | "limitParam":"", |
| | | "limitErrInfo":"开始时间不是有效的日志" |
| | | "limitErrInfo":"超时时间必须为数字" |
| | | }, |
| | | { |
| | | "code":"retryCount", |
| | | "cnCode":"重试次数", |
| | | "desc":"必填,请填写重试次数", |
| | | "required":true, |
| | | "hasDefaultValue":true, |
| | | "defaultValue":"3", |
| | | "inputType":"input", |
| | | "limit":"num", |
| | | "limitParam":"", |
| | | "limitErrInfo":"重试次数必须为数字" |
| | | }, |
| | | { |
| | | "code":"provideAppId", |
| | | "cnCode":"提供服务", |
| | | "desc":"必填,请填写提供服务", |
| | | "required":true, |
| | | "hasDefaultValue":true, |
| | | "defaultValue":"8000418002", |
| | | "inputType":"none", |
| | | "limit":"num", |
| | | "limitParam":"", |
| | | "limitErrInfo":"重试次数必须为数字" |
| | | } |
| | | |
| | | ] |
| New file |
| | |
| | | { |
| | | "templateName":"应用", |
| | | "templateCode":"app", |
| | | "templateKey":"appId", |
| | | "templateKeyName":"应用Id", |
| | | "columns":[ |
| | | { |
| | | "code":"name", |
| | | "cnCode":"应用名称", |
| | | "desc":"必填,请填写应用名称", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType":"input", |
| | | "limit":"maxin", |
| | | "limitParam":"2,50", |
| | | "limitErrInfo":"应用名称必须在2至50字符之间" |
| | | }, |
| | | { |
| | | "code":"securityCode", |
| | | "cnCode":"秘钥", |
| | | "desc":"可填,请填写秘钥,如果填写了需要加密传输", |
| | | "required":false, |
| | | "hasDefaultValue":false, |
| | | "inputType":"input", |
| | | "limit":"maxLength", |
| | | "limitParam":"64", |
| | | "limitErrInfo":"秘钥太长超过64位" |
| | | }, |
| | | { |
| | | "code":"whileListIp", |
| | | "cnCode":"白名单", |
| | | "desc":"可填,请填写白名单IP,以,号分割", |
| | | "required":false, |
| | | "hasDefaultValue":false, |
| | | "inputType":"input", |
| | | "limit":"maxLength", |
| | | "limitParam":"200", |
| | | "limitErrInfo":"白名单内容不能超过200" |
| | | }, |
| | | { |
| | | "code":"blackListIp", |
| | | "cnCode":"黑名单", |
| | | "desc":"可填,请填写黑名单IP,以,号分割", |
| | | "required":false, |
| | | "hasDefaultValue":false, |
| | | "defaultValue":"", |
| | | "inputType":"input", |
| | | "limit":"maxLength", |
| | | "limitParam":"200", |
| | | "limitErrInfo":"黑名单内容不能超过200" |
| | | }, |
| | | |
| | | { |
| | | "code":"remark", |
| | | "cnCode":"备注", |
| | | "desc":"可填,请填写备注", |
| | | "required":false, |
| | | "hasDefaultValue":false, |
| | | "defaultValue":"", |
| | | "inputType":"textarea", |
| | | "limit":"maxLength", |
| | | "limitParam":"200", |
| | | "limitErrInfo":"备注内容不能超过200" |
| | | } |
| | | |
| | | ] |
| | | } |
| New file |
| | |
| | | { |
| | | "templateName":"公告", |
| | | "templateCode":"notice", |
| | | "templateKey":"noticeId", |
| | | "templateKeyName":"公告ID", |
| | | "columns":[ |
| | | { |
| | | "code":"title", |
| | | "cnCode":"标题", |
| | | "desc":"必填,请填写标题", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType":"input", |
| | | "limit":"maxin", |
| | | "limitParam":"4,100", |
| | | "limitErrInfo":"小区名称必须在4至100字符之间" |
| | | }, |
| | | { |
| | | "code":"noticeTypeCd", |
| | | "cnCode":"公告类型", |
| | | "desc":"必填,请选择公告类型", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType":"select", |
| | | "selectValue":"1000,1001,1002", |
| | | "selectValueName":"业主通知,员工通知,小区通知", |
| | | "limit":"maxLength", |
| | | "limitParam":"200", |
| | | "limitErrInfo":"公告类型错误" |
| | | }, |
| | | { |
| | | "code":"context", |
| | | "cnCode":"公告内容", |
| | | "desc":"必填,请填写公告内容", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "inputType":"input", |
| | | "limit":"maxLength", |
| | | "limitParam":"500", |
| | | "limitErrInfo":"公告内容不能超过500个字" |
| | | }, |
| | | { |
| | | "code":"startTime", |
| | | "cnCode":"开始时间", |
| | | "desc":"必选,请填写开始时间 2019-01-02", |
| | | "required":true, |
| | | "hasDefaultValue":false, |
| | | "defaultValue":"", |
| | | "inputType":"input", |
| | | "limit":"date", |
| | | "limitParam":"", |
| | | "limitErrInfo":"开始时间不是有效的日志" |
| | | } |
| | | |
| | | ] |
| | | } |
| | |
| | | |
| | | public static final String AGENT_HAS_LIST_COMMUNITY = "500201906025"; |
| | | public static final String HAS_LIST_NOTICE = "500201904009"; |
| | | public static final String AGENT_HAS_LIST_APP = "500201906026"; |
| | | public static final String AGENT_HAS_LIST_SERVICE = "500201906027"; |
| | | |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.constant; |
| | | |
| | | /** |
| | | * 应用常量类 |
| | | * Created by wuxw on 2017/5/20. |
| | | */ |
| | | public class ServiceCodeAppConstant { |
| | | |
| | | /** |
| | | * 添加 应用 |
| | | */ |
| | | public static final String ADD_APP = "app.saveApp"; |
| | | |
| | | |
| | | /** |
| | | * 修改 应用 |
| | | */ |
| | | public static final String UPDATE_APP = "app.updateApp"; |
| | | /** |
| | | * 删除 应用 |
| | | */ |
| | | public static final String DELETE_APP = "app.deleteApp"; |
| | | |
| | | |
| | | /** |
| | | * 查询 应用 |
| | | */ |
| | | public static final String LIST_APPS = "app.listApps"; |
| | | |
| | | |
| | | } |
| New file |
| | |
| | | package com.java110.common.constant; |
| | | |
| | | /** |
| | | * 服务常量类 |
| | | * Created by wuxw on 2017/5/20. |
| | | */ |
| | | public class ServiceCodeServiceConstant { |
| | | |
| | | /** |
| | | * 添加 服务 |
| | | */ |
| | | public static final String ADD_SERVICE = "service.saveService"; |
| | | |
| | | |
| | | /** |
| | | * 修改 服务 |
| | | */ |
| | | public static final String UPDATE_SERVICE = "service.updateService"; |
| | | /** |
| | | * 删除 服务 |
| | | */ |
| | | public static final String DELETE_SERVICE = "service.deleteService"; |
| | | |
| | | |
| | | /** |
| | | * 查询 服务 |
| | | */ |
| | | public static final String LIST_SERVICES = "service.listServices"; |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | //BUSINESSTYPE |
| | | public static final String CODE_PREFIX_id="99"; |
| | | public static final String CODE_PREFIX_service_id="98"; |
| | | |
| | | /** |
| | | * 只有在不调用服务生成ID时有用 |
| New file |
| | |
| | | package com.java110.core.smo.app; |
| | | |
| | | import com.java110.core.feign.FeignConfiguration; |
| | | import com.java110.dto.app.AppDto; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName IAppInnerServiceSMO |
| | | * @Description 应用接口类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:04 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @FeignClient(name = "community-service", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/appApi") |
| | | public interface IAppInnerServiceSMO { |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * |
| | | * @param appDto 数据对象分享 |
| | | * @return AppDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryApps", method = RequestMethod.POST) |
| | | List<AppDto> queryApps(@RequestBody AppDto appDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param appDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryAppsCount", method = RequestMethod.POST) |
| | | int queryAppsCount(@RequestBody AppDto appDto); |
| | | |
| | | |
| | | /** |
| | | * <p>修改APP信息</p> |
| | | * |
| | | * |
| | | * @param appDto 数据对象分享 |
| | | * @return AppDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/updateApp", method = RequestMethod.POST) |
| | | int updateApp(@RequestBody AppDto appDto); |
| | | |
| | | |
| | | /** |
| | | * <p>添加APP信息</p> |
| | | * |
| | | * |
| | | * @param appDto 数据对象分享 |
| | | * @return AppDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/saveApp", method = RequestMethod.POST) |
| | | int saveApp(@RequestBody AppDto appDto); |
| | | |
| | | /** |
| | | * <p>删除APP信息</p> |
| | | * |
| | | * |
| | | * @param appDto 数据对象分享 |
| | | * @return AppDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/deleteApp", method = RequestMethod.POST) |
| | | int deleteApp(@RequestBody AppDto appDto); |
| | | } |
| New file |
| | |
| | | package com.java110.core.smo.service; |
| | | |
| | | import com.java110.core.feign.FeignConfiguration; |
| | | import com.java110.dto.service.ServiceDto; |
| | | import com.java110.dto.service.ServiceDto; |
| | | import org.springframework.cloud.openfeign.FeignClient; |
| | | import org.springframework.web.bind.annotation.RequestBody; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @ClassName IServiceInnerServiceSMO |
| | | * @Description 服务接口类 |
| | | * @Author wuxw |
| | | * @Date 2019/4/24 9:04 |
| | | * @Version 1.0 |
| | | * add by wuxw 2019/4/24 |
| | | **/ |
| | | @FeignClient(name = "community-service", configuration = {FeignConfiguration.class}) |
| | | @RequestMapping("/serviceApi") |
| | | public interface IServiceInnerServiceSMO { |
| | | |
| | | /** |
| | | * <p>查询小区楼信息</p> |
| | | * |
| | | * |
| | | * @param serviceDto 数据对象分享 |
| | | * @return ServiceDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/queryServices", method = RequestMethod.POST) |
| | | List<ServiceDto> queryServices(@RequestBody ServiceDto serviceDto); |
| | | |
| | | /** |
| | | * 查询<p>小区楼</p>总记录数 |
| | | * |
| | | * @param serviceDto 数据对象分享 |
| | | * @return 小区下的小区楼记录数 |
| | | */ |
| | | @RequestMapping(value = "/queryServicesCount", method = RequestMethod.POST) |
| | | int queryServicesCount(@RequestBody ServiceDto serviceDto); |
| | | |
| | | |
| | | /** |
| | | * <p>修改APP信息</p> |
| | | * |
| | | * |
| | | * @param serviceDto 数据对象分享 |
| | | * @return ServiceDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/updateService", method = RequestMethod.POST) |
| | | int updateService(@RequestBody ServiceDto serviceDto); |
| | | |
| | | |
| | | /** |
| | | * <p>添加APP信息</p> |
| | | * |
| | | * |
| | | * @param serviceDto 数据对象分享 |
| | | * @return ServiceDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/saveService", method = RequestMethod.POST) |
| | | int saveService(@RequestBody ServiceDto serviceDto); |
| | | |
| | | /** |
| | | * <p>删除APP信息</p> |
| | | * |
| | | * |
| | | * @param serviceDto 数据对象分享 |
| | | * @return ServiceDto 对象数据 |
| | | */ |
| | | @RequestMapping(value = "/deleteService", method = RequestMethod.POST) |
| | | int deleteService(@RequestBody ServiceDto serviceDto); |
| | | } |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="appServiceDaoImpl"> |
| | | |
| | | <!-- 保存应用信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveAppInfo" parameterType="Map"> |
| | | insert into c_app( |
| | | status_cd,app_id,black_list_ip,name,security_code,remark,while_list_ip |
| | | ) values ( |
| | | '0',#{appId},#{blackListIp},#{name},#{securityCode},#{remark},#{whileListIp} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询应用信息(Business) add by wuxw 2018-07-03 --> |
| | | <select id="getBusinessAppInfo" parameterType="Map" resultType="Map"> |
| | | select t.operate,t.app_id,t.app_id appId,t.black_list_ip,t.black_list_ip blackListIp,t.name,t.security_code,t.security_code securityCode,t.remark,t.while_list_ip,t.while_list_ip whileListIp |
| | | from business_app t |
| | | where 1 =1 |
| | | <if test="operate !=null and operate != ''"> |
| | | and t.operate= #{operate} |
| | | </if> |
| | | <if test="appId !=null and appId != ''"> |
| | | and t.app_id= #{appId} |
| | | </if> |
| | | <if test="blackListIp !=null and blackListIp != ''"> |
| | | and t.black_list_ip= #{blackListIp} |
| | | </if> |
| | | <if test="name !=null and name != ''"> |
| | | and t.name= #{name} |
| | | </if> |
| | | <if test="securityCode !=null and securityCode != ''"> |
| | | and t.security_code= #{securityCode} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | and t.remark= #{remark} |
| | | </if> |
| | | |
| | | <if test="whileListIp !=null and whileListIp != ''"> |
| | | and t.while_list_ip= #{whileListIp} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 保存应用信息至 instance表中 add by wuxw 2018-07-03 --> |
| | | <insert id="saveAppInfoInstance" parameterType="Map"> |
| | | insert into c_app( |
| | | app_id,black_list_ip,name,security_code,remark,status_cd,while_list_ip |
| | | ) select t.app_id,t.black_list_ip,t.name,t.security_code,t.remark,'0',t.while_list_ip from business_app t where 1=1 |
| | | and t.operate= 'ADD' |
| | | <if test="appId !=null and appId != ''"> |
| | | and t.app_id= #{appId} |
| | | </if> |
| | | <if test="blackListIp !=null and blackListIp != ''"> |
| | | and t.black_list_ip= #{blackListIp} |
| | | </if> |
| | | <if test="name !=null and name != ''"> |
| | | and t.name= #{name} |
| | | </if> |
| | | <if test="securityCode !=null and securityCode != ''"> |
| | | and t.security_code= #{securityCode} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | and t.remark= #{remark} |
| | | </if> |
| | | |
| | | <if test="whileListIp !=null and whileListIp != ''"> |
| | | and t.while_list_ip= #{whileListIp} |
| | | </if> |
| | | |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <!-- 查询应用信息 add by wuxw 2018-07-03 --> |
| | | <select id="getAppInfo" parameterType="Map" resultType="Map"> |
| | | select t.app_id,t.app_id appId,t.black_list_ip,t.black_list_ip blackListIp,t.name,t.security_code,t.security_code securityCode,t.remark,t.status_cd,t.status_cd statusCd,t.while_list_ip,t.while_list_ip whileListIp |
| | | from c_app t |
| | | where 1 =1 |
| | | <if test="appId !=null and appId != ''"> |
| | | and t.app_id= #{appId} |
| | | </if> |
| | | <if test="blackListIp !=null and blackListIp != ''"> |
| | | and t.black_list_ip= #{blackListIp} |
| | | </if> |
| | | <if test="name !=null and name != ''"> |
| | | and t.name= #{name} |
| | | </if> |
| | | <if test="securityCode !=null and securityCode != ''"> |
| | | and t.security_code= #{securityCode} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | and t.remark= #{remark} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | |
| | | <if test="whileListIp !=null and whileListIp != ''"> |
| | | and t.while_list_ip= #{whileListIp} |
| | | </if> |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 修改应用信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateAppInfo" parameterType="Map"> |
| | | update c_app t set t.status_cd = #{statusCd} |
| | | <if test="blackListIp !=null and blackListIp != ''"> |
| | | , t.black_list_ip= #{blackListIp} |
| | | </if> |
| | | <if test="name !=null and name != ''"> |
| | | , t.name= #{name} |
| | | </if> |
| | | <if test="securityCode !=null and securityCode != ''"> |
| | | , t.security_code= #{securityCode} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | , t.remark= #{remark} |
| | | </if> |
| | | |
| | | <if test="whileListIp !=null and whileListIp != ''"> |
| | | , t.while_list_ip= #{whileListIp} |
| | | </if> |
| | | where 1=1 <if test="appId !=null and appId != ''"> |
| | | and t.app_id= #{appId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询应用数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryAppsCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from c_app t |
| | | where 1 =1 |
| | | <if test="appId !=null and appId != ''"> |
| | | and t.app_id= #{appId} |
| | | </if> |
| | | <if test="blackListIp !=null and blackListIp != ''"> |
| | | and t.black_list_ip= #{blackListIp} |
| | | </if> |
| | | <if test="name !=null and name != ''"> |
| | | and t.name= #{name} |
| | | </if> |
| | | <if test="securityCode !=null and securityCode != ''"> |
| | | and t.security_code= #{securityCode} |
| | | </if> |
| | | <if test="remark !=null and remark != ''"> |
| | | and t.remark= #{remark} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | |
| | | <if test="whileListIp !=null and whileListIp != ''"> |
| | | and t.while_list_ip= #{whileListIp} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |
| New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8" ?> |
| | | <!DOCTYPE mapper |
| | | PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" |
| | | "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | <mapper namespace="serviceServiceDaoImpl"> |
| | | |
| | | <!-- 保存服务信息 add by wuxw 2018-07-03 --> |
| | | <insert id="saveServiceInfo" parameterType="Map"> |
| | | insert into c_service( |
| | | business_type_cd,method,provide_app_id,service_code,retry_count,messageQueueName,url,timeout,is_instance,name,service_id,seq |
| | | ) values ( |
| | | #{businessTypeCd},#{method},#{provideAppId},#{serviceCode},#{retryCount},#{messageQueueName},#{url},#{timeout},#{isInstance},#{name},#{serviceId},#{seq} |
| | | ) |
| | | </insert> |
| | | |
| | | |
| | | <!-- 查询服务信息(Business) add by wuxw 2018-07-03 --> |
| | | <select id="getBusinessServiceInfo" parameterType="Map" resultType="Map"> |
| | | select t.business_type_cd,t.business_type_cd businessTypeCd,t.method,t.provide_app_id,t.provide_app_id provideAppId,t.service_code,t.service_code serviceCode,t.retry_count,t.retry_count retryCount,t.messageQueueName,t.url,t.timeout,t.is_instance,t.is_instance isInstance,t.operate,t.name,t.service_id,t.service_id serviceId,t.seq |
| | | from business_service t |
| | | where 1 =1 |
| | | <if test="businessTypeCd !=null and businessTypeCd != ''"> |
| | | and t.business_type_cd= #{businessTypeCd} |
| | | </if> |
| | | <if test="method !=null and method != ''"> |
| | | and t.method= #{method} |
| | | </if> |
| | | <if test="provideAppId !=null and provideAppId != ''"> |
| | | and t.provide_app_id= #{provideAppId} |
| | | </if> |
| | | <if test="serviceCode !=null and serviceCode != ''"> |
| | | and t.service_code= #{serviceCode} |
| | | </if> |
| | | <if test="retryCount !=null and retryCount != ''"> |
| | | and t.retry_count= #{retryCount} |
| | | </if> |
| | | <if test="messageQueueName !=null and messageQueueName != ''"> |
| | | and t.messageQueueName= #{messageQueueName} |
| | | </if> |
| | | <if test="url !=null and url != ''"> |
| | | and t.url= #{url} |
| | | </if> |
| | | <if test="timeout !=null and timeout != ''"> |
| | | and t.timeout= #{timeout} |
| | | </if> |
| | | <if test="isInstance !=null and isInstance != ''"> |
| | | and t.is_instance= #{isInstance} |
| | | </if> |
| | | <if test="operate !=null and operate != ''"> |
| | | and t.operate= #{operate} |
| | | </if> |
| | | <if test="name !=null and name != ''"> |
| | | and t.name= #{name} |
| | | </if> |
| | | <if test="serviceId !=null and serviceId != ''"> |
| | | and t.service_id= #{serviceId} |
| | | </if> |
| | | <if test="seq !=null and seq != ''"> |
| | | and t.seq= #{seq} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 保存服务信息至 instance表中 add by wuxw 2018-07-03 --> |
| | | <insert id="saveServiceInfoInstance" parameterType="Map"> |
| | | insert into c_service( |
| | | business_type_cd,method,provide_app_id,service_code,retry_count,status_cd,messageQueueName,url,timeout,is_instance,name,service_id,seq |
| | | ) select t.business_type_cd,t.method,t.provide_app_id,t.service_code,t.retry_count,'0',t.messageQueueName,t.url,t.timeout,t.is_instance,t.name,t.service_id,t.seq from business_service t where 1=1 |
| | | <if test="businessTypeCd !=null and businessTypeCd != ''"> |
| | | and t.business_type_cd= #{businessTypeCd} |
| | | </if> |
| | | <if test="method !=null and method != ''"> |
| | | and t.method= #{method} |
| | | </if> |
| | | <if test="provideAppId !=null and provideAppId != ''"> |
| | | and t.provide_app_id= #{provideAppId} |
| | | </if> |
| | | <if test="serviceCode !=null and serviceCode != ''"> |
| | | and t.service_code= #{serviceCode} |
| | | </if> |
| | | <if test="retryCount !=null and retryCount != ''"> |
| | | and t.retry_count= #{retryCount} |
| | | </if> |
| | | <if test="messageQueueName !=null and messageQueueName != ''"> |
| | | and t.messageQueueName= #{messageQueueName} |
| | | </if> |
| | | <if test="url !=null and url != ''"> |
| | | and t.url= #{url} |
| | | </if> |
| | | <if test="timeout !=null and timeout != ''"> |
| | | and t.timeout= #{timeout} |
| | | </if> |
| | | <if test="isInstance !=null and isInstance != ''"> |
| | | and t.is_instance= #{isInstance} |
| | | </if> |
| | | and t.operate= 'ADD' |
| | | <if test="name !=null and name != ''"> |
| | | and t.name= #{name} |
| | | </if> |
| | | <if test="serviceId !=null and serviceId != ''"> |
| | | and t.service_id= #{serviceId} |
| | | </if> |
| | | <if test="seq !=null and seq != ''"> |
| | | and t.seq= #{seq} |
| | | </if> |
| | | |
| | | </insert> |
| | | |
| | | |
| | | |
| | | <!-- 查询服务信息 add by wuxw 2018-07-03 --> |
| | | <select id="getServiceInfo" parameterType="Map" resultType="Map"> |
| | | select t.business_type_cd,t.business_type_cd businessTypeCd,t.method,t.provide_app_id,t.provide_app_id provideAppId,t.service_code,t.service_code serviceCode,t.retry_count,t.retry_count retryCount,t.status_cd,t.status_cd statusCd,t.messageQueueName,t.url,t.timeout,t.is_instance,t.is_instance isInstance,t.name,t.service_id,t.service_id serviceId,t.seq |
| | | from c_service t |
| | | where 1 =1 |
| | | <if test="businessTypeCd !=null and businessTypeCd != ''"> |
| | | and t.business_type_cd= #{businessTypeCd} |
| | | </if> |
| | | <if test="method !=null and method != ''"> |
| | | and t.method= #{method} |
| | | </if> |
| | | <if test="provideAppId !=null and provideAppId != ''"> |
| | | and t.provide_app_id= #{provideAppId} |
| | | </if> |
| | | <if test="serviceCode !=null and serviceCode != ''"> |
| | | and t.service_code= #{serviceCode} |
| | | </if> |
| | | <if test="retryCount !=null and retryCount != ''"> |
| | | and t.retry_count= #{retryCount} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="messageQueueName !=null and messageQueueName != ''"> |
| | | and t.messageQueueName= #{messageQueueName} |
| | | </if> |
| | | <if test="url !=null and url != ''"> |
| | | and t.url= #{url} |
| | | </if> |
| | | <if test="timeout !=null and timeout != ''"> |
| | | and t.timeout= #{timeout} |
| | | </if> |
| | | <if test="isInstance !=null and isInstance != ''"> |
| | | and t.is_instance= #{isInstance} |
| | | </if> |
| | | <if test="name !=null and name != ''"> |
| | | and t.name= #{name} |
| | | </if> |
| | | <if test="serviceId !=null and serviceId != ''"> |
| | | and t.service_id= #{serviceId} |
| | | </if> |
| | | <if test="seq !=null and seq != ''"> |
| | | and t.seq= #{seq} |
| | | </if> |
| | | <if test="page != -1 and page != null "> |
| | | limit #{page}, #{row} |
| | | </if> |
| | | |
| | | </select> |
| | | |
| | | |
| | | |
| | | |
| | | <!-- 修改服务信息 add by wuxw 2018-07-03 --> |
| | | <update id="updateServiceInfo" parameterType="Map"> |
| | | update c_service t set t.status_cd = #{statusCd} |
| | | |
| | | <if test="businessTypeCd !=null and businessTypeCd != ''"> |
| | | , t.business_type_cd= #{businessTypeCd} |
| | | </if> |
| | | <if test="method !=null and method != ''"> |
| | | , t.method= #{method} |
| | | </if> |
| | | <if test="provideAppId !=null and provideAppId != ''"> |
| | | , t.provide_app_id= #{provideAppId} |
| | | </if> |
| | | <if test="serviceCode !=null and serviceCode != ''"> |
| | | , t.service_code= #{serviceCode} |
| | | </if> |
| | | <if test="retryCount !=null and retryCount != ''"> |
| | | , t.retry_count= #{retryCount} |
| | | </if> |
| | | <if test="messageQueueName !=null and messageQueueName != ''"> |
| | | , t.messageQueueName= #{messageQueueName} |
| | | </if> |
| | | <if test="url !=null and url != ''"> |
| | | , t.url= #{url} |
| | | </if> |
| | | <if test="timeout !=null and timeout != ''"> |
| | | , t.timeout= #{timeout} |
| | | </if> |
| | | <if test="isInstance !=null and isInstance != ''"> |
| | | , t.is_instance= #{isInstance} |
| | | </if> |
| | | <if test="name !=null and name != ''"> |
| | | , t.name= #{name} |
| | | </if> |
| | | <if test="seq !=null and seq != ''"> |
| | | , t.seq= #{seq} |
| | | </if> |
| | | where 1=1 <if test="serviceId !=null and serviceId != ''"> |
| | | and t.service_id= #{serviceId} |
| | | </if> |
| | | |
| | | </update> |
| | | |
| | | <!-- 查询服务数量 add by wuxw 2018-07-03 --> |
| | | <select id="queryServicesCount" parameterType="Map" resultType="Map"> |
| | | select count(1) count |
| | | from c_service t |
| | | where 1 =1 |
| | | <if test="businessTypeCd !=null and businessTypeCd != ''"> |
| | | and t.business_type_cd= #{businessTypeCd} |
| | | </if> |
| | | <if test="method !=null and method != ''"> |
| | | and t.method= #{method} |
| | | </if> |
| | | <if test="provideAppId !=null and provideAppId != ''"> |
| | | and t.provide_app_id= #{provideAppId} |
| | | </if> |
| | | <if test="serviceCode !=null and serviceCode != ''"> |
| | | and t.service_code= #{serviceCode} |
| | | </if> |
| | | <if test="retryCount !=null and retryCount != ''"> |
| | | and t.retry_count= #{retryCount} |
| | | </if> |
| | | <if test="statusCd !=null and statusCd != ''"> |
| | | and t.status_cd= #{statusCd} |
| | | </if> |
| | | <if test="messageQueueName !=null and messageQueueName != ''"> |
| | | and t.messageQueueName= #{messageQueueName} |
| | | </if> |
| | | <if test="url !=null and url != ''"> |
| | | and t.url= #{url} |
| | | </if> |
| | | <if test="timeout !=null and timeout != ''"> |
| | | and t.timeout= #{timeout} |
| | | </if> |
| | | <if test="isInstance !=null and isInstance != ''"> |
| | | and t.is_instance= #{isInstance} |
| | | </if> |
| | | <if test="name !=null and name != ''"> |
| | | and t.name= #{name} |
| | | </if> |
| | | <if test="serviceId !=null and serviceId != ''"> |
| | | and t.service_id= #{serviceId} |
| | | </if> |
| | | <if test="seq !=null and seq != ''"> |
| | | and t.seq= #{seq} |
| | | </if> |
| | | |
| | | |
| | | </select> |
| | | |
| | | </mapper> |