Parcourir la source

服务绑定开发完成

吴学文 il y a 7 ans
Parent
commit
079c979333

+ 196 - 0
Api/src/main/java/com/java110/api/listener/service/BindingServiceListener.java

@@ -0,0 +1,196 @@
+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.ResponseConstant;
+import com.java110.common.constant.ServiceCodeServiceConstant;
+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.factory.GenerateCodeFactory;
+import com.java110.core.smo.app.IAppInnerServiceSMO;
+import com.java110.core.smo.service.IRouteInnerServiceSMO;
+import com.java110.core.smo.service.IServiceInnerServiceSMO;
+import com.java110.dto.app.AppDto;
+import com.java110.dto.service.RouteDto;
+import com.java110.dto.service.ServiceDto;
+import com.java110.event.service.api.ServiceDataFlowEvent;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+
+@Java110Listener("bindingServiceListener")
+public class BindingServiceListener extends AbstractServiceApiListener {
+
+
+    @Autowired
+    private IAppInnerServiceSMO appInnerServiceSMOImpl;
+
+
+    @Autowired
+    private IServiceInnerServiceSMO serviceInnerServiceSMOImpl;
+
+
+    @Autowired
+    private IRouteInnerServiceSMO routeInnerServiceSMOImpl;
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+
+        JSONArray infos = reqJson.getJSONArray("data");
+
+        if(infos == null || infos.size() !=2){
+            throw new IllegalArgumentException("请求参数错误,为包含 应用或服务信息");
+        }
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        JSONArray infos = reqJson.getJSONArray("data");
+
+        JSONObject appInfo = null; //应用信息
+        JSONObject serviceInfo = null; // 服务信息
+
+        for(int infoIndex = 0 ; infoIndex < infos.size(); infoIndex ++){
+
+            Assert.hasKeyAndValue(infos.getJSONObject(infoIndex), "flowComponent", "未包含服务流程组件名称");
+
+            if("App".equals(infos.getJSONObject(infoIndex).getString("flowComponent"))){
+                appInfo = infos.getJSONObject(infoIndex);
+            }
+            if("Service".equals(infos.getJSONObject(infoIndex).getString("flowComponent"))){
+                serviceInfo = infos.getJSONObject(infoIndex);
+            }
+        }
+
+        Assert.notNull(appInfo, "未包含应用信息");
+        Assert.notNull(serviceInfo, "未包含服务信息");
+
+
+        //处理 应用信息
+        if(!appInfo.containsKey("appId")
+                || StringUtils.isEmpty(appInfo.getString("appId"))
+                || appInfo.getString("appId").startsWith("-")){
+            appInfo.put("appId", saveAppInfo(reqJson, appInfo));
+        }
+
+        //处理 服务信息
+        if(!serviceInfo.containsKey("servicdeId")
+                || StringUtils.isEmpty(serviceInfo.getString("servicdeId"))
+                || serviceInfo.getString("servicdeId").startsWith("-")){
+            serviceInfo.put("servicdeId", saveServiceInfo(reqJson, serviceInfo));
+        }
+
+        //处理路由信息
+
+        RouteDto routeDto = new RouteDto();
+        routeDto.setAppId(appInfo.getString("appId"));
+        routeDto.setServiceId(serviceInfo.getString("serviceId"));
+        routeDto.setInvokeLimitTimes("1000");
+        routeDto.setInvokeModel("S");
+        routeDto.setOrderTypeCd("Q");
+
+        int count = routeInnerServiceSMOImpl.saveRoute(routeDto);
+
+
+        if (count < 1) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "保存应用数据失败");
+        }
+
+
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(routeDto), HttpStatus.OK);
+
+        context.setResponseEntity(responseEntity);
+
+
+    }
+
+    /**
+     * 保存应用信息
+     * @param reqJson 请求报文信息
+     * @param appInfo 应用组件信息
+     * @return 应用ID
+     */
+    private String saveAppInfo(JSONObject reqJson, JSONObject appInfo){
+
+        AppDto appDto = BeanConvertUtil.covertBean(appInfo, AppDto.class);
+
+        appDto.setAppId(GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_id));
+
+        int count = appInnerServiceSMOImpl.saveApp(appDto);
+
+        if (count < 1) {
+            throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_ERROR, "保存应用数据失败");
+        }
+
+        return appDto.getAppId();
+    }
+
+    /**
+     * 保存服务信息
+     * @param reqJson 请求报文信息
+     * @param serviceInfo 服务组件信息
+     * @return 服务ID
+     */
+    private String saveServiceInfo(JSONObject reqJson, JSONObject serviceInfo){
+        ServiceDto serviceDto = BeanConvertUtil.covertBean(serviceInfo, 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, "保存服务数据失败");
+        }
+        return serviceDto.getServiceId();
+    }
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeServiceConstant.BINDING_SERVICES;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+
+    public IAppInnerServiceSMO getAppInnerServiceSMOImpl() {
+        return appInnerServiceSMOImpl;
+    }
+
+    public void setAppInnerServiceSMOImpl(IAppInnerServiceSMO appInnerServiceSMOImpl) {
+        this.appInnerServiceSMOImpl = appInnerServiceSMOImpl;
+    }
+
+
+    public IServiceInnerServiceSMO getServiceInnerServiceSMOImpl() {
+        return serviceInnerServiceSMOImpl;
+    }
+
+    public void setServiceInnerServiceSMOImpl(IServiceInnerServiceSMO serviceInnerServiceSMOImpl) {
+        this.serviceInnerServiceSMOImpl = serviceInnerServiceSMOImpl;
+    }
+
+    public IRouteInnerServiceSMO getRouteInnerServiceSMOImpl() {
+        return routeInnerServiceSMOImpl;
+    }
+
+    public void setRouteInnerServiceSMOImpl(IRouteInnerServiceSMO routeInnerServiceSMOImpl) {
+        this.routeInnerServiceSMOImpl = routeInnerServiceSMOImpl;
+    }
+}

+ 81 - 0
CommunityService/src/main/java/com/java110/community/dao/IRouteServiceDao.java

@@ -0,0 +1,81 @@
+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 IRouteServiceDao {
+
+    /**
+     * 保存 路由信息
+     * @param businessRouteInfo 路由信息 封装
+     * @throws DAOException 操作数据库异常
+     */
+    void saveBusinessRouteInfo(Map businessRouteInfo) throws DAOException;
+
+
+
+    /**
+     * 查询路由信息(business过程)
+     * 根据bId 查询路由信息
+     * @param info bId 信息
+     * @return 路由信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getBusinessRouteInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 保存 路由信息 Business数据到 Instance中
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    int saveRouteInfo(Map info) throws DAOException;
+
+
+
+
+    /**
+     * 查询路由信息(instance过程)
+     * 根据bId 查询路由信息
+     * @param info bId 信息
+     * @return 路由信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getRouteInfo(Map info) throws DAOException;
+
+
+
+    /**
+     * 修改路由信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    int updateRouteInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询路由总数
+     *
+     * @param info 路由信息
+     * @return 路由数量
+     */
+    int queryRoutesCount(Map info);
+
+}

+ 125 - 0
CommunityService/src/main/java/com/java110/community/dao/impl/RouteServiceDaoImpl.java

