Просмотр исходного кода

映射编码功能开发完成

吴学文 лет назад: 6
Родитель
Сommit
9798883dfc
38 измененных файлов с 2433 добавлено и 112 удалено
  1. 82 0
      Api/src/main/java/com/java110/api/listener/mapping/DeleteMappingListener.java
  2. 91 0
      Api/src/main/java/com/java110/api/listener/mapping/ListMappingsListener.java
  3. 87 0
      Api/src/main/java/com/java110/api/listener/mapping/SaveMappingListener.java
  4. 83 0
      Api/src/main/java/com/java110/api/listener/mapping/UpdateMappingListener.java
  5. 75 0
      CommunityService/src/main/java/com/java110/community/dao/IMappingServiceDao.java
  6. 129 0
      CommunityService/src/main/java/com/java110/community/dao/impl/MappingServiceDaoImpl.java
  7. 89 0
      CommunityService/src/main/java/com/java110/community/smo/impl/MappingInnerServiceSMOImpl.java
  8. 34 0
      WebService/src/main/java/com/java110/web/components/mapping/AddMappingComponent.java
  9. 34 0
      WebService/src/main/java/com/java110/web/components/mapping/DeleteMappingComponent.java
  10. 34 0
      WebService/src/main/java/com/java110/web/components/mapping/EditMappingComponent.java
  11. 41 0
      WebService/src/main/java/com/java110/web/components/mapping/MappingManageComponent.java
  12. 19 0
      WebService/src/main/java/com/java110/web/smo/mapping/IAddMappingSMO.java
  13. 19 0
      WebService/src/main/java/com/java110/web/smo/mapping/IDeleteMappingSMO.java
  14. 19 0
      WebService/src/main/java/com/java110/web/smo/mapping/IEditMappingSMO.java
  15. 21 0
      WebService/src/main/java/com/java110/web/smo/mapping/IListMappingsSMO.java
  16. 68 0
      WebService/src/main/java/com/java110/web/smo/mapping/impl/AddMappingSMOImpl.java
  17. 63 0
      WebService/src/main/java/com/java110/web/smo/mapping/impl/DeleteMappingSMOImpl.java
  18. 66 0
      WebService/src/main/java/com/java110/web/smo/mapping/impl/EditMappingSMOImpl.java
  19. 66 0
      WebService/src/main/java/com/java110/web/smo/mapping/impl/ListMappingsSMOImpl.java
  20. 62 0
      WebService/src/main/resources/components/add-mapping/addMapping.html
  21. 137 0
      WebService/src/main/resources/components/add-mapping/addMapping.js
  22. 19 0
      WebService/src/main/resources/components/delete-mapping/deleteMapping.html
  23. 52 0
      WebService/src/main/resources/components/delete-mapping/deleteMapping.js
  24. 49 0
      WebService/src/main/resources/components/edit-mapping/editMapping.html
  25. 138 0
      WebService/src/main/resources/components/edit-mapping/editMapping.js
  26. 66 0
      WebService/src/main/resources/components/mapping-manage/mappingManage.html
  27. 64 0
      WebService/src/main/resources/components/mapping-manage/mappingManage.js
  28. 33 0
      WebService/src/main/resources/views/mappingFlow.html
  29. 84 0
      java110-bean/src/main/java/com/java110/dto/mapping/MappingDto.java
  30. 53 0
      java110-bean/src/main/java/com/java110/vo/api/mapping/ApiMappingDataVo.java
  31. 19 0
      java110-bean/src/main/java/com/java110/vo/api/mapping/ApiMappingVo.java
  32. 80 0
      java110-code-generator/src/main/java/com/java110/MappingGeneratorApplication.java
  33. 36 112
      java110-code-generator/src/main/resources/web/template_1.json
  34. 146 0
      java110-code-generator/src/main/resources/web/template_service.json
  35. 1 0
      java110-common/src/main/java/com/java110/common/constant/PrivilegeCodeConstant.java
  36. 31 0
      java110-common/src/main/java/com/java110/common/constant/ServiceCodeMappingConstant.java
  37. 74 0
      java110-core/src/main/java/com/java110/core/smo/mapping/IMappingInnerServiceSMO.java
  38. 169 0
      java110-db/src/main/resources/mapper/mapping/MappingServiceDaoImplMapper.xml

+ 82 - 0
Api/src/main/java/com/java110/api/listener/mapping/DeleteMappingListener.java

@@ -0,0 +1,82 @@
+package com.java110.api.listener.mapping;
+
+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.mapping.IMappingInnerServiceSMO;
+import com.java110.dto.mapping.MappingDto;
+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("deleteMappingListener")
+public class DeleteMappingListener extends AbstractServiceApiListener {
+
+
+    @Autowired
+    private IMappingInnerServiceSMO mappingInnerServiceSMOImpl;
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
+
+        Assert.hasKeyAndValue(reqJson, "id", "编码ID不能为空");
+
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        MappingDto mappingDto = BeanConvertUtil.covertBean(reqJson, MappingDto.class);
+
+        int count = mappingInnerServiceSMOImpl.deleteMapping(mappingDto);
+
+        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 ServiceCodeMappingConstant.DELETE_MAPPING;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+
+
+
+    public IMappingInnerServiceSMO getMappingInnerServiceSMOImpl() {
+        return mappingInnerServiceSMOImpl;
+    }
+
+    public void setMappingInnerServiceSMOImpl(IMappingInnerServiceSMO mappingInnerServiceSMOImpl) {
+        this.mappingInnerServiceSMOImpl = mappingInnerServiceSMOImpl;
+    }
+}

+ 91 - 0
Api/src/main/java/com/java110/api/listener/mapping/ListMappingsListener.java

@@ -0,0 +1,91 @@
+package com.java110.api.listener.mapping;
+
+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.mapping.IMappingInnerServiceSMO;
+import com.java110.dto.mapping.MappingDto;
+import com.java110.event.service.api.ServiceDataFlowEvent;
+import com.java110.vo.api.mapping.ApiMappingDataVo;
+import com.java110.vo.api.mapping.ApiMappingVo;
+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.ServiceCodeMappingConstant;
+
+import java.util.ArrayList;
+import java.util.List;
+
+
+/**
+ * 查询小区侦听类
+ */
+@Java110Listener("listMappingsListener")
+public class ListMappingsListener extends AbstractServiceApiListener {
+
+    @Autowired
+    private IMappingInnerServiceSMO mappingInnerServiceSMOImpl;
+
+    @Override
+    public String getServiceCode() {
+        return ServiceCodeMappingConstant.LIST_MAPPINGS;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.GET;
+    }
+
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+
+    public IMappingInnerServiceSMO getMappingInnerServiceSMOImpl() {
+        return mappingInnerServiceSMOImpl;
+    }
+
+    public void setMappingInnerServiceSMOImpl(IMappingInnerServiceSMO mappingInnerServiceSMOImpl) {
+        this.mappingInnerServiceSMOImpl = mappingInnerServiceSMOImpl;
+    }
+
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        super.validatePageInfo(reqJson);
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        MappingDto mappingDto = BeanConvertUtil.covertBean(reqJson, MappingDto.class);
+
+        int count = mappingInnerServiceSMOImpl.queryMappingsCount(mappingDto);
+
+        List<ApiMappingDataVo> mappings = null;
+
+        if (count > 0) {
+            mappings = BeanConvertUtil.covertBeanList(mappingInnerServiceSMOImpl.queryMappings(mappingDto), ApiMappingDataVo.class);
+        } else {
+            mappings = new ArrayList<>();
+        }
+
+        ApiMappingVo apiMappingVo = new ApiMappingVo();
+
+        apiMappingVo.setTotal(count);
+        apiMappingVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row")));
+        apiMappingVo.setMappings(mappings);
+
+        ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiMappingVo), HttpStatus.OK);
+
+        context.setResponseEntity(responseEntity);
+
+    }
+}

+ 87 - 0
Api/src/main/java/com/java110/api/listener/mapping/SaveMappingListener.java

@@ -0,0 +1,87 @@
+package com.java110.api.listener.mapping;
+
+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.mapping.IMappingInnerServiceSMO;
+import com.java110.dto.mapping.MappingDto;
+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("saveMappingListener")
+public class SaveMappingListener extends AbstractServiceApiListener {
+
+
+    @Autowired
+    private IMappingInnerServiceSMO mappingInnerServiceSMOImpl;
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
+
+        Assert.hasKeyAndValue(reqJson, "domain", "必填,请填写域");
+Assert.hasKeyAndValue(reqJson, "name", "必填,请填写名称");
+Assert.hasKeyAndValue(reqJson, "key", "必填,请填写键");
+Assert.hasKeyAndValue(reqJson, "value", "必填,请填写值");
+
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        MappingDto mappingDto = BeanConvertUtil.covertBean(reqJson, MappingDto.class);
+
+        int count = mappingInnerServiceSMOImpl.saveMapping(mappingDto);
+
+
+
+        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 ServiceCodeMappingConstant.ADD_MAPPING;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+
+    public IMappingInnerServiceSMO getMappingInnerServiceSMOImpl() {
+        return mappingInnerServiceSMOImpl;
+    }
+
+    public void setMappingInnerServiceSMOImpl(IMappingInnerServiceSMO mappingInnerServiceSMOImpl) {
+        this.mappingInnerServiceSMOImpl = mappingInnerServiceSMOImpl;
+    }
+}

+ 83 - 0
Api/src/main/java/com/java110/api/listener/mapping/UpdateMappingListener.java

@@ -0,0 +1,83 @@
+package com.java110.api.listener.mapping;
+
+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.mapping.IMappingInnerServiceSMO;
+import com.java110.dto.mapping.MappingDto;
+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("updateMappingListener")
+public class UpdateMappingListener extends AbstractServiceApiListener {
+
+    @Autowired
+    private IMappingInnerServiceSMO mappingInnerServiceSMOImpl;
+    @Override
+    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
+
+        Assert.hasKeyAndValue(reqJson, "id", "编码ID不能为空");
+Assert.hasKeyAndValue(reqJson, "domain", "必填,请填写域");
+Assert.hasKeyAndValue(reqJson, "name", "必填,请填写名称");
+Assert.hasKeyAndValue(reqJson, "key", "必填,请填写键");
+Assert.hasKeyAndValue(reqJson, "value", "必填,请填写值");
+
+    }
+
+    @Override
+    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
+
+        MappingDto mappingDto = BeanConvertUtil.covertBean(reqJson, MappingDto.class);
+
+        int count = mappingInnerServiceSMOImpl.updateMapping(mappingDto);
+
+
+
+        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 ServiceCodeMappingConstant.UPDATE_MAPPING;
+    }
+
+    @Override
+    public HttpMethod getHttpMethod() {
+        return HttpMethod.POST;
+    }
+
+    @Override
+    public int getOrder() {
+        return DEFAULT_ORDER;
+    }
+
+
+    public IMappingInnerServiceSMO getMappingInnerServiceSMOImpl() {
+        return mappingInnerServiceSMOImpl;
+    }
+
+    public void setMappingInnerServiceSMOImpl(IMappingInnerServiceSMO mappingInnerServiceSMOImpl) {
+        this.mappingInnerServiceSMOImpl = mappingInnerServiceSMOImpl;
+    }
+}

+ 75 - 0
CommunityService/src/main/java/com/java110/community/dao/IMappingServiceDao.java

@@ -0,0 +1,75 @@
+package com.java110.community.dao;
+
+
+import com.java110.common.exception.DAOException;
+
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 映射组件内部之间使用,没有给外围系统提供服务能力
+ * 映射服务接口类,要求全部以字符串传输,方便微服务化
+ * 新建客户,修改客户,删除客户,查询客户等功能
+ * <p>
+ * Created by wuxw on 2016/12/27.
+ */
+public interface IMappingServiceDao {
+
+    /**
+     * 保存 映射信息
+     *
+     * @param businessMappingInfo 映射信息 封装
+     * @throws DAOException 操作数据库异常
+     */
+    int saveMappingInfo(Map businessMappingInfo) throws DAOException;
+
+
+    /**
+     * 查询映射信息(business过程)
+     * 根据bId 查询映射信息
+     *
+     * @param info bId 信息
+     * @return 映射信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getBusinessMappingInfo(Map info) throws DAOException;
+
+
+    /**
+     * 保存 映射信息 Business数据到 Instance中
+     *
+     * @param info
+     * @throws DAOException DAO异常
+     */
+    void saveMappingInfoInstance(Map info) throws DAOException;
+
+
+    /**
+     * 查询映射信息(instance过程)
+     * 根据bId 查询映射信息
+     *
+     * @param info bId 信息
+     * @return 映射信息
+     * @throws DAOException DAO异常
+     */
+    List<Map> getMappingInfo(Map info) throws DAOException;
+
+
+    /**
+     * 修改映射信息
+     *
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    int updateMappingInfo(Map info) throws DAOException;
+
+
+    /**
+     * 查询映射总数
+     *
+     * @param info 映射信息
+     * @return 映射数量
+     */
+    int queryMappingsCount(Map info);
+
+}

+ 129 - 0
CommunityService/src/main/java/com/java110/community/dao/impl/MappingServiceDaoImpl.java

@@ -0,0 +1,129 @@
+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.IMappingServiceDao;
+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("mappingServiceDaoImpl")
+//@Transactional
+public class MappingServiceDaoImpl extends BaseServiceDao implements IMappingServiceDao {
+
+    private static Logger logger = LoggerFactory.getLogger(MappingServiceDaoImpl.class);
+
+    /**
+     * 映射信息封装
+     *
+     * @param businessMappingInfo 映射信息 封装
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int saveMappingInfo(Map businessMappingInfo) throws DAOException {
+        businessMappingInfo.put("month", DateUtil.getCurrentMonth());
+        // 查询business_user 数据是否已经存在
+        logger.debug("保存映射信息 入参 businessMappingInfo : {}", businessMappingInfo);
+        int saveFlag = sqlSessionTemplate.insert("mappingServiceDaoImpl.saveMappingInfo", businessMappingInfo);
+        return saveFlag;
+    }
+
+
+    /**
+     * 查询映射信息
+     *
+     * @param info bId 信息
+     * @return 映射信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public List<Map> getBusinessMappingInfo(Map info) throws DAOException {
+
+        logger.debug("查询映射信息 入参 info : {}", info);
+
+        List<Map> businessMappingInfos = sqlSessionTemplate.selectList("mappingServiceDaoImpl.getBusinessMappingInfo", info);
+
+        return businessMappingInfos;
+    }
+
+
+    /**
+     * 保存映射信息 到 instance
+     *
+     * @param info bId 信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public void saveMappingInfoInstance(Map info) throws DAOException {
+        logger.debug("保存映射信息Instance 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.insert("mappingServiceDaoImpl.saveMappingInfoInstance", 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> getMappingInfo(Map info) throws DAOException {
+        logger.debug("查询映射信息 入参 info : {}", info);
+
+        List<Map> businessMappingInfos = sqlSessionTemplate.selectList("mappingServiceDaoImpl.getMappingInfo", info);
+
+        return businessMappingInfos;
+    }
+
+
+    /**
+     * 修改映射信息
+     *
+     * @param info 修改信息
+     * @throws DAOException DAO异常
+     */
+    @Override
+    public int updateMappingInfo(Map info) throws DAOException {
+        logger.debug("修改映射信息Instance 入参 info : {}", info);
+
+        int saveFlag = sqlSessionTemplate.update("mappingServiceDaoImpl.updateMappingInfo", info);
+
+       return saveFlag;
+    }
+
+    /**
+     * 查询映射数量
+     *
+     * @param info 映射信息
+     * @return 映射数量
+     */
+    @Override
+    public int queryMappingsCount(Map info) {
+        logger.debug("查询映射数据 入参 info : {}", info);
+
+        List<Map> businessMappingInfos = sqlSessionTemplate.selectList("mappingServiceDaoImpl.queryMappingsCount", info);
+        if (businessMappingInfos.size() < 1) {
+            return 0;
+        }
+
+        return Integer.parseInt(businessMappingInfos.get(0).get("count").toString());
+    }
+
+
+}

+ 89 - 0
CommunityService/src/main/java/com/java110/community/smo/impl/MappingInnerServiceSMOImpl.java

@@ -0,0 +1,89 @@
+package com.java110.community.smo.impl;
+
+
+import com.java110.common.constant.StatusConstant;
+import com.java110.common.util.BeanConvertUtil;
+import com.java110.community.dao.IMappingServiceDao;
+import com.java110.core.base.smo.BaseServiceSMO;
+import com.java110.core.smo.mapping.IMappingInnerServiceSMO;
+import com.java110.core.smo.user.IUserInnerServiceSMO;
+import com.java110.dto.PageDto;
+import com.java110.dto.mapping.MappingDto;
+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 MappingInnerServiceSMOImpl extends BaseServiceSMO implements IMappingInnerServiceSMO {
+
+    @Autowired
+    private IMappingServiceDao mappingServiceDaoImpl;
+
+    @Autowired
+    private IUserInnerServiceSMO userInnerServiceSMOImpl;
+
+    @Override
+    public List<MappingDto> queryMappings(@RequestBody MappingDto mappingDto) {
+
+        //校验是否传了 分页信息
+
+        int page = mappingDto.getPage();
+
+        if (page != PageDto.DEFAULT_PAGE) {
+            mappingDto.setPage((page - 1) * mappingDto.getRow());
+            mappingDto.setRow(page * mappingDto.getRow());
+        }
+
+        List<MappingDto> mappings = BeanConvertUtil.covertBeanList(mappingServiceDaoImpl.getMappingInfo(BeanConvertUtil.beanCovertMap(mappingDto)), MappingDto.class);
+
+
+        return mappings;
+    }
+
+    @Override
+    public int queryMappingsCount(@RequestBody MappingDto mappingDto) {
+        return mappingServiceDaoImpl.queryMappingsCount(BeanConvertUtil.beanCovertMap(mappingDto));
+    }
+
+    @Override
+    public int updateMapping(@RequestBody MappingDto serviceDto) {
+        return mappingServiceDaoImpl.updateMappingInfo(BeanConvertUtil.beanCovertMap(serviceDto));
+    }
+
+    @Override
+    public int saveMapping(@RequestBody MappingDto serviceDto) {
+        return mappingServiceDaoImpl.saveMappingInfo(BeanConvertUtil.beanCovertMap(serviceDto));
+    }
+
+    @Override
+    public int deleteMapping(@RequestBody MappingDto serviceDto) {
+        serviceDto.setStatusCd(StatusConstant.STATUS_CD_INVALID);
+        return mappingServiceDaoImpl.updateMappingInfo(BeanConvertUtil.beanCovertMap(serviceDto));
+    }
+
+    public IMappingServiceDao getMappingServiceDaoImpl() {
+        return mappingServiceDaoImpl;
+    }
+
+    public void setMappingServiceDaoImpl(IMappingServiceDao mappingServiceDaoImpl) {
+        this.mappingServiceDaoImpl = mappingServiceDaoImpl;
+    }
+
+    public IUserInnerServiceSMO getUserInnerServiceSMOImpl() {
+        return userInnerServiceSMOImpl;
+    }
+
+    public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) {
+        this.userInnerServiceSMOImpl = userInnerServiceSMOImpl;
+    }
+}

+ 34 - 0
WebService/src/main/java/com/java110/web/components/mapping/AddMappingComponent.java

@@ -0,0 +1,34 @@
+package com.java110.web.components.mapping;
+
+import com.java110.core.context.IPageData;
+import com.java110.web.smo.mapping.IAddMappingSMO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+
+/**
+ * 添加编码映射组件
+ */
+@Component("addMapping")
+public class AddMappingComponent {
+
+    @Autowired
+    private IAddMappingSMO addMappingSMOImpl;
+
+    /**
+     * 添加编码映射数据
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象
+     */
+    public ResponseEntity<String> save(IPageData pd){
+        return addMappingSMOImpl.saveMapping(pd);
+    }
+
+    public IAddMappingSMO getAddMappingSMOImpl() {
+        return addMappingSMOImpl;
+    }
+
+    public void setAddMappingSMOImpl(IAddMappingSMO addMappingSMOImpl) {
+        this.addMappingSMOImpl = addMappingSMOImpl;
+    }
+}

+ 34 - 0
WebService/src/main/java/com/java110/web/components/mapping/DeleteMappingComponent.java

@@ -0,0 +1,34 @@
+package com.java110.web.components.mapping;
+
+import com.java110.core.context.IPageData;
+import com.java110.web.smo.mapping.IDeleteMappingSMO;
+import org.springframework.beans.factory.annotation.Autowired;
+        import org.springframework.http.ResponseEntity;
+        import org.springframework.stereotype.Component;
+
+/**
+ * 添加编码映射组件
+ */
+@Component("deleteMapping")
+public class DeleteMappingComponent {
+
+@Autowired
+private IDeleteMappingSMO deleteMappingSMOImpl;
+
+/**
+ * 添加编码映射数据
+ * @param pd 页面数据封装
+ * @return ResponseEntity 对象
+ */
+public ResponseEntity<String> delete(IPageData pd){
+        return deleteMappingSMOImpl.deleteMapping(pd);
+    }
+
+public IDeleteMappingSMO getDeleteMappingSMOImpl() {
+        return deleteMappingSMOImpl;
+    }
+
+public void setDeleteMappingSMOImpl(IDeleteMappingSMO deleteMappingSMOImpl) {
+        this.deleteMappingSMOImpl = deleteMappingSMOImpl;
+    }
+            }

+ 34 - 0
WebService/src/main/java/com/java110/web/components/mapping/EditMappingComponent.java

@@ -0,0 +1,34 @@
+package com.java110.web.components.mapping;
+
+import com.java110.core.context.IPageData;
+import com.java110.web.smo.mapping.IEditMappingSMO;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.ResponseEntity;
+import org.springframework.stereotype.Component;
+
+/**
+ * 编辑小区组件
+ */
+@Component("editMapping")
+public class EditMappingComponent {
+
+    @Autowired
+    private IEditMappingSMO editMappingSMOImpl;
+
+    /**
+     * 添加小区数据
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象
+     */
+    public ResponseEntity<String> update(IPageData pd){
+        return editMappingSMOImpl.updateMapping(pd);
+    }
+
+    public IEditMappingSMO getEditMappingSMOImpl() {
+        return editMappingSMOImpl;
+    }
+
+    public void setEditMappingSMOImpl(IEditMappingSMO editMappingSMOImpl) {
+        this.editMappingSMOImpl = editMappingSMOImpl;
+    }
+}

+ 41 - 0
WebService/src/main/java/com/java110/web/components/mapping/MappingManageComponent.java

@@ -0,0 +1,41 @@
+package com.java110.web.components.mapping;
+
+
+import com.java110.core.context.IPageData;
+import com.java110.web.smo.mapping.IListMappingsSMO;
+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("mappingManage")
+public class MappingManageComponent {
+
+    @Autowired
+    private IListMappingsSMO listMappingsSMOImpl;
+
+    /**
+     * 查询编码映射列表
+     *
+     * @param pd 页面数据封装
+     * @return 返回 ResponseEntity 对象
+     */
+    public ResponseEntity<String> list(IPageData pd) {
+        return listMappingsSMOImpl.listMappings(pd);
+    }
+
+    public IListMappingsSMO getListMappingsSMOImpl() {
+        return listMappingsSMOImpl;
+    }
+
+    public void setListMappingsSMOImpl(IListMappingsSMO listMappingsSMOImpl) {
+        this.listMappingsSMOImpl = listMappingsSMOImpl;
+    }
+}

+ 19 - 0
WebService/src/main/java/com/java110/web/smo/mapping/IAddMappingSMO.java

@@ -0,0 +1,19 @@
+package com.java110.web.smo.mapping;
+
+import com.java110.core.context.IPageData;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 添加编码映射接口
+ *
+ * add by wuxw 2019-06-30
+ */
+public interface IAddMappingSMO {
+
+    /**
+     * 添加编码映射
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象
+     */
+    ResponseEntity<String> saveMapping(IPageData pd);
+}

+ 19 - 0
WebService/src/main/java/com/java110/web/smo/mapping/IDeleteMappingSMO.java

@@ -0,0 +1,19 @@
+package com.java110.web.smo.mapping;
+
+import com.java110.core.context.IPageData;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 添加编码映射接口
+ *
+ * add by wuxw 2019-06-30
+ */
+public interface IDeleteMappingSMO {
+
+    /**
+     * 添加编码映射
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象
+     */
+    ResponseEntity<String> deleteMapping(IPageData pd);
+}

+ 19 - 0
WebService/src/main/java/com/java110/web/smo/mapping/IEditMappingSMO.java

@@ -0,0 +1,19 @@
+package com.java110.web.smo.mapping;
+
+import com.java110.core.context.IPageData;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 修改编码映射接口
+ *
+ * add by wuxw 2019-06-30
+ */
+public interface IEditMappingSMO {
+
+    /**
+     * 修改小区
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象
+     */
+    ResponseEntity<String> updateMapping(IPageData pd);
+}

+ 21 - 0
WebService/src/main/java/com/java110/web/smo/mapping/IListMappingsSMO.java

@@ -0,0 +1,21 @@
+package com.java110.web.smo.mapping;
+
+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 IListMappingsSMO {
+
+    /**
+     * 查询编码映射信息
+     * @param pd 页面数据封装
+     * @return ResponseEntity 对象数据
+     * @throws SMOException 业务代码层
+     */
+    ResponseEntity<String> listMappings(IPageData pd) throws SMOException;
+}

+ 68 - 0
WebService/src/main/java/com/java110/web/smo/mapping/impl/AddMappingSMOImpl.java

@@ -0,0 +1,68 @@
+package com.java110.web.smo.mapping.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.mapping.IAddMappingSMO;
+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("addMappingSMOImpl")
+public class AddMappingSMOImpl extends AbstractComponentSMO implements IAddMappingSMO {
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Override
+    protected void validate(IPageData pd, JSONObject paramIn) {
+
+        //super.validatePageInfo(pd);
+
+        //Assert.hasKeyAndValue(paramIn, "xxx", "xxx");
+        Assert.hasKeyAndValue(paramIn, "domain", "必填,请填写域");
+Assert.hasKeyAndValue(paramIn, "name", "必填,请填写名称");
+Assert.hasKeyAndValue(paramIn, "key", "必填,请填写键");
+Assert.hasKeyAndValue(paramIn, "value", "必填,请填写值");
+
+
+
+        super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_MAPPING);
+
+    }
+
+    @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/mapping.saveMapping",
+                HttpMethod.POST);
+        return responseEntity;
+    }
+
+    @Override
+    public ResponseEntity<String> saveMapping(IPageData pd) {
+        return super.businessProcess(pd);
+    }
+
+    public RestTemplate getRestTemplate() {
+        return restTemplate;
+    }
+
+    public void setRestTemplate(RestTemplate restTemplate) {
+        this.restTemplate = restTemplate;
+    }
+}

+ 63 - 0
WebService/src/main/java/com/java110/web/smo/mapping/impl/DeleteMappingSMOImpl.java

@@ -0,0 +1,63 @@
+package com.java110.web.smo.mapping.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.mapping.IDeleteMappingSMO;
+import org.springframework.stereotype.Service;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.http.HttpMethod;
+import org.springframework.http.ResponseEntity;
+
+/**
+ * 添加小区服务实现类
+ * delete by wuxw 2019-06-30
+ */
+@Service("deleteMappingSMOImpl")
+public class DeleteMappingSMOImpl extends AbstractComponentSMO implements IDeleteMappingSMO {
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Override
+    protected void validate(IPageData pd, JSONObject paramIn) {
+
+        //super.validatePageInfo(pd);
+
+        //Assert.hasKeyAndValue(paramIn, "xxx", "xxx");
+        Assert.hasKeyAndValue(paramIn, "id", "编码ID不能为空");
+
+
+
+        super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_MAPPING);
+
+    }
+
+    @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/mapping.deleteMapping",
+                HttpMethod.POST);
+        return responseEntity;
+    }
+
+    @Override
+    public ResponseEntity<String> deleteMapping(IPageData pd) {
+        return super.businessProcess(pd);
+    }
+
+    public RestTemplate getRestTemplate() {
+        return restTemplate;
+    }
+
+    public void setRestTemplate(RestTemplate restTemplate) {
+        this.restTemplate = restTemplate;
+    }
+}

+ 66 - 0
WebService/src/main/java/com/java110/web/smo/mapping/impl/EditMappingSMOImpl.java

@@ -0,0 +1,66 @@
+package com.java110.web.smo.mapping.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.mapping.IEditMappingSMO;
+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("eidtMappingSMOImpl")
+public class EditMappingSMOImpl extends AbstractComponentSMO implements IEditMappingSMO {
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Override
+    protected void validate(IPageData pd, JSONObject paramIn) {
+
+        //super.validatePageInfo(pd);
+
+        Assert.hasKeyAndValue(paramIn, "id", "编码ID不能为空");
+Assert.hasKeyAndValue(paramIn, "domain", "必填,请填写域");
+Assert.hasKeyAndValue(paramIn, "name", "必填,请填写名称");
+Assert.hasKeyAndValue(paramIn, "key", "必填,请填写键");
+Assert.hasKeyAndValue(paramIn, "value", "必填,请填写值");
+
+
+
+        super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.AGENT_HAS_LIST_MAPPING);
+
+    }
+
+    @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/mapping.updateMapping",
+                HttpMethod.POST);
+        return responseEntity;
+    }
+
+    @Override
+    public ResponseEntity<String> updateMapping(IPageData pd) {
+        return super.businessProcess(pd);
+    }
+
+    public RestTemplate getRestTemplate() {
+        return restTemplate;
+    }
+
+    public void setRestTemplate(RestTemplate restTemplate) {
+        this.restTemplate = restTemplate;
+    }
+}

+ 66 - 0
WebService/src/main/java/com/java110/web/smo/mapping/impl/ListMappingsSMOImpl.java

@@ -0,0 +1,66 @@
+package com.java110.web.smo.mapping.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.mapping.IListMappingsSMO;
+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;
+
+/**
+ * 查询mapping服务类
+ */
+@Service("listMappingsSMOImpl")
+public class ListMappingsSMOImpl extends AbstractComponentSMO implements IListMappingsSMO {
+
+    @Autowired
+    private RestTemplate restTemplate;
+
+    @Override
+    public ResponseEntity<String> listMappings(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_MAPPING);
+    }
+
+    @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/mapping.listMappings" + 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;
+    }
+}

+ 62 - 0
WebService/src/main/resources/components/add-mapping/addMapping.html

@@ -0,0 +1,62 @@
+<div id = "addMappingModel" 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="addMappingInfo.domain"                   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="addMappingInfo.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="addMappingInfo.key"                   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="addMappingInfo.value"                   type="text" placeholder="必填,请填写值" class="form-control">
+         </div>
+</div>
+<div class="form-group row">
+         <label class="col-sm-2 col-form-label">备注</label>
+         <div class="col-sm-10">
+<textarea  placeholder="选填,请填写备注" class="form-control" v-model="addMappingInfo.remark"></textarea>         </div>
+</div>
+
+                            <div class="ibox-content">
+                                <button class="btn btn-primary float-right" type="button" v-on:click="saveMappingInfo()" ><i class="fa fa-check"></i>&nbsp;保存</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>

+ 137 - 0
WebService/src/main/resources/components/add-mapping/addMapping.js

@@ -0,0 +1,137 @@
+(function(vc){
+
+    vc.extends({
+        data:{
+            addMappingInfo:{
+                domain:'DOMAIN.COMMON',
+name:'',
+key:'',
+value:'',
+remark:'',
+
+            }
+        },
+         _initMethod:function(){
+
+         },
+         _initEvent:function(){
+            vc.on('addMapping','openAddMappingModal',function(){
+                $('#addMappingModel').modal('show');
+            });
+        },
+        methods:{
+            addMappingValidate(){
+                return vc.validate.validate({
+                    addMappingInfo:vc.component.addMappingInfo
+                },{
+                    'addMappingInfo.domain':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"域不能为空"
+                        },
+ {
+                            limit:"maxLength",
+                            param:"50",
+                            errInfo:"域长度不能超过50"
+                        },
+                    ],
+'addMappingInfo.name':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"名称不能为空"
+                        },
+ {
+                            limit:"maxin",
+                            param:"2,50",
+                            errInfo:"名称必须在2至50字符之间"
+                        },
+                    ],
+'addMappingInfo.key':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"键不能为空"
+                        },
+ {
+                            limit:"maxin",
+                            param:"1,100",
+                            errInfo:"键必须在1至100之间"
+                        },
+                    ],
+'addMappingInfo.value':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"值不能为空"
+                        },
+ {
+                            limit:"maxin",
+                            param:"1,100",
+                            errInfo:"值必须在1至100之间"
+                        },
+                    ],
+'addMappingInfo.remark':[
+ {
+                            limit:"maxLength",
+                            param:"200",
+                            errInfo:"备注内容不能超过200"
+                        },
+                    ],
+
+
+
+
+                });
+            },
+            saveMappingInfo:function(){
+                if(!vc.component.addMappingValidate()){
+                    vc.message(vc.validate.errInfo);
+
+                    return ;
+                }
+
+                vc.component.addMappingInfo.communityId = vc.getCurrentCommunity().communityId;
+
+                vc.http.post(
+                    'addMapping',
+                    'save',
+                    JSON.stringify(vc.component.addMappingInfo),
+                    {
+                        emulateJSON:true
+                     },
+                     function(json,res){
+                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
+                        if(res.status == 200){
+                            //关闭model
+                            $('#addMappingModel').modal('hide');
+                            vc.component.clearAddMappingInfo();
+                            vc.emit('mappingManage','listMapping',{});
+
+                            return ;
+                        }
+                        vc.message(json);
+
+                     },
+                     function(errInfo,error){
+                        console.log('请求失败处理');
+
+                        vc.message(errInfo);
+
+                     });
+            },
+            clearAddMappingInfo:function(){
+                vc.component.addMappingInfo = {
+                                            domain:'DOMAIN.COMMON',
+name:'',
+key:'',
+value:'',
+remark:'',
+
+                                        };
+            }
+        }
+    });
+
+})(window.vc);

+ 19 - 0
WebService/src/main/resources/components/delete-mapping/deleteMapping.html

@@ -0,0 +1,19 @@
+<div class="modal fade" id="deleteMappingModel" 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">&times;</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="closeDeleteMappingModel()">点错了</button>
+                <button type="button" class="btn btn-primary" v-on:click="deleteMapping()">确认删除</button>
+            </div>
+        </div>
+    </div>
+</div>

+ 52 - 0
WebService/src/main/resources/components/delete-mapping/deleteMapping.js

@@ -0,0 +1,52 @@
+(function(vc,vm){
+
+    vc.extends({
+        data:{
+            deleteMappingInfo:{
+
+            }
+        },
+         _initMethod:function(){
+
+         },
+         _initEvent:function(){
+             vc.on('deleteMapping','openDeleteMappingModal',function(_params){
+
+                vc.component.deleteMappingInfo = _params;
+                $('#deleteMappingModel').modal('show');
+
+            });
+        },
+        methods:{
+            deleteMapping:function(){
+                vc.component.deleteMappingInfo.communityId=vc.getCurrentCommunity().communityId;
+                vc.http.post(
+                    'deleteMapping',
+                    'delete',
+                    JSON.stringify(vc.component.deleteMappingInfo),
+                    {
+                        emulateJSON:true
+                     },
+                     function(json,res){
+                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
+                        if(res.status == 200){
+                            //关闭model
+                            $('#deleteMappingModel').modal('hide');
+                            vc.emit('mappingManage','listMapping',{});
+                            return ;
+                        }
+                        vc.message(json);
+                     },
+                     function(errInfo,error){
+                        console.log('请求失败处理');
+                        vc.message(json);
+
+                     });
+            },
+            closeDeleteMappingModel:function(){
+                $('#deleteMappingModel').modal('hide');
+            }
+        }
+    });
+
+})(window.vc,window.vc.component);

+ 49 - 0
WebService/src/main/resources/components/edit-mapping/editMapping.html

@@ -0,0 +1,49 @@
+<div id = "editMappingModel" 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="editMappingInfo.domain"                   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="editMappingInfo.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="editMappingInfo.key"                   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="editMappingInfo.value"                   type="text" placeholder="必填,请填写值" class="form-control">
+         </div>
+</div>
+<div class="form-group row">
+         <label class="col-sm-2 col-form-label">备注</label>
+         <div class="col-sm-10">
+<textarea  placeholder="选填,请填写备注" class="form-control" v-model="editMappingInfo.remark"></textarea>         </div>
+</div>
+
+                            <div class="ibox-content">
+                                <button class="btn btn-primary float-right" type="button" v-on:click="editMapping()" ><i class="fa fa-check"></i>&nbsp;保存</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>

+ 138 - 0
WebService/src/main/resources/components/edit-mapping/editMapping.js

@@ -0,0 +1,138 @@
+(function(vc,vm){
+
+    vc.extends({
+        data:{
+            editMappingInfo:{
+                id:'',
+domain:'DOMAIN.COMMON',
+name:'',
+key:'',
+value:'',
+remark:'',
+
+            }
+        },
+         _initMethod:function(){
+
+         },
+         _initEvent:function(){
+             vc.on('editMapping','openEditMappingModal',function(_params){
+                vc.component.refreshEditMappingInfo();
+                $('#editMappingModel').modal('show');
+                vc.copyObject(_params, vc.component.editMappingInfo );
+                vc.component.editMappingInfo.communityId = vc.getCurrentCommunity().communityId;
+            });
+        },
+        methods:{
+            editMappingValidate:function(){
+                        return vc.validate.validate({
+                            editMappingInfo:vc.component.editMappingInfo
+                        },{
+                            'editMappingInfo.domain':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"域不能为空"
+                        },
+ {
+                            limit:"maxLength",
+                            param:"50",
+                            errInfo:"域长度不能超过50"
+                        },
+                    ],
+'editMappingInfo.name':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"名称不能为空"
+                        },
+ {
+                            limit:"maxin",
+                            param:"2,50",
+                            errInfo:"名称必须在2至50字符之间"
+                        },
+                    ],
+'editMappingInfo.key':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"键不能为空"
+                        },
+ {
+                            limit:"maxin",
+                            param:"1,100",
+                            errInfo:"键必须在1至100之间"
+                        },
+                    ],
+'editMappingInfo.value':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"值不能为空"
+                        },
+ {
+                            limit:"maxin",
+                            param:"1,100",
+                            errInfo:"值必须在1至100之间"
+                        },
+                    ],
+'editMappingInfo.remark':[
+ {
+                            limit:"maxLength",
+                            param:"200",
+                            errInfo:"备注内容不能超过200"
+                        },
+                    ],
+'editMappingInfo.id':[
+{
+                            limit:"required",
+                            param:"",
+                            errInfo:"编码ID不能为空"
+                        }]
+
+                        });
+             },
+            editMapping:function(){
+                if(!vc.component.editMappingValidate()){
+                    vc.message(vc.validate.errInfo);
+                    return ;
+                }
+
+                vc.http.post(
+                    'editMapping',
+                    'update',
+                    JSON.stringify(vc.component.editMappingInfo),
+                    {
+                        emulateJSON:true
+                     },
+                     function(json,res){
+                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
+                        if(res.status == 200){
+                            //关闭model
+                            $('#editMappingModel').modal('hide');
+                             vc.emit('mappingManage','listMapping',{});
+                            return ;
+                        }
+                        vc.message(json);
+                     },
+                     function(errInfo,error){
+                        console.log('请求失败处理');
+
+                        vc.message(errInfo);
+                     });
+            },
+            refreshEditMappingInfo:function(){
+                vc.component.editMappingInfo= {
+                  id:'',
+domain:'DOMAIN.COMMON',
+name:'',
+key:'',
+value:'',
+remark:'',
+
+                }
+            }
+        }
+    });
+
+})(window.vc,window.vc.component);

+ 66 - 0
WebService/src/main/resources/components/mapping-manage/mappingManage.html

@@ -0,0 +1,66 @@
+<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="_openAddMappingModal()">
+                            <i class="glyphicon glyphicon-plus"></i>
+                            添加编码映射
+                        </button>
+                    </div>
+                </div>
+                <div class="ibox-content">
+
+                    <table class="footable table table-stripped toggle-arrow-tiny" data-page-size="15">
+                        <thead>
+                        <tr>
+                                                        <th>编码ID</th>
+                            <th>域</th>
+                            <th>名称</th>
+                            <th>键</th>
+                            <th>值</th>
+                            <th>备注</th>
+                            <th class="text-right">操作</th>
+
+
+                        </tr>
+                        </thead>
+                        <tbody>
+                            <tr v-for="mapping in mappingManageInfo.mappings">
+                                                            <td>{{mapping.id}}</td>
+                            <td>{{mapping.domain}}</td>
+                            <td>{{mapping.name}}</td>
+                            <td>{{mapping.key}}</td>
+                            <td>{{mapping.value}}</td>
+                            <td>{{mapping.remark}}</td>
+                            <td><div class="btn-group">
+                                    <button class="btn-white btn btn-xs" v-on:click="_openEditMappingModel(mapping)">修改</button>
+                                </div>
+                                <div class="btn-group">
+                                    <button class="btn-white btn btn-xs" v-on:click="_openDeleteMappingModel(mapping)">删除</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="addMapping"></vc:create>
+    <vc:create name="editMapping"></vc:create>
+    <vc:create name="deleteMapping"></vc:create>
+
+</div>

+ 64 - 0
WebService/src/main/resources/components/mapping-manage/mappingManage.js

@@ -0,0 +1,64 @@
+/**
+    入驻小区
+**/
+(function(vc){
+    var DEFAULT_PAGE = 1;
+    var DEFAULT_ROWS = 10;
+    vc.extends({
+        data:{
+            mappingManageInfo:{
+                mappings:[],
+                total:0,
+                records:1
+            }
+        },
+        _initMethod:function(){
+            vc.component._listMappings(DEFAULT_PAGE, DEFAULT_ROWS);
+        },
+        _initEvent:function(){
+            vc.on('mappingManage','listMapping',function(_param){
+                  vc.component._listMappings(DEFAULT_PAGE, DEFAULT_ROWS);
+            });
+             vc.on('pagination','page_event',function(_currentPage){
+                vc.component._listMappings(_currentPage,DEFAULT_ROWS);
+            });
+        },
+        methods:{
+            _listMappings:function(_page, _rows){
+                var param = {
+                    params:{
+                        page:_page,
+                        row:_rows
+                    }
+
+               }
+               //发送get请求
+               vc.http.get('mappingManage',
+                            'list',
+                             param,
+                             function(json,res){
+                                var _mappingManageInfo=JSON.parse(json);
+                                vc.component.mappingManageInfo.total = _mappingManageInfo.total;
+                                vc.component.mappingManageInfo.records = _mappingManageInfo.records;
+                                vc.component.mappingManageInfo.mappings = _mappingManageInfo.mappings;
+                                vc.emit('pagination','init',{
+                                     total:vc.component.mappingManageInfo.records,
+                                     currentPage:_page
+                                 });
+                             },function(errInfo,error){
+                                console.log('请求失败处理');
+                             }
+                           );
+            },
+            _openAddMappingModal:function(){
+                vc.emit('addMapping','openAddMappingModal',{});
+            },
+            _openEditMappingModel:function(_mapping){
+                vc.emit('editMapping','openEditMappingModal',_mapping);
+            },
+            _openDeleteMappingModel:function(_mapping){
+                vc.emit('deleteMapping','openDeleteMappingModal',_mapping);
+            }
+        }
+    });
+})(window.vc);

+ 33 - 0
WebService/src/main/resources/views/mappingFlow.html

@@ -0,0 +1,33 @@
+<!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="mappingManage"></vc:create>
+        </div>
+
+        <vc:create name="copyright"></vc:create>
+
+    </div>
+</div>
+
+<vc:create name="commonBottom"></vc:create>
+</body>
+</html>

+ 84 - 0
java110-bean/src/main/java/com/java110/dto/mapping/MappingDto.java

@@ -0,0 +1,84 @@
+package com.java110.dto.mapping;
+
+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 MappingDto extends PageDto implements Serializable {
+
+    private String domain;
+private String name;
+private String remark;
+private String id;
+private String value;
+private String key;
+
+
+    private Date createTime;
+
+    private String statusCd = "0";
+
+
+    public String getDomain() {
+        return domain;
+    }
+public void setDomain(String domain) {
+        this.domain = domain;
+    }
+public String getName() {
+        return name;
+    }
+public void setName(String name) {
+        this.name = name;
+    }
+public String getRemark() {
+        return remark;
+    }
+public void setRemark(String remark) {
+        this.remark = remark;
+    }
+public String getId() {
+        return id;
+    }
+public void setId(String id) {
+        this.id = id;
+    }
+public String getValue() {
+        return value;
+    }
+public void setValue(String value) {
+        this.value = value;
+    }
+public String getKey() {
+        return key;
+    }
+public void setKey(String key) {
+        this.key = key;
+    }
+
+
+    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;
+    }
+}

+ 53 - 0
java110-bean/src/main/java/com/java110/vo/api/mapping/ApiMappingDataVo.java

@@ -0,0 +1,53 @@
+package com.java110.vo.api.mapping;
+
+import java.io.Serializable;
+import java.util.Date;
+
+public class ApiMappingDataVo implements Serializable {
+
+    private String id;
+private String domain;
+private String name;
+private String key;
+private String value;
+private String remark;
+public String getId() {
+        return id;
+    }
+public void setId(String id) {
+        this.id = id;
+    }
+public String getDomain() {
+        return domain;
+    }
+public void setDomain(String domain) {
+        this.domain = domain;
+    }
+public String getName() {
+        return name;
+    }
+public void setName(String name) {
+        this.name = name;
+    }
+public String getKey() {
+        return key;
+    }
+public void setKey(String key) {
+        this.key = key;
+    }
+public String getValue() {
+        return value;
+    }
+public void setValue(String value) {
+        this.value = value;
+    }
+public String getRemark() {
+        return remark;
+    }
+public void setRemark(String remark) {
+        this.remark = remark;
+    }
+
+
+
+}

+ 19 - 0
java110-bean/src/main/java/com/java110/vo/api/mapping/ApiMappingVo.java

@@ -0,0 +1,19 @@
+package com.java110.vo.api.mapping;
+
+import com.java110.vo.MorePageVo;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class ApiMappingVo extends MorePageVo implements Serializable {
+    List<ApiMappingDataVo> mappings;
+
+
+    public List<ApiMappingDataVo> getMappings() {
+        return mappings;
+    }
+
+    public void setMappings(List<ApiMappingDataVo> mappings) {
+        this.mappings = mappings;
+    }
+}

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

@@ -0,0 +1,80 @@
+package com.java110;
+
+
+import com.java110.code.*;
+
+import java.util.HashMap;
+import java.util.Map;
+
+/**
+ * Hello world!
+ */
+public class MappingGeneratorApplication {
+
+    protected MappingGeneratorApplication() {
+        // prevents calls from subclass
+        throw new UnsupportedOperationException();
+    }
+
+    /**
+     * 代码生成器 入口方法
+     *
+     * @param args 参数
+     */
+    public static void main(String[] args) {
+        Data data = new Data();
+        data.setId("id");
+        data.setName("mapping");
+        data.setDesc("映射");
+        data.setShareParam("communityId");
+        data.setShareColumn("community_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_mapping");
+        data.setTableName("c_mapping");
+        Map<String, String> param = new HashMap<String, String>();
+        param.put("id", "id");
+        param.put("domain", "domain");
+        param.put("name", "name");
+        param.put("key", "key");
+        param.put("value", "value");
+        param.put("remark", "remark");
+        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);
+    }
+}

+ 36 - 112
java110-code-generator/src/main/resources/web/template_1.json

@@ -1,145 +1,69 @@
 {
-  "templateName":"服务",
-  "templateCode":"service",
-  "templateKey":"serviceId",
-  "templateKeyName":"服务ID",
+  "templateName":"编码映射",
+  "templateCode":"mapping",
+  "templateKey":"id",
+  "templateKeyName":"编码ID",
   "columns":[
     {
-      "code":"name",
-      "cnCode":"服务名称",
-      "desc":"必填,请填写服务名称",
+      "code":"domain",
+      "cnCode":"",
+      "desc":"必填,请填写",
       "required":true,
-      "hasDefaultValue":false,
+      "hasDefaultValue":true,
+      "defaultValue":"DOMAIN.COMMON",
       "inputType":"input",
       "limit":"maxLength",
       "limitParam":"50",
-      "limitErrInfo":"服务名称不能超过50"
+      "limitErrInfo":"域长度不能超过50"
     },
     {
-      "code":"serviceCode",
-      "cnCode":"服务编码",
-      "desc":"必填,请填写服务编码如 service.saveService",
+      "code":"name",
+      "cnCode":"名称",
+      "desc":"必填,请填写名称",
       "required":true,
       "hasDefaultValue":false,
       "inputType":"input",
       "limit":"maxin",
       "limitParam":"2,50",
-      "limitErrInfo":"服务编码必须在2至50字符之间"
+      "limitErrInfo":"名称必须在2至50字符之间"
     },
     {
-      "code":"businessTypeCd",
-      "cnCode":"秘钥",
-      "desc":"可填,请填写秘钥,如果填写了需要加密传输",
+      "code":"key",
+      "cnCode":"",
+      "desc":"必填,请填写键",
       "required":true,
-      "hasDefaultValue":true,
-      "defaultValue":"API",
-      "inputType":"none",
+      "hasDefaultValue":false,
+      "defaultValue":"",
+      "inputType":"input",
       "limit":"maxin",
-      "limitParam":"2,4",
-      "limitErrInfo":"业务类型必须为API"
+      "limitParam":"1,100",
+      "limitErrInfo":"键必须在1至100之间"
     },
 
     {
-      "code":"seq",
-      "cnCode":"序列",
-      "desc":"必填,请填写序列",
+      "code":"value",
+      "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":"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"
-    }
-  ,
+      "limit":"maxin",
+      "limitParam":"1,100",
+      "limitErrInfo":"值必须在1至100之间"
+    },
 
     {
-      "code":"url",
-      "cnCode":"调用地址",
-      "desc":"可填,请填写调用地址",
+      "code":"remark",
+      "cnCode":"备注",
+      "desc":"可填,请填写备注",
       "required":false,
-      "hasDefaultValue":true,
-      "defaultValue":"http://order-service/orderApi/service",
-      "inputType":"input",
-      "limit":"maxLength",
-      "limitParam":"200",
-      "limitErrInfo":"调用地址不能超过200"
-    },
-    {
-      "code":"method",
-      "cnCode":"调用方式",
-      "desc":"必填,请填写调用方式",
-      "required":true,
       "hasDefaultValue":false,
-      "inputType":"select",
-      "selectValue":"GET,POST",
-      "selectValueName":"http get,http post",
+      "defaultValue":"",
+      "inputType":"textarea",
       "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":"重试次数必须为数字"
+      "limitParam":"200",
+      "limitErrInfo":"备注内容不能超过200"
     }
 
   ]

+ 146 - 0
java110-code-generator/src/main/resources/web/template_service.json

@@ -0,0 +1,146 @@
+{
+  "templateName":"服务",
+  "templateCode":"service",
+  "templateKey":"serviceId",
+  "templateKeyName":"服务ID",
+  "columns":[
+    {
+      "code":"name",
+      "cnCode":"服务名称",
+      "desc":"必填,请填写服务名称",
+      "required":true,
+      "hasDefaultValue":false,
+      "inputType":"input",
+      "limit":"maxLength",
+      "limitParam":"50",
+      "limitErrInfo":"服务名称不能超过50"
+    },
+    {
+      "code":"serviceCode",
+      "cnCode":"服务编码",
+      "desc":"必填,请填写服务编码如 service.saveService",
+      "required":true,
+      "hasDefaultValue":false,
+      "inputType":"input",
+      "limit":"maxin",
+      "limitParam":"2,50",
+      "limitErrInfo":"服务编码必须在2至50字符之间"
+    },
+    {
+      "code":"businessTypeCd",
+      "cnCode":"秘钥",
+      "desc":"可填,请填写秘钥,如果填写了需要加密传输",
+      "required":true,
+      "hasDefaultValue":true,
+      "defaultValue":"API",
+      "inputType":"none",
+      "limit":"maxin",
+      "limitParam":"2,4",
+      "limitErrInfo":"业务类型必须为API"
+    },
+
+    {
+      "code":"seq",
+      "cnCode":"序列",
+      "desc":"必填,请填写序列",
+      "required":true,
+      "hasDefaultValue":true,
+      "defaultValue":"1",
+      "inputType":"none",
+      "limit":"maxLength",
+      "limitParam":"1",
+      "limitErrInfo":"序列格式错误"
+    },
+
+    {
+      "code":"messageQueueName",
+      "cnCode":"消息队列",
+      "desc":"可填,请填写消息队列,订单在异步调用时使用",
+      "required":false,
+      "hasDefaultValue":false,
+      "defaultValue":"",
+      "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"
+    },
+    {
+      "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":"重试次数必须为数字"
+    }
+
+  ]
+}

+ 1 - 0
java110-common/src/main/java/com/java110/common/constant/PrivilegeCodeConstant.java

@@ -63,6 +63,7 @@ public final class PrivilegeCodeConstant {
     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";
+    public static final String AGENT_HAS_LIST_MAPPING = "500201906028";
 
 
 

+ 31 - 0
java110-common/src/main/java/com/java110/common/constant/ServiceCodeMappingConstant.java

@@ -0,0 +1,31 @@
+package com.java110.common.constant;
+
+/**
+ * 编码映射常量类
+ * Created by wuxw on 2017/5/20.
+ */
+public class ServiceCodeMappingConstant {
+
+    /**
+     * 添加 编码映射
+     */
+    public static final String ADD_MAPPING = "mapping.saveMapping";
+
+
+    /**
+     * 修改 编码映射
+     */
+    public static final String UPDATE_MAPPING = "mapping.updateMapping";
+    /**
+     * 删除 编码映射
+     */
+    public static final String DELETE_MAPPING = "mapping.deleteMapping";
+
+
+    /**
+     * 查询 编码映射
+     */
+    public static final String LIST_MAPPINGS = "mapping.listMappings";
+
+
+}

+ 74 - 0
java110-core/src/main/java/com/java110/core/smo/mapping/IMappingInnerServiceSMO.java

@@ -0,0 +1,74 @@
+package com.java110.core.smo.mapping;
+
+import com.java110.core.feign.FeignConfiguration;
+import com.java110.dto.mapping.MappingDto;
+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 IMappingInnerMappingSMO
+ * @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("/mappingApi")
+public interface IMappingInnerServiceSMO {
+
+    /**
+     * <p>查询小区楼信息</p>
+     *
+     *
+     * @param mappingDto 数据对象分享
+     * @return MappingDto 对象数据
+     */
+    @RequestMapping(value = "/queryMappings", method = RequestMethod.POST)
+    List<MappingDto> queryMappings(@RequestBody MappingDto mappingDto);
+
+    /**
+     * 查询<p>小区楼</p>总记录数
+     *
+     * @param mappingDto 数据对象分享
+     * @return 小区下的小区楼记录数
+     */
+    @RequestMapping(value = "/queryMappingsCount", method = RequestMethod.POST)
+    int queryMappingsCount(@RequestBody MappingDto mappingDto);
+
+
+    /**
+     * <p>修改APP信息</p>
+     *
+     *
+     * @param serviceDto 数据对象分享
+     * @return MappingDto 对象数据
+     */
+    @RequestMapping(value = "/updateMapping", method = RequestMethod.POST)
+    int updateMapping(@RequestBody MappingDto serviceDto);
+
+
+    /**
+     * <p>添加APP信息</p>
+     *
+     *
+     * @param serviceDto 数据对象分享
+     * @return MappingDto 对象数据
+     */
+    @RequestMapping(value = "/saveMapping", method = RequestMethod.POST)
+    int saveMapping(@RequestBody MappingDto serviceDto);
+
+    /**
+     * <p>删除APP信息</p>
+     *
+     *
+     * @param serviceDto 数据对象分享
+     * @return MappingDto 对象数据
+     */
+    @RequestMapping(value = "/deleteMapping", method = RequestMethod.POST)
+    int deleteMapping(@RequestBody MappingDto serviceDto);
+}

+ 169 - 0
java110-db/src/main/resources/mapper/mapping/MappingServiceDaoImplMapper.xml

@@ -0,0 +1,169 @@
+<?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="mappingServiceDaoImpl">
+
+    <!-- 保存映射信息 add by wuxw 2018-07-03 -->
+       <insert id="saveMappingInfo" parameterType="Map">
+           insert into c_mapping(
+domain,name,remark,id,value,key
+) values (
+#{domain},#{name},#{remark},#{id},#{value},#{key}
+)
+       </insert>
+
+
+       <!-- 查询映射信息(Business) add by wuxw 2018-07-03 -->
+       <select id="getBusinessMappingInfo" parameterType="Map" resultType="Map">
+           select  t.operate,t.domain,t.name,t.remark,t.id,t.value,t.key 
+from business_mapping t 
+where 1 =1 
+<if test="operate !=null and operate != ''">
+   and t.operate= #{operate}
+</if> 
+<if test="domain !=null and domain != ''">
+   and t.domain= #{domain}
+</if> 
+<if test="name !=null and name != ''">
+   and t.name= #{name}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</if> 
+<if test="id !=null and id != ''">
+   and t.id= #{id}
+</if> 
+<if test="value !=null and value != ''">
+   and t.value= #{value}
+</if> 
+<if test="key !=null and key != ''">
+   and t.key= #{key}
+</if> 
+
+       </select>
+
+
+
+
+
+    <!-- 保存映射信息至 instance表中 add by wuxw 2018-07-03 -->
+    <insert id="saveMappingInfoInstance" parameterType="Map">
+        insert into c_mapping(
+domain,name,remark,status_cd,id,value,key
+) select t.domain,t.name,t.remark,'0',t.id,t.value,t.key from business_mapping t where 1=1
+   and t.operate= 'ADD'
+<if test="domain !=null and domain != ''">
+   and t.domain= #{domain}
+</if> 
+<if test="name !=null and name != ''">
+   and t.name= #{name}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</if> 
+<if test="id !=null and id != ''">
+   and t.id= #{id}
+</if> 
+<if test="value !=null and value != ''">
+   and t.value= #{value}
+</if> 
+<if test="key !=null and key != ''">
+   and t.key= #{key}
+</if> 
+
+    </insert>
+
+
+
+    <!-- 查询映射信息 add by wuxw 2018-07-03 -->
+    <select id="getMappingInfo" parameterType="Map" resultType="Map">
+        select  t.domain,t.name,t.remark,t.status_cd,t.status_cd statusCd,t.id,t.value,t.key 
+from c_mapping t 
+where 1 =1 
+<if test="domain !=null and domain != ''">
+   and t.domain= #{domain}
+</if> 
+<if test="name !=null and name != ''">
+   and t.name= #{name}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="id !=null and id != ''">
+   and t.id= #{id}
+</if> 
+<if test="value !=null and value != ''">
+   and t.value= #{value}
+</if> 
+<if test="key !=null and key != ''">
+   and t.key= #{key}
+</if> 
+<if test="page != -1 and page != null ">
+   limit #{page}, #{row}
+</if> 
+
+    </select>
+
+
+
+
+    <!-- 修改映射信息 add by wuxw 2018-07-03 -->
+    <update id="updateMappingInfo" parameterType="Map">
+        update  c_mapping t set t.status_cd = #{statusCd}
+
+<if test="domain !=null and domain != ''">
+, t.domain= #{domain}
+</if> 
+<if test="name !=null and name != ''">
+, t.name= #{name}
+</if> 
+<if test="remark !=null and remark != ''">
+, t.remark= #{remark}
+</if> 
+<if test="value !=null and value != ''">
+, t.value= #{value}
+</if> 
+<if test="key !=null and key != ''">
+, t.key= #{key}
+</if> 
+ where 1=1 <if test="id !=null and id != ''">
+and t.id= #{id}
+</if> 
+
+    </update>
+
+    <!-- 查询映射数量 add by wuxw 2018-07-03 -->
+     <select id="queryMappingsCount" parameterType="Map" resultType="Map">
+        select  count(1) count 
+from c_mapping t 
+where 1 =1 
+<if test="domain !=null and domain != ''">
+   and t.domain= #{domain}
+</if> 
+<if test="name !=null and name != ''">
+   and t.name= #{name}
+</if> 
+<if test="remark !=null and remark != ''">
+   and t.remark= #{remark}
+</if> 
+<if test="statusCd !=null and statusCd != ''">
+   and t.status_cd= #{statusCd}
+</if> 
+<if test="id !=null and id != ''">
+   and t.id= #{id}
+</if> 
+<if test="value !=null and value != ''">
+   and t.value= #{value}
+</if> 
+<if test="key !=null and key != ''">
+   and t.key= #{key}
+</if> 
+
+
+     </select>
+
+</mapper>