| | |
| | | |
| | | AppDto appDto = BeanConvertUtil.covertBean(reqJson, AppDto.class); |
| | | |
| | | appDto.setStatusCd(StatusConstant.STATUS_CD_INVALID); |
| | | |
| | | int count = appInnerServiceSMOImpl.deleteApp(appDto); |
| | | int count = appInnerServiceSMOImpl.updateApp(appDto); |
| | | |
| | | |
| | | |
| | | if (count < 1) { |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "删除数据失败"); |
| | | throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "修改数据失败"); |
| | | } |
| | | |
| | | ResponseEntity<String> responseEntity = new ResponseEntity<String>("", HttpStatus.OK); |
| 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 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.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.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.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.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 = "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 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 = "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.component.editServiceInfo = _params; |
| | | 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="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.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.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; |
| | | } |
| | | } |
| | |
| | | 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") ? "必填" : "选填"; |
| | |
| | | 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") ? "必填" : "选填"; |
| | |
| | | { |
| | | "templateName":"应用", |
| | | "templateCode":"app", |
| | | "templateKey":"appId", |
| | | "templateKeyName":"应用Id", |
| | | "templateName":"服务", |
| | | "templateCode":"service", |
| | | "templateKey":"serviceId", |
| | | "templateKeyName":"服务ID", |
| | | "columns":[ |
| | | { |
| | | "code":"name", |
| | | "cnCode":"应用名称", |
| | | "desc":"必填,请填写应用名称", |
| | | "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":"2,50", |
| | | "limitErrInfo":"应用名称必须在2至50字符之间" |
| | | "limitErrInfo":"服务编码必须在2至50字符之间" |
| | | }, |
| | | { |
| | | "code":"securityCode", |
| | | "code":"businessTypeCd", |
| | | "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" |
| | | "required":true, |
| | | "hasDefaultValue":true, |
| | | "defaultValue":"API", |
| | | "inputType":"none", |
| | | "limit":"maxin", |
| | | "limitParam":"2,4", |
| | | "limitErrInfo":"业务类型必须为API" |
| | | }, |
| | | |
| | | { |
| | | "code":"remark", |
| | | "cnCode":"备注", |
| | | "desc":"可填,请填写备注", |
| | | "code":"seq", |
| | | "cnCode":"序列", |
| | | "desc":"必填,请填写序列", |
| | | "required":true, |
| | | "hasDefaultValue":true, |
| | | "defaultValue":"1", |
| | | "inputType":"none", |
| | | "limit":"maxLength", |
| | | "limitParam":"1", |
| | | "limitErrInfo":"序列格式错误" |
| | | }, |
| | | |
| | | { |
| | | "code":"messageQueueName", |
| | | "cnCode":"消息队列", |
| | | "desc":"可填,请填写消息队列,订单在异步调用时使用", |
| | | "required":false, |
| | | "hasDefaultValue":false, |
| | | "defaultValue":"", |
| | | "inputType":"textarea", |
| | | "inputType":"input", |
| | | "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" |
| | | "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":"超时时间必须为数字" |
| | | }, |
| | | { |
| | | "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" |
| | | } |
| | | |
| | | ] |
| | | } |
| | |
| | | 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 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.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="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> |