@@ -0,0 +1,125 @@
+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.IRouteServiceDao;
+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("routeServiceDaoImpl")
+//@Transactional
+public class RouteServiceDaoImpl extends BaseServiceDao implements IRouteServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(RouteServiceDaoImpl.class);
+
+    /**
+     * 路由信息封装
+     * @param businessRouteInfo 路由信息 封装
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveBusinessRouteInfo(Map businessRouteInfo) throws DAOException {
+        businessRouteInfo.put("month", DateUtil.getCurrentMonth());
+        // 查询business_user 数据是否已经存在
+        logger.debug("保存路由信息 入参 businessRouteInfo : {}",businessRouteInfo);
+        int saveFlag = sqlSessionTemplate.insert("routeServiceDaoImpl.saveBusinessRouteInfo",businessRouteInfo);
+
+        if(saveFlag < 1){
+            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR,"保存路由数据失败:"+ JSONObject.toJSONString(businessRouteInfo));
+        }
+    }
+
+
+    /**
+     * 查询路由信息
+     * @param info bId 信息
+     * @return 路由信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getBusinessRouteInfo(Map info) throws DAOException {
+
+        logger.debug("查询路由信息 入参 info : {}",info);
+
+        List<Map> businessRouteInfos = sqlSessionTemplate.selectList("routeServiceDaoImpl.getBusinessRouteInfo",info);
+
+        return businessRouteInfos;
+    }
+
+
+
+    /**
+     * 保存路由信息 到 instance
+     * @param info   bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int saveRouteInfo(Map info) throws DAOException {
+        logger.debug("保存路由信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.insert("routeServiceDaoImpl.saveRouteInfo",info);
+
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询路由信息(instance)
+     * @param info bId 信息
+     * @return List<Map>
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getRouteInfo(Map info) throws DAOException {
+        logger.debug("查询路由信息 入参 info : {}",info);
+
+        List<Map> businessRouteInfos = sqlSessionTemplate.selectList("routeServiceDaoImpl.getRouteInfo",info);
+
+        return businessRouteInfos;
+    }
+
+
+    /**
+     * 修改路由信息
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updateRouteInfo(Map info) throws DAOException {
+        logger.debug("修改路由信息Instance 入参 info : {}",info);
+
+        int saveFlag = sqlSessionTemplate.update("routeServiceDaoImpl.updateRouteInfo",info);
+
+        return saveFlag;
+    }
+
+     /**
+     * 查询路由数量
+     * @param info 路由信息
+     * @return 路由数量
+     */
+    @Override
+    public int queryRoutesCount(Map info) {
+        logger.debug("查询路由数据 入参 info : {}",info);
+
+        List<Map> businessRouteInfos = sqlSessionTemplate.selectList("routeServiceDaoImpl.queryRoutesCount", info);
+        if (businessRouteInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessRouteInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 87 - 0
CommunityService/src/main/java/com/java110/community/smo/impl/RouteInnerServiceSMOImpl.java

@@ -0,0 +1,87 @@
+package com.java110.community.smo.impl;
+
+
+import com.java110.common.util.BeanConvertUtil;
+import com.java110.community.dao.IRouteServiceDao;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.core.smo.service.IRouteInnerServiceSMO;
+import com.java110.core.smo.user.IUserInnerServiceSMO;
+import com.java110.dto.PageDto;
+import com.java110.dto.service.RouteDto;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RestController;
+
+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 RouteInnerServiceSMOImpl extends BaseServiceSMO implements IRouteInnerServiceSMO {
+
+    @Autowired
+    private IRouteServiceDao routeServiceDaoImpl;
+
+    @Autowired
+    private IUserInnerServiceSMO userInnerServiceSMOImpl;
+
+    @Override
+    public List<RouteDto> queryRoutes(@RequestBody  RouteDto routeDto) {
+
+        //校验是否传了 分页信息
+
+        int page = routeDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            routeDto.setPage((page - 1) * routeDto.getRow());
+            routeDto.setRow(page * routeDto.getRow());
+        }
+
+        List<RouteDto> routes = BeanConvertUtil.covertBeanList(routeServiceDaoImpl.getRouteInfo(BeanConvertUtil.beanCovertMap(routeDto)), RouteDto.class);
+
+
+        return routes;
+    }
+
+    @Override
+    public int updateRoute(@RequestBody RouteDto routeDto) {
+        return routeServiceDaoImpl.updateRouteInfo(BeanConvertUtil.beanCovertMap(routeDto));
+    }
+
+    @Override
+    public int saveRoute(@RequestBody RouteDto routeDto) {
+        return routeServiceDaoImpl.saveRouteInfo(BeanConvertUtil.beanCovertMap(routeDto));
+    }
+
+    @Override
+    public int deleteRoute(@RequestBody RouteDto routeDto) {
+        routeDto.setStatusCd("1");
+        return routeServiceDaoImpl.updateRouteInfo(BeanConvertUtil.beanCovertMap(routeDto));
+    }
+
+    @Override
+    public int queryRoutesCount(@RequestBody RouteDto routeDto) {
+        return routeServiceDaoImpl.queryRoutesCount(BeanConvertUtil.beanCovertMap(routeDto));    }
+
+    public IRouteServiceDao getRouteServiceDaoImpl() {
+        return routeServiceDaoImpl;
+    }
+
+    public void setRouteServiceDaoImpl(IRouteServiceDao routeServiceDaoImpl) {
+        this.routeServiceDaoImpl = routeServiceDaoImpl;
+    }
+
+    public IUserInnerServiceSMO getUserInnerServiceSMOImpl() {
+        return userInnerServiceSMOImpl;
+    }
+
+    public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) {
+        this.userInnerServiceSMOImpl = userInnerServiceSMOImpl;
+    }
+}

+ 35 - 0
WebService/src/main/java/com/java110/web/components/service/ServiceBindingComponent.java

@@ -0,0 +1,35 @@
+package com.java110.web.components.service;
+
+
+import com.java110.core.context.IPageData;
+import com.java110.web.smo.service.IBindingServiceSMO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+
+/**
+ * 服务绑定组件类
+ */
+@Component("serviceBinding")
+public class ServiceBindingComponent {
+
+    @Autowired
+    private IBindingServiceSMO bindingServiceSMOImpl;
+
+    /**
+     * 服务绑定
+     * @param pd 页面数据封装
+     * @return 返回 ResponseEntity对象
+     */
+    public ResponseEntity<String> binding(IPageData pd){
+       return bindingServiceSMOImpl.binding(pd);
+    }
+
+    public IBindingServiceSMO getBindingServiceSMOImpl() {
+        return bindingServiceSMOImpl;
+    }
+
+    public void setBindingServiceSMOImpl(IBindingServiceSMO bindingServiceSMOImpl) {
+        this.bindingServiceSMOImpl = bindingServiceSMOImpl;
+    }
+}

+ 13 - 0
WebService/src/main/java/com/java110/web/smo/service/IBindingServiceSMO.java

@@ -0,0 +1,13 @@
+package com.java110.web.smo.service;
+
+import com.java110.core.context.IPageData;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 服务绑定接口类
+ */
+public interface IBindingServiceSMO {
+
+    //绑定服务
+    public ResponseEntity<String> binding(IPageData pd);
+}

+ 58 - 0
WebService/src/main/java/com/java110/web/smo/service/impl/BindingServiceSMOImpl.java

@@ -0,0 +1,58 @@
+package com.java110.web.smo.service.impl;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+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.IBindingServiceSMO;
+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;
+
+/**
+ * 绑定服务处理类
+ */
+@Service("bindingServiceSMOImpl")
+public class BindingServiceSMOImpl extends AbstractComponentSMO implements IBindingServiceSMO {
+
+    @Autowired
+    private RestTemplate restTemplate;
+    @Override
+    protected void validate(IPageData pd, JSONObject paramIn) {
+        Assert.hasKeyAndValue(paramIn, "data", "未包含data节点请处理");
+
+        JSONArray infos = paramIn.getJSONArray("data");
+
+        if(infos == null || infos.size() !=2){
+            throw new IllegalArgumentException("请求参数错误,为包含 应用或服务信息");
+        }
+    }
+
+    @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.bindingService",
+                HttpMethod.POST);
+        return responseEntity;
+    }
+
+    @Override
+    public ResponseEntity<String> binding(IPageData pd) {
+        return super.businessProcess(pd);
+    }
+
+    public RestTemplate getRestTemplate() {
+        return restTemplate;
+    }
+
+    public void setRestTemplate(RestTemplate restTemplate) {
+        this.restTemplate = restTemplate;
+    }
+}

+ 24 - 0
WebService/src/main/resources/components/service-binding/serviceBinding.js

@@ -52,6 +52,30 @@
             },
             _finishStep:function(){
 
+                var param = {
+                    data:vc.component.serviceBindingInfo.info
+                }
+
+               vc.http.post(
+                   'serviceBinding',
+                   'binding',
+                   JSON.stringify(param),
+                   {
+                       emulateJSON:true
+                    },
+                    function(json,res){
+                       if(res.status == 200){
+                           //关闭model
+                           //vc.jumpToPage("/flow/ownerRoomFlow?" + vc.objToGetParam(vc.component.sellRoomInfo.ownerInfo));
+                           return ;
+                       }
+                       vc.message(json);
+                    },
+                    function(errInfo,error){
+                       console.log('请求失败处理');
+
+                       vc.message(errInfo);
+                    });
             }
         }
     });

+ 1 - 0
WebService/src/main/resources/components/view-app-info/viewAppInfo.js

@@ -11,6 +11,7 @@
         data:{
             viewAppInfo:{
                 index:0,
+                flowComponent:'App',
                 appId:"",
                 name:"",
                 securityCode:"",

+ 1 - 0
WebService/src/main/resources/components/view-service-info/viewServiceInfo.js

@@ -12,6 +12,7 @@
             viewServiceInfo:{
                 index:0,
                 serviceId:"",
+                flowComponent:'Service',
                 name:"",
                 securityCode:"",
                 whileListIp:"",

+ 84 - 0
java110-bean/src/main/java/com/java110/dto/service/RouteDto.java

@@ -0,0 +1,84 @@
+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 RouteDto extends PageDto implements Serializable {
+
+    private String invokeLimitTimes;
+private String orderTypeCd;
+private String appId;
+private String id;
+private String serviceId;
+private String invokeModel;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getInvokeLimitTimes() {
+        return invokeLimitTimes;
+    }
+public void setInvokeLimitTimes(String invokeLimitTimes) {
+        this.invokeLimitTimes = invokeLimitTimes;
+    }
+public String getOrderTypeCd() {
+        return orderTypeCd;
+    }
+public void setOrderTypeCd(String orderTypeCd) {
+        this.orderTypeCd = orderTypeCd;
+    }
+public String getAppId() {
+        return appId;
+    }
+public void setAppId(String appId) {
+        this.appId = appId;
+    }
+public String getId() {
+        return id;
+    }
+public void setId(String id) {
+        this.id = id;
+    }
+public String getServiceId() {
+        return serviceId;
+    }
+public void setServiceId(String serviceId) {
+        this.serviceId = serviceId;
+    }
+public String getInvokeModel() {
+        return invokeModel;
+    }
+public void setInvokeModel(String invokeModel) {
+        this.invokeModel = invokeModel;
+    }
+
+
+    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;
+    }
+}

+ 80 - 0
java110-code-generator/src/main/java/com/java110/RouteGeneratorApplication.java

@@ -0,0 +1,80 @@
+package com.java110;
+
+
+import com.java110.code.*;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Hello world!
+ */
+public class RouteGeneratorApplication {
+
+    protected RouteGeneratorApplication() {
+        // prevents calls from subclass
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * 代码生成器 入口方法
+     *
+     * @param args 参数
+     */
+    public static void main(String[] args) {
+        Data data = new Data();
+        data.setId("id");
+        data.setName("route");
+        data.setDesc("路由");
+        data.setShareParam("id");
+        data.setShareColumn("id");
+        data.setNewBusinessTypeCd("BUSINESS_TYPE_SAVE_NOTICE");
+        data.setUpdateBusinessTypeCd("BUSINESS_TYPE_UPDATE_NOTICE");
+        data.setDeleteBusinessTypeCd("BUSINESS_TYPE_DELETE_NOTICE");
+        data.setNewBusinessTypeCdValue("550100030001");
+        data.setUpdateBusinessTypeCdValue("550100040001");
+        data.setDeleteBusinessTypeCdValue("550100050001");
+        data.setBusinessTableName("business_route");
+        data.setTableName("c_route");
+        Map<String, String> param = new HashMap<String, String>();
+        param.put("id", "id");
+        param.put("appId", "app_id");
+        param.put("serviceId", "service_id");
+        param.put("orderTypeCd", "order_type_cd");
+        param.put("invokeLimitTimes", "invoke_limit_times");
+        param.put("invokeModel", "invoke_model");
+        param.put("statusCd", "status_cd");
+        param.put("operate", "operate");
+        data.setParams(param);
+        GeneratorSaveInfoListener generatorSaveInfoListener = new GeneratorSaveInfoListener();
+        generatorSaveInfoListener.generator(data);
+
+        GeneratorAbstractBussiness generatorAbstractBussiness = new GeneratorAbstractBussiness();
+        generatorAbstractBussiness.generator(data);
+
+        GeneratorIServiceDaoListener generatorIServiceDaoListener = new GeneratorIServiceDaoListener();
+        generatorIServiceDaoListener.generator(data);
+
+        GeneratorServiceDaoImplListener generatorServiceDaoImplListener = new GeneratorServiceDaoImplListener();
+        generatorServiceDaoImplListener.generator(data);
+
+        GeneratorServiceDaoImplMapperListener generatorServiceDaoImplMapperListener = null;
+        generatorServiceDaoImplMapperListener = new GeneratorServiceDaoImplMapperListener();
+        generatorServiceDaoImplMapperListener.generator(data);
+
+        GeneratorUpdateInfoListener generatorUpdateInfoListener = new GeneratorUpdateInfoListener();
+        generatorUpdateInfoListener.generator(data);
+
+        GeneratorDeleteInfoListener generatorDeleteInfoListener = new GeneratorDeleteInfoListener();
+        generatorDeleteInfoListener.generator(data);
+
+        GeneratorInnerServiceSMOImpl generatorInnerServiceSMOImpl = new GeneratorInnerServiceSMOImpl();
+        generatorInnerServiceSMOImpl.generator(data);
+
+        GeneratorDtoBean generatorDtoBean = new GeneratorDtoBean();
+        generatorDtoBean.generator(data);
+
+        GeneratorIInnerServiceSMO generatorIInnerServiceSMO = new GeneratorIInnerServiceSMO();
+        generatorIInnerServiceSMO.generator(data);
+    }
+}

+ 7 - 0
java110-common/src/main/java/com/java110/common/constant/ServiceCodeServiceConstant.java

@@ -28,4 +28,11 @@ public class ServiceCodeServiceConstant {
     public static final String LIST_SERVICES = "service.listServices";
 
 
+
+    /**
+     * 绑定 服务
+     */
+    public static final String BINDING_SERVICES = "service.bindingServices";
+
+
 }

+ 73 - 0
java110-core/src/main/java/com/java110/core/smo/service/IRouteInnerServiceSMO.java

@@ -0,0 +1,73 @@
+package com.java110.core.smo.service;
+
+import com.java110.core.feign.FeignConfiguration;
+import com.java110.dto.service.RouteDto;
+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 IRouteInnerServiceSMO
+ * @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("/routeApi")
+public interface IRouteInnerServiceSMO {
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param routeDto 数据对象分享
+     * @return RouteDto 对象数据
+     */
+    @RequestMapping(value = "/queryRoutes", method = RequestMethod.POST)
+    List<RouteDto> queryRoutes(@RequestBody RouteDto routeDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param routeDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryRoutesCount", method = RequestMethod.POST)
+    int queryRoutesCount(@RequestBody RouteDto routeDto);
+
+    /**
+     * <p>修改APP信息</p>
+     *
+     *
+     * @param routeDto 数据对象分享
+     * @return ServiceDto 对象数据
+     */
+    @RequestMapping(value = "/updateRoute", method = RequestMethod.POST)
+    int updateRoute(@RequestBody RouteDto routeDto);
+
+
+    /**
+     * <p>添加APP信息</p>
+     *
+     *
+     * @param routeDto 数据对象分享
+     * @return RouteDto 对象数据
+     */
+    @RequestMapping(value = "/saveRoute", method = RequestMethod.POST)
+    int saveRoute(@RequestBody RouteDto routeDto);
+
+    /**
+     * <p>删除APP信息</p>
+     *
+     *
+     * @param routeDto 数据对象分享
+     * @return RouteDto 对象数据
+     */
+    @RequestMapping(value = "/deleteRoute", method = RequestMethod.POST)
+    int deleteRoute(@RequestBody RouteDto routeDto);
+}

+ 152 - 0
java110-db/src/main/resources/mapper/service/RouteServiceDaoImplMapper.xml

@@ -0,0 +1,152 @@
+<?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="routeServiceDaoImpl">
+
+    <!-- 保存路由信息 add by wuxw 2018-07-03 -->
+       <insert id="saveBusinessRouteInfo" parameterType="Map">
+           insert into business_route(
+invoke_limit_times,order_type_cd,operate,app_id,id,service_id,invoke_model
+) values (
+#{invokeLimitTimes},#{orderTypeCd},#{operate},#{appId},#{id},#{serviceId},#{invokeModel}
+)
+       </insert>
+
+
+       <!-- 查询路由信息(Business) add by wuxw 2018-07-03 -->
+       <select id="getBusinessRouteInfo" parameterType="Map" resultType="Map">
+           select  t.invoke_limit_times,t.invoke_limit_times invokeLimitTimes,t.order_type_cd,t.order_type_cd orderTypeCd,t.operate,t.app_id,t.app_id appId,t.id,t.service_id,t.service_id serviceId,t.invoke_model,t.invoke_model invokeModel 
+from business_route t 
+where 1 =1 
+<if test="invokeLimitTimes !=null and invokeLimitTimes != ''">
+   and t.invoke_limit_times= #{invokeLimitTimes}
+</if> 
+<if test="orderTypeCd !=null and orderTypeCd != ''">
+   and t.order_type_cd= #{orderTypeCd}
+</if> 
+<if test="operate !=null and operate != ''">
+   and t.operate= #{operate}
+</if> 
+<if test="appId !=null and appId != ''">
+   and t.app_id= #{appId}
+</if> 
+<if test="id !=null and id != ''">
+   and t.id= #{id}
+</if> 
+<if test="serviceId !=null and serviceId != ''">
+   and t.service_id= #{serviceId}
+</if> 
+<if test="invokeModel !=null and invokeModel != ''">
+   and t.invoke_model= #{invokeModel}
+</if> 
+
+       </select>
+
+
+
+
+
+    <!-- 保存路由信息至 instance表中 add by wuxw 2018-07-03 -->
+    <insert id="saveRouteInfo" parameterType="Map">
+        insert into c_route(
+            invoke_limit_times,order_type_cd,app_id,id,service_id,invoke_model
+        ) values (
+            #{invokeLimitTimes},#{orderTypeCd},#{appId},#{id},#{serviceId},#{invokeModel}
+        )
+
+    </insert>
+
+
+
+    <!-- 查询路由信息 add by wuxw 2018-07-03 -->
+    <select id="getRouteInfo" parameterType="Map" resultType="Map">
+        select  t.invoke_limit_times,t.invoke_limit_times invokeLimitTimes,t.order_type_cd,t.order_type_cd orderTypeCd,t.app_id,t.app_id appId,t.status_cd,t.status_cd statusCd,t.id,t.service_id,t.service_id serviceId,t.invoke_model,t.invoke_model invokeModel 
+from c_route t 
+where 1 =1 
+<if test="invokeLimitTimes !=null and invokeLimitTimes != ''">
+   and t.invoke_limit_times= #{invokeLimitTimes}
+</if> 
+<if test="orderTypeCd !=null and orderTypeCd != ''">
+   and t.order_type_cd= #{orderTypeCd}
+</if> 
+<if test="appId !=null and appId != ''">
+   and t.app_id= #{appId}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="id !=null and id != ''">
+   and t.id= #{id}
+</if> 
+<if test="serviceId !=null and serviceId != ''">
+   and t.service_id= #{serviceId}
+</if> 
+<if test="invokeModel !=null and invokeModel != ''">
+   and t.invoke_model= #{invokeModel}
+</if> 
+<if test="page != -1 and page != null ">
+   limit #{page}, #{row}
+</if> 
+
+    </select>
+
+
+
+
+    <!-- 修改路由信息 add by wuxw 2018-07-03 -->
+    <update id="updateRouteInfo" parameterType="Map">
+        update  c_route t set t.status_cd = #{statusCd}
+
+<if test="invokeLimitTimes !=null and invokeLimitTimes != ''">
+, t.invoke_limit_times= #{invokeLimitTimes}
+</if> 
+<if test="orderTypeCd !=null and orderTypeCd != ''">
+, t.order_type_cd= #{orderTypeCd}
+</if> 
+<if test="appId !=null and appId != ''">
+, t.app_id= #{appId}
+</if> 
+<if test="serviceId !=null and serviceId != ''">
+, t.service_id= #{serviceId}
+</if> 
+<if test="invokeModel !=null and invokeModel != ''">
+, t.invoke_model= #{invokeModel}
+</if> 
+ where 1=1<if test="id !=null and id != ''">
+and t.id= #{id}
+</if> 
+
+    </update>
+
+    <!-- 查询路由数量 add by wuxw 2018-07-03 -->
+     <select id="queryRoutesCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from c_route t 
+where 1 =1 
+<if test="invokeLimitTimes !=null and invokeLimitTimes != ''">
+   and t.invoke_limit_times= #{invokeLimitTimes}
+</if> 
+<if test="orderTypeCd !=null and orderTypeCd != ''">
+   and t.order_type_cd= #{orderTypeCd}
+</if> 
+<if test="appId !=null and appId != ''">
+   and t.app_id= #{appId}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="id !=null and id != ''">
+   and t.id= #{id}
+</if> 
+<if test="serviceId !=null and serviceId != ''">
+   and t.service_id= #{serviceId}
+</if> 
+<if test="invokeModel !=null and invokeModel != ''">
+   and t.invoke_model= #{invokeModel}
+</if> 
+
+
+     </select>
+
+</mapper>