mrzcc
2020-02-17 e64197421cf28099935f71f193989a3394d47fe0
Merge remote-tracking branch 'origin/master'
2 文件已重命名
44个文件已添加
40个文件已修改
4228 ■■■■■ 已修改文件
Api/src/main/java/com/java110/api/listener/community/ListMyEnteredCommunitysListener.java 27 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/listener/org/DeleteOrgCommunityListener.java 91 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/listener/org/ListOrgCommunitysListener.java 97 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/listener/org/ListOrgNoCommunitysListener.java 111 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/listener/org/SaveOrgCommunityListener.java 101 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/listener/org/SaveOrgListener.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/listener/org/UpdateOrgListener.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/listener/user/AddStaffServiceListener.java 9 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OrderService/src/main/java/com/java110/order/api/PrivilegeApi.java 17 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OrderService/src/main/java/com/java110/order/dao/IPrivilegeDAO.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OrderService/src/main/java/com/java110/order/dao/impl/PrivilegeDAOImpl.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OrderService/src/main/java/com/java110/order/smo/IPrivilegeSMO.java 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
OrderService/src/main/java/com/java110/order/smo/impl/PrivilegeSMOImpl.java 94 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserService/src/main/java/com/java110/user/dao/IOrgCommunityServiceDao.java 81 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserService/src/main/java/com/java110/user/dao/impl/OrgCommunityServiceDaoImpl.java 134 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserService/src/main/java/com/java110/user/listener/orgCommunity/AbstractOrgCommunityBusinessServiceDataFlowListener.java 85 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserService/src/main/java/com/java110/user/listener/orgCommunity/DeleteOrgCommunityInfoListener.java 180 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserService/src/main/java/com/java110/user/listener/orgCommunity/SaveOrgCommunityInfoListener.java 179 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserService/src/main/java/com/java110/user/listener/orgCommunity/UpdateOrgCommunityInfoListener.java 190 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
UserService/src/main/java/com/java110/user/smo/impl/OrgCommunityInnerServiceSMOImpl.java 71 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/components/EditPrivilegeGroupComponent.java 48 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/components/org/AddOrgCommunityComponent.java 77 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/components/org/DeleteOrgCommunityComponent.java 30 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/components/org/OrgCommunityManageComponent.java 43 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/IPrivilegeServiceSMO.java 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/impl/PrivilegeServiceSMOImpl.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/impl/StaffServiceSMOImpl.java 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/org/IAddOrgCommunitySMO.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/org/IDeleteOrgCommunitySMO.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/org/IListOrgCommunitysSMO.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/org/IListOrgNoCommunitysSMO.java 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/org/impl/AddOrgCommunitySMOImpl.java 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/org/impl/AddOrgSMOImpl.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/org/impl/DeleteOrgCommunitySMOImpl.java 66 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/org/impl/EditOrgSMOImpl.java 2 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/org/impl/ListOrgCommunitysSMOImpl.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/org/impl/ListOrgNoCommunitysSMOImpl.java 69 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/demoPackage/map/map.html 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/demoPackage/map/map.js 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/orgPackage/add-org/addOrg.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/orgPackage/add-org/addOrg.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/orgPackage/addOrgCommunity/addOrgCommunity.html 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/orgPackage/addOrgCommunity/addOrgCommunity.js 139 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/orgPackage/deleteOrgCommunity/deleteOrgCommunity.html 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/orgPackage/deleteOrgCommunity/deleteOrgCommunity.js 52 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/orgPackage/edit-org/editOrg.html 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/orgPackage/org-manage/orgManage.html 21 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/orgPackage/org-manage/orgManage.js 33 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/orgPackage/orgCommunityManage/orgCommunityManage.html 67 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/orgPackage/orgCommunityManage/orgCommunityManage.js 100 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/paginationPackage/pagination/pagination.html 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/paginationPackage/pagination/pagination.js 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/paginationPackage/paginationPlus/paginationPlus.html 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/paginationPackage/paginationPlus/paginationPlus.js 171 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/privilegePackage/add-privilege/addPrivilege.html 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/privilegePackage/add-privilege/addPrivilege.js 54 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/privilegePackage/add-staff-privilege/addStaffPrivilege.html 23 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/privilegePackage/add-staff-privilege/addStaffPrivilege.js 80 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/privilegePackage/edit-privilege-group/editPrivilegeGroup.html 28 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/privilegePackage/edit-privilege-group/editPrivilegeGroup.js 102 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/privilegePackage/privilege-group/privilegeGroup.html 7 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/privilegePackage/privilege-group/privilegeGroup.js 3 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/privilegePackage/privilege-manage/privilege.html 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/privilegePackage/privilege-manage/privilege.js 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/servicePackage/add-service/addService.js 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/staffPackage/addStaffView/addStaffView.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/staffPackage/addStaffView/addStaffView.js 34 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/staffPackage/edit-staff/editStaff.html 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/staffPackage/edit-staff/editStaff.js 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/document/services/org/DeleteOrgCommunityInfo.md 114 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/document/services/org/SaveOrgCommunityInfo.md 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
docs/document/services/org/UpdateOrgCommunityInfo.md 124 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/community/CommunityDto.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/dto/org/OrgCommunityDto.java 95 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/vo/api/org/ApiOrgCommunityDataVo.java 53 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-bean/src/main/java/com/java110/vo/api/org/ApiOrgCommunityVo.java 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-code-generator/src/main/java/com/java110/OrgCommunityGeneratorApplication.java 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-core/src/main/java/com/java110/core/smo/org/IOrgCommunityInnerServiceSMO.java 41 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/db/UserService/create_organization.sql 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/center/PrivilegeDAOImplMapper.xml 20 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/community/CommunityServiceDaoImplMapper.xml 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-db/src/main/resources/mapper/user/OrgCommunityServiceDaoImplMapper.xml 187 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeOrgConstant.java 25 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-utils/src/main/java/com/java110/utils/util/Assert.java 15 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Api/src/main/java/com/java110/api/listener/community/ListMyEnteredCommunitysListener.java
@@ -5,9 +5,11 @@
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.core.smo.community.ICommunityInnerServiceSMO;
import com.java110.core.smo.org.IOrgCommunityInnerServiceSMO;
import com.java110.core.smo.org.IOrgInnerServiceSMO;
import com.java110.core.smo.org.IOrgStaffRelInnerServiceSMO;
import com.java110.dto.community.CommunityDto;
import com.java110.dto.org.OrgCommunityDto;
import com.java110.dto.org.OrgDto;
import com.java110.dto.org.OrgStaffRelDto;
import com.java110.event.service.api.ServiceDataFlowEvent;
@@ -37,6 +39,9 @@
    @Autowired
    private IOrgStaffRelInnerServiceSMO orgStaffRelInnerServiceSMOImpl;
    @Autowired
    private IOrgCommunityInnerServiceSMO orgCommunityInnerServiceSMOImpl;
    @Autowired
    private IOrgInnerServiceSMO orgInnerServiceSMOImpl;
@@ -92,6 +97,7 @@
        List<OrgDto> orgDtos = orgInnerServiceSMOImpl.queryOrgs(orgDto);
        Assert.listOnlyOne(orgDtos, "根据组织ID未查询到员工对应部门信息或查询到多条数据");
        int count = 0;
        List<ApiCommunityDataVo> communitys = null;
        if ("9999".equals(orgDtos.get(0).getBelongCommunityId())) {
@@ -105,10 +111,23 @@
                communitys = new ArrayList<>();
            }
        } else {
            CommunityDto communityDto = new CommunityDto();
            communityDto.setCommunityId(orgDtos.get(0).getBelongCommunityId());
            communitys = BeanConvertUtil.covertBeanList(communityInnerServiceSMOImpl.queryCommunitys(communityDto), ApiCommunityDataVo.class);
            count = 1;
            String companyOrgId = orgDtos.get(0).getParentOrgId();
            OrgCommunityDto orgCommunityDto = new OrgCommunityDto();
            orgCommunityDto.setOrgId(companyOrgId);
            count = orgCommunityInnerServiceSMOImpl.queryOrgCommunitysCount(orgCommunityDto);
            if (count > 0) {
                List<OrgCommunityDto> orgCommunityDtos = orgCommunityInnerServiceSMOImpl.queryOrgCommunitys(orgCommunityDto);
                communitys = BeanConvertUtil.covertBeanList(orgCommunityDtos, ApiCommunityDataVo.class);
                for (OrgCommunityDto tmpOrgCommunityDto : orgCommunityDtos) {
                    for (ApiCommunityDataVo tmpApiCommunityDataVo : communitys) {
                        if (tmpOrgCommunityDto.getCommunityId().equals(tmpApiCommunityDataVo.getCommunityId())) {
                            tmpApiCommunityDataVo.setName(tmpOrgCommunityDto.getCommunityName());
                        }
                    }
                }
            } else {
                communitys = new ArrayList<>();
            }
        }
Api/src/main/java/com/java110/api/listener/org/DeleteOrgCommunityListener.java
New file
@@ -0,0 +1,91 @@
package com.java110.api.listener.org;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.api.listener.AbstractServiceApiListener;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.entity.center.AppService;
import com.java110.event.service.api.ServiceDataFlowEvent;
import com.java110.utils.constant.BusinessTypeConstant;
import com.java110.utils.constant.CommonConstant;
import com.java110.utils.constant.ServiceCodeOrgConstant;
import com.java110.utils.util.Assert;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
/**
 * 保存小区侦听
 * add by wuxw 2019-06-30
 */
@Java110Listener("deleteOrgCommunityListener")
public class DeleteOrgCommunityListener extends AbstractServiceApiListener {
    @Override
    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
        Assert.hasKeyAndValue(reqJson, "orgCommunityId", "组织ID不能为空");
    }
    @Override
    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
        HttpHeaders header = new HttpHeaders();
        context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D");
        JSONArray businesses = new JSONArray();
        AppService service = event.getAppService();
        //添加单元信息
        businesses.add(deleteOrgCommunity(reqJson, context));
        JSONObject paramInObj = super.restToCenterProtocol(businesses, context.getRequestCurrentHeaders());
        //将 rest header 信息传递到下层服务中去
        super.freshHttpHeader(header, context.getRequestCurrentHeaders());
        ResponseEntity<String> responseEntity = this.callService(context, service.getServiceCode(), paramInObj);
        context.setResponseEntity(responseEntity);
    }
    @Override
    public String getServiceCode() {
        return ServiceCodeOrgConstant.DELETE_ORG_COMMUNITY;
    }
    @Override
    public HttpMethod getHttpMethod() {
        return HttpMethod.POST;
    }
    @Override
    public int getOrder() {
        return DEFAULT_ORDER;
    }
    /**
     * 添加小区信息
     *
     * @param paramInJson     接口调用放传入入参
     * @param dataFlowContext 数据上下文
     * @return 订单服务能够接受的报文
     */
    private JSONObject deleteOrgCommunity(JSONObject paramInJson, DataFlowContext dataFlowContext) {
        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_DELETE_ORG_COMMUNITY);
        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ);
        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
        JSONObject businessOrg = new JSONObject();
        businessOrg.putAll(paramInJson);
        //计算 应收金额
        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessOrgCommunity", businessOrg);
        return business;
    }
}
Api/src/main/java/com/java110/api/listener/org/ListOrgCommunitysListener.java
New file
@@ -0,0 +1,97 @@
package com.java110.api.listener.org;
import com.alibaba.fastjson.JSONObject;
import com.java110.api.listener.AbstractServiceApiListener;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.core.smo.org.IOrgCommunityInnerServiceSMO;
import com.java110.core.smo.org.IOrgInnerServiceSMO;
import com.java110.dto.org.OrgCommunityDto;
import com.java110.dto.org.OrgDto;
import com.java110.event.service.api.ServiceDataFlowEvent;
import com.java110.utils.constant.ServiceCodeOrgConstant;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.vo.api.org.ApiOrgCommunityDataVo;
import com.java110.vo.api.org.ApiOrgCommunityVo;
import com.java110.vo.api.org.ApiOrgDataVo;
import com.java110.vo.api.org.ApiOrgVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import java.util.ArrayList;
import java.util.List;
/**
 * 查询小区侦听类
 */
@Java110Listener("listOrgCommunitysListener")
public class ListOrgCommunitysListener extends AbstractServiceApiListener {
    @Autowired
    private IOrgCommunityInnerServiceSMO orgCommunityInnerServiceSMOImpl;
    @Override
    public String getServiceCode() {
        return ServiceCodeOrgConstant.LIST_ORG_COMMUNITYS;
    }
    @Override
    public HttpMethod getHttpMethod() {
        return HttpMethod.GET;
    }
    @Override
    public int getOrder() {
        return DEFAULT_ORDER;
    }
    @Override
    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
        super.validatePageInfo(reqJson);
        Assert.hasKeyAndValue(reqJson, "storeId", "必填,请填写商户ID");
        Assert.hasKeyAndValue(reqJson, "orgId", "必填,请填写组织ID");
    }
    @Override
    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
        OrgCommunityDto orgCommunityDto = BeanConvertUtil.covertBean(reqJson, OrgCommunityDto.class);
        int count = orgCommunityInnerServiceSMOImpl.queryOrgCommunitysCount(orgCommunityDto);
        List<ApiOrgCommunityDataVo> orgCommunitys = null;
        if (count > 0) {
            orgCommunitys = BeanConvertUtil.covertBeanList(orgCommunityInnerServiceSMOImpl.queryOrgCommunitys(orgCommunityDto), ApiOrgCommunityDataVo.class);
        } else {
            orgCommunitys = new ArrayList<>();
        }
        ApiOrgCommunityVo apiOrgVo = new ApiOrgCommunityVo();
        apiOrgVo.setTotal(count);
        apiOrgVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row")));
        apiOrgVo.setOrgCommunitys(orgCommunitys);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiOrgVo), HttpStatus.OK);
        context.setResponseEntity(responseEntity);
    }
    public IOrgCommunityInnerServiceSMO getOrgCommunityInnerServiceSMOImpl() {
        return orgCommunityInnerServiceSMOImpl;
    }
    public void setOrgCommunityInnerServiceSMOImpl(IOrgCommunityInnerServiceSMO orgCommunityInnerServiceSMOImpl) {
        this.orgCommunityInnerServiceSMOImpl = orgCommunityInnerServiceSMOImpl;
    }
}
Api/src/main/java/com/java110/api/listener/org/ListOrgNoCommunitysListener.java
New file
@@ -0,0 +1,111 @@
package com.java110.api.listener.org;
import com.alibaba.fastjson.JSONObject;
import com.java110.api.listener.AbstractServiceApiListener;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.core.smo.community.ICommunityInnerServiceSMO;
import com.java110.core.smo.org.IOrgCommunityInnerServiceSMO;
import com.java110.dto.community.CommunityDto;
import com.java110.dto.org.OrgCommunityDto;
import com.java110.event.service.api.ServiceDataFlowEvent;
import com.java110.utils.constant.ServiceCodeOrgConstant;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.vo.api.community.ApiCommunityDataVo;
import com.java110.vo.api.community.ApiCommunityVo;
import com.java110.vo.api.org.ApiOrgCommunityDataVo;
import com.java110.vo.api.org.ApiOrgCommunityVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import java.util.ArrayList;
import java.util.List;
/**
 * 查询小区侦听类
 */
@Java110Listener("listOrgNoCommunitysListener")
public class ListOrgNoCommunitysListener extends AbstractServiceApiListener {
    @Autowired
    private IOrgCommunityInnerServiceSMO orgCommunityInnerServiceSMOImpl;
    @Autowired
    private ICommunityInnerServiceSMO communityInnerServiceSMOImpl;
    @Override
    public String getServiceCode() {
        return ServiceCodeOrgConstant.LIST_ORG_NO_COMMUNITYS;
    }
    @Override
    public HttpMethod getHttpMethod() {
        return HttpMethod.GET;
    }
    @Override
    public int getOrder() {
        return DEFAULT_ORDER;
    }
    @Override
    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
        super.validatePageInfo(reqJson);
        Assert.hasKeyAndValue(reqJson, "storeId", "必填,请填写商户ID");
        Assert.hasKeyAndValue(reqJson, "orgId", "必填,请填写组织ID");
    }
    @Override
    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
        OrgCommunityDto orgCommunityDto = BeanConvertUtil.covertBean(reqJson, OrgCommunityDto.class);
        List<OrgCommunityDto> orgCommunityDtos = orgCommunityInnerServiceSMOImpl.queryOrgCommunitys(orgCommunityDto);
        List<String> communityIds = new ArrayList<>();
        for(OrgCommunityDto tmpOrgCommunityDto : orgCommunityDtos){
            communityIds.add(tmpOrgCommunityDto.getCommunityId());
        }
        CommunityDto communityDto = BeanConvertUtil.covertBean(reqJson, CommunityDto.class);;
        if(communityIds.size()>0) {
            communityDto.setNotInCommunityId(communityIds.toArray(new String[communityIds.size()]));
        }
        communityDto.setAuditStatusCd("1100");
        communityDto.setMemberId(reqJson.getString("storeId"));
        int count = communityInnerServiceSMOImpl.queryCommunitysCount(communityDto);
        List<ApiCommunityDataVo> communitys = null;
        if (count > 0) {
            communitys = BeanConvertUtil.covertBeanList(communityInnerServiceSMOImpl.queryCommunitys(communityDto), ApiCommunityDataVo.class);
        } else {
            communitys = new ArrayList<>();
        }
        ApiCommunityVo apiCommunityVo = new ApiCommunityVo();
        apiCommunityVo.setTotal(count);
        apiCommunityVo.setRecords((int) Math.ceil((double) count / (double) reqJson.getInteger("row")));
        apiCommunityVo.setCommunitys(communitys);
        ResponseEntity<String> responseEntity = new ResponseEntity<String>(JSONObject.toJSONString(apiCommunityVo), HttpStatus.OK);
        context.setResponseEntity(responseEntity);
    }
    public IOrgCommunityInnerServiceSMO getOrgCommunityInnerServiceSMOImpl() {
        return orgCommunityInnerServiceSMOImpl;
    }
    public void setOrgCommunityInnerServiceSMOImpl(IOrgCommunityInnerServiceSMO orgCommunityInnerServiceSMOImpl) {
        this.orgCommunityInnerServiceSMOImpl = orgCommunityInnerServiceSMOImpl;
    }
}
Api/src/main/java/com/java110/api/listener/org/SaveOrgCommunityListener.java
New file
@@ -0,0 +1,101 @@
package com.java110.api.listener.org;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.api.listener.AbstractServiceApiListener;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.entity.center.AppService;
import com.java110.event.service.api.ServiceDataFlowEvent;
import com.java110.utils.constant.BusinessTypeConstant;
import com.java110.utils.constant.CommonConstant;
import com.java110.utils.constant.ServiceCodeOrgConstant;
import com.java110.utils.util.Assert;
import org.springframework.http.HttpHeaders;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
/**
 * 保存小区侦听
 * add by wuxw 2019-06-30
 */
@Java110Listener("saveOrgCommunityListener")
public class SaveOrgCommunityListener extends AbstractServiceApiListener {
    @Override
    protected void validate(ServiceDataFlowEvent event, JSONObject reqJson) {
        //Assert.hasKeyAndValue(reqJson, "xxx", "xxx");
        Assert.hasKeyAndValue(reqJson, "orgId", "必填,请填写组织ID");
        Assert.hasKeyAndValue(reqJson, "orgName", "必填,请填写组织名称");
        if (!reqJson.containsKey("communitys") || reqJson.getJSONArray("communitys").size() < 1) {
            throw new IllegalArgumentException("未包含小区信息");
        }
    }
    @Override
    protected void doSoService(ServiceDataFlowEvent event, DataFlowContext context, JSONObject reqJson) {
        HttpHeaders header = new HttpHeaders();
        context.getRequestCurrentHeaders().put(CommonConstant.HTTP_ORDER_TYPE_CD, "D");
        JSONArray businesses = new JSONArray();
        AppService service = event.getAppService();
        //添加单元信息
        JSONArray communitys = reqJson.getJSONArray("communitys");
        for (int communityIndex = 0; communityIndex < communitys.size(); communityIndex++) {
            businesses.add(addOrgCommunity(reqJson, communitys.getJSONObject(communityIndex), communityIndex, context));
        }
        JSONObject paramInObj = super.restToCenterProtocol(businesses, context.getRequestCurrentHeaders());
        //将 rest header 信息传递到下层服务中去
        super.freshHttpHeader(header, context.getRequestCurrentHeaders());
        ResponseEntity<String> responseEntity = this.callService(context, service.getServiceCode(), paramInObj);
        context.setResponseEntity(responseEntity);
    }
    @Override
    public String getServiceCode() {
        return ServiceCodeOrgConstant.ADD_ORG_COMMUNITY;
    }
    @Override
    public HttpMethod getHttpMethod() {
        return HttpMethod.POST;
    }
    @Override
    public int getOrder() {
        return DEFAULT_ORDER;
    }
    /**
     * 添加小区信息
     *
     * @param paramInJson     接口调用放传入入参
     * @param dataFlowContext 数据上下文
     * @return 订单服务能够接受的报文
     */
    private JSONObject addOrgCommunity(JSONObject paramInJson, JSONObject communityObj, int seq, DataFlowContext dataFlowContext) {
        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_ORG_COMMUNITY);
        business.put(CommonConstant.HTTP_SEQ, DEFAULT_SEQ + seq);
        business.put(CommonConstant.HTTP_INVOKE_MODEL, CommonConstant.HTTP_INVOKE_MODEL_S);
        JSONObject businessOrg = new JSONObject();
        businessOrg.putAll(paramInJson);
        businessOrg.put("orgCommunityId", "-1");
        businessOrg.put("communityId", communityObj.getString("communityId"));
        businessOrg.put("communityName", communityObj.getString("communityName"));
        //计算 应收金额
        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessOrgCommunity", businessOrg);
        return business;
    }
}
Api/src/main/java/com/java110/api/listener/org/SaveOrgListener.java
@@ -31,7 +31,7 @@
        Assert.hasKeyAndValue(reqJson, "orgName", "必填,请填写组织名称");
        Assert.hasKeyAndValue(reqJson, "orgLevel", "必填,请填写报修人名称");
        Assert.hasKeyAndValue(reqJson, "parentOrgId", "必填,请选择上级ID");
        Assert.hasKeyAndValue(reqJson, "belongCommunityId", "必填,请选择隶属小区");
        //Assert.hasKeyAndValue(reqJson, "belongCommunityId", "必填,请选择隶属小区");
        //Assert.hasKeyAndValue(reqJson, "description", "必填,请填写描述");
        Assert.hasKeyAndValue(reqJson, "storeId", "必填,请填写商户ID");
@@ -93,6 +93,7 @@
        businessOrg.putAll(paramInJson);
        businessOrg.put("orgId", "-1");
        businessOrg.put("allowOperation", "T");
        businessOrg.put("belongCommunityId", "8888");
        //计算 应收金额
        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessOrg", businessOrg);
        return business;
Api/src/main/java/com/java110/api/listener/org/UpdateOrgListener.java
@@ -38,7 +38,6 @@
        Assert.hasKeyAndValue(reqJson, "orgName", "必填,请填写组织名称");
        Assert.hasKeyAndValue(reqJson, "orgLevel", "必填,请填写报修人名称");
        Assert.hasKeyAndValue(reqJson, "parentOrgId", "必填,请选择上级ID");
        Assert.hasKeyAndValue(reqJson, "belongCommunityId", "必填,请选择隶属小区");
        //Assert.hasKeyAndValue(reqJson, "description", "必填,请填写描述");
        Assert.hasKeyAndValue(reqJson, "storeId", "必填,请填写商户ID");
@@ -106,6 +105,7 @@
        JSONObject businessOrg = new JSONObject();
        businessOrg.putAll(paramInJson);
        businessOrg.put("allowOperation", orgDtos.get(0).getAllowOperation());
        businessOrg.put("belongCommunityId", orgDtos.get(0).getBelongCommunityId());
        //计算 应收金额
        business.getJSONObject(CommonConstant.HTTP_BUSINESS_DATAS).put("businessOrg", businessOrg);
        return business;
Api/src/main/java/com/java110/api/listener/user/AddStaffServiceListener.java
@@ -13,6 +13,7 @@
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.entity.center.AppService;
import com.java110.event.service.api.ServiceDataFlowEvent;
import com.java110.utils.util.StringUtil;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.*;
@@ -160,13 +161,19 @@
        //校验json 格式中是否包含 name,email,levelCd,tel
        Assert.jsonObjectHaveKey(paramObj,"name","请求参数中未包含name 节点,请确认");
        Assert.jsonObjectHaveKey(paramObj,"email","请求参数中未包含email 节点,请确认");
        //Assert.jsonObjectHaveKey(paramObj,"email","请求参数中未包含email 节点,请确认");
        Assert.jsonObjectHaveKey(paramObj,"tel","请求参数中未包含tel 节点,请确认");
        Assert.jsonObjectHaveKey(paramObj,"orgId", "请求报文格式错误或未包含部门信息");
        Assert.jsonObjectHaveKey(paramObj,"address", "请求报文格式错误或未包含地址信息");
        Assert.jsonObjectHaveKey(paramObj,"sex", "请求报文格式错误或未包含性别信息");
        Assert.jsonObjectHaveKey(paramObj,"relCd", "请求报文格式错误或未包含员工角色");
        if (paramObj.containsKey("email") && !StringUtil.isEmpty(paramObj.getString("email"))) {
            Assert.isEmail(paramObj, "email", "不是有效的邮箱格式");
        }
        JSONObject business = JSONObject.parseObject("{\"datas\":{}}");
        business.put(CommonConstant.HTTP_BUSINESS_TYPE_CD, BusinessTypeConstant.BUSINESS_TYPE_SAVE_USER_INFO);
        business.put(CommonConstant.HTTP_SEQ,1);
OrderService/src/main/java/com/java110/order/api/PrivilegeApi.java
@@ -86,6 +86,23 @@
        }
    }
    @RequestMapping(path = "/editPrivilegeGroup",method= RequestMethod.POST)
    @ApiOperation(value="编辑权限组", notes="test: 返回 200 表示服务受理成功,其他表示失败")
    @ApiImplicitParam(paramType="query", name = "privilegeGroupInfo", value = "权限信息", required = true, dataType = "String")
    public ResponseEntity<String> editPrivilegeGroup(@RequestBody String privilegeGroupInfo,HttpServletRequest request){
        ResponseEntity<String> responseEntity = null;
        try {
            responseEntity = privilegeSMOImpl.editPrivilegeGroup(privilegeGroupInfo);
        }catch (Exception e){
            logger.error("请求订单异常",e);
            responseEntity =  new ResponseEntity<String>("请求中心服务发生异常,"+e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
        }finally {
            logger.debug("订单服务返回报文为: {}",responseEntity);
            return responseEntity;
        }
    }
    @RequestMapping(path = "/deletePrivilegeGroup",method= RequestMethod.POST)
    @ApiOperation(value="删除权限组", notes="test: 返回 200 表示服务受理成功,其他表示失败")
    @ApiImplicitParam(paramType="query", name = "privilegeGroupInfo", value = "权限信息", required = true, dataType = "String")
OrderService/src/main/java/com/java110/order/dao/IPrivilegeDAO.java
@@ -33,6 +33,13 @@
    public boolean savePrivilegeGroup(Map info);
    /**
     * 编辑权限组
     * @param info
     * @return
     */
    public boolean updatePrivilegeGroup(Map info);
    /**
     * 删除权限组
     * @param info
     * @return
OrderService/src/main/java/com/java110/order/dao/impl/PrivilegeDAOImpl.java
@@ -66,6 +66,21 @@
    }
    /**
     * 保存权限组
     * @param info
     * @return
     */
    @Override
    public boolean updatePrivilegeGroup(Map info) {
        logger.debug("编辑权限组信息入参:{}",info);
        int saveFlag = sqlSessionTemplate.insert("privilegeDAOImpl.updatePrivilegeGroup",info);
        if(saveFlag < 1){
            throw new DAOException(ResponseConstant.RESULT_CODE_INNER_ERROR,"编辑权限组信息失败:"+ JSONObject.toJSONString(info));
        }
        return true;
    }
    /**
     * 删除权限组
     * @param info
     * @return
OrderService/src/main/java/com/java110/order/smo/IPrivilegeSMO.java
@@ -33,6 +33,12 @@
    /**
     * 编辑权限组
     * @param privilegeGroupInfo
     * @return
     */
    public ResponseEntity<String> editPrivilegeGroup(String privilegeGroupInfo);
    /**
     * 删除权限组
     * @param privilegeGroupInfo
     * @return
OrderService/src/main/java/com/java110/order/smo/impl/PrivilegeSMOImpl.java
@@ -1,5 +1,6 @@
package com.java110.order.smo.impl;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.utils.cache.MappingCache;
import com.java110.utils.constant.MappingConstant;
@@ -64,6 +65,7 @@
    /**
     * 删除用户权限
     *
     * @param privilegeInfo
     * @return
     */
@@ -102,8 +104,29 @@
        return new ResponseEntity<String>("未知异常", HttpStatus.INTERNAL_SERVER_ERROR);
    }
    @Override
    public ResponseEntity<String> editPrivilegeGroup(String privilegeGroupInfo) {
        Assert.isJsonObject(privilegeGroupInfo, "请求报文不是有效的json格式");
        Assert.jsonObjectHaveKey(privilegeGroupInfo, "name", "请求报文中未包含name节点");
        Assert.jsonObjectHaveKey(privilegeGroupInfo, "pgId", "请求报文中未包含pgId节点");
        Assert.jsonObjectHaveKey(privilegeGroupInfo, "storeId", "请求报文中未包含storeId节点");
        Assert.jsonObjectHaveKey(privilegeGroupInfo, "storeTypeCd", "请求报文中未包含storeTypeCd节点");
        JSONObject privilegeGroupObj = JSONObject.parseObject(privilegeGroupInfo);
        if (privilegeDAOImpl.updatePrivilegeGroup(privilegeGroupObj)) {
            return new ResponseEntity<String>("成功", HttpStatus.OK);
        }
        return new ResponseEntity<String>("未知异常", HttpStatus.INTERNAL_SERVER_ERROR);
    }
    /**
     * 删除权限组
     *
     * @param privilegeGroupInfo
     * @return
     */
@@ -139,22 +162,41 @@
        Assert.jsonObjectHaveKey(privilegeInfo, "pgId", "请求报文中未包含pgId节点");
        Assert.jsonObjectHaveKey(privilegeInfo, "storeId", "请求报文中未包含storeId节点");
        Assert.jsonObjectHaveKey(privilegeInfo, "pId", "请求报文中未包含pId节点");
        JSONObject privilegeObj = JSONObject.parseObject(privilegeInfo);
        //Assert.jsonObjectHaveKey(privilegeInfoObj,"pId","请求报文中未包含权限ID 节点");
        if (!privilegeObj.containsKey("pIds") || privilegeObj.getJSONArray("pIds").size() < 1) {
            throw new IllegalArgumentException("请求报文中未包含权限");
        }
        //根据权限组ID和商户ID查询是否有数据
        List<Map> privilegeGroups = privilegeDAOImpl.queryPrivilegeGroup(privilegeObj);
        Assert.isNotNull(privilegeGroups, "当前没有权限操作权限组pgId = " + privilegeObj.getString("pgId"));
        JSONArray pIds = privilegeObj.getJSONArray("pIds");
        int errorCount = 0;
        JSONObject tmpPId = null;
        for (int pIdIndex = 0; pIdIndex < pIds.size(); pIdIndex++) {
            try {
                tmpPId = pIds.getJSONObject(pIdIndex);
                privilegeObj.put("pId", tmpPId.getString("pId"));
        if (!privilegeDAOImpl.addPrivilegeRel(privilegeObj)) {
            return new ResponseEntity<String>("添加权限失败", HttpStatus.INTERNAL_SERVER_ERROR);
                    errorCount++;
        }
        return new ResponseEntity<String>("成功", HttpStatus.OK);
            } catch (Exception e) {
                logger.error("保存权限关系失败", e);
                errorCount++;
            }
        }
        JSONObject paramOut = new JSONObject();
        paramOut.put("success", pIds.size() - errorCount);
        paramOut.put("error", errorCount);
        return new ResponseEntity<String>(paramOut.toJSONString(), HttpStatus.OK);
    }
    /**
     *
     * @param privilegeInfo
     * @return
     */
@@ -183,28 +225,46 @@
    /**
     * 员工添加权限或权限组
     *
     * @param privilegeInfo
     * @return
     */
    @Override
    public ResponseEntity<String> addStaffPrivilegeOrPrivilegeGroup(String privilegeInfo) {
        JSONObject privilegeObj = validateData(privilegeInfo);
        Assert.jsonObjectHaveKey(privilegeInfo, "pIds", "请求报文中未包含pIds节点");
        JSONObject privilegeObj = JSONObject.parseObject(privilegeInfo);
        JSONArray pIds = privilegeObj.getJSONArray("pIds");
        int errorCount = 0;
        for (int pIndex = 0; pIndex < pIds.size(); pIndex++) {
            privilegeObj.put("pId", pIds.getJSONObject(pIndex).getString("pId"));
            try {
                validateData(privilegeObj);
        //根据权限组ID和商户ID查询是否有数据
        String pFlag = privilegeObj.getString("pFlag");//权限组
        privilegeObj.put("privilegeFlag","1".equals(pFlag)?"1":"0");
        List<Map> privilegeGroups = privilegeDAOImpl.queryUserPrivilege(privilegeObj);
        Assert.listIsNull(privilegeGroups, "已经存在该权限无需多次添加" + privilegeInfo);
        if (!privilegeDAOImpl.addUserPrivilege(privilegeObj)) {
            return new ResponseEntity<String>("添加权限失败", HttpStatus.INTERNAL_SERVER_ERROR);
        }
            } catch (Exception e) {
                logger.error("保存权限失败", e);
                errorCount++;
            }
        }
        return new ResponseEntity<String>("成功", HttpStatus.OK);
        JSONObject paramOut = new JSONObject();
        paramOut.put("success", pIds.size() - errorCount);
        paramOut.put("error", errorCount);
        return new ResponseEntity<String>(paramOut.toJSONString(), HttpStatus.OK);
    }
    /**
     * 删除员工权限
     *
     * @param privilegeInfo
     * @return
     */
@@ -226,6 +286,7 @@
    /**
     * 数据校验
     *
     * @param privilegeInfo
     * @return
     */
@@ -253,21 +314,18 @@
        return privilegeObj;
    }
    private JSONObject validateData(String privilegeInfo) {
    private JSONObject validateData(JSONObject privilegeObj) {
        Assert.isJsonObject(privilegeInfo, "请求报文不是有效的json格式");
        Assert.jsonObjectHaveKey(privilegeObj, "pId", "请求报文中未包含pId节点");
        Assert.jsonObjectHaveKey(privilegeInfo, "pId", "请求报文中未包含pId节点");
        Assert.jsonObjectHaveKey(privilegeObj, "pFlag", "请求报文中未包含pFlag节点");
        Assert.jsonObjectHaveKey(privilegeInfo, "pFlag", "请求报文中未包含pFlag节点");
        Assert.jsonObjectHaveKey(privilegeObj, "userId", "请求报文中未包含userId节点");
        Assert.jsonObjectHaveKey(privilegeInfo, "userId", "请求报文中未包含userId节点");
        Assert.jsonObjectHaveKey(privilegeObj, "storeId", "请求报文中未包含storeId节点");
        Assert.jsonObjectHaveKey(privilegeInfo, "storeId", "请求报文中未包含storeId节点");
        Assert.jsonObjectHaveKey(privilegeObj, "storeTypeCd", "请求报文中未包含storeTypeCd节点");
        Assert.jsonObjectHaveKey(privilegeInfo, "storeTypeCd", "请求报文中未包含storeTypeCd节点");
        JSONObject privilegeObj = JSONObject.parseObject(privilegeInfo);
        String pFlag = privilegeObj.getString("pFlag");//权限组
        if("1".equals(pFlag)){
            validatePrivilegeGroup(privilegeObj);
@@ -279,6 +337,7 @@
    /**
     * 权限组数据校验
     *
     * @param privilegeObj
     */
    private void validatePrivilegeGroup(JSONObject privilegeObj){
@@ -293,6 +352,7 @@
    /**
     * 权限数据校验
     *
     * @param privilegeObj
     */
    private void validatePrivilege(JSONObject privilegeObj){
UserService/src/main/java/com/java110/user/dao/IOrgCommunityServiceDao.java
New file
@@ -0,0 +1,81 @@
package com.java110.user.dao;
import com.java110.utils.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 IOrgCommunityServiceDao {
    /**
     * 保存 隶属小区信息
     * @param businessOrgCommunityInfo 隶属小区信息 封装
     * @throws DAOException 操作数据库异常
     */
    void saveBusinessOrgCommunityInfo(Map businessOrgCommunityInfo) throws DAOException;
    /**
     * 查询隶属小区信息(business过程)
     * 根据bId 查询隶属小区信息
     * @param info bId 信息
     * @return 隶属小区信息
     * @throws DAOException DAO异常
     */
    List<Map> getBusinessOrgCommunityInfo(Map info) throws DAOException;
    /**
     * 保存 隶属小区信息 Business数据到 Instance中
     * @param info
     * @throws DAOException DAO异常
     */
    void saveOrgCommunityInfoInstance(Map info) throws DAOException;
    /**
     * 查询隶属小区信息(instance过程)
     * 根据bId 查询隶属小区信息
     * @param info bId 信息
     * @return 隶属小区信息
     * @throws DAOException DAO异常
     */
    List<Map> getOrgCommunityInfo(Map info) throws DAOException;
    /**
     * 修改隶属小区信息
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    void updateOrgCommunityInfoInstance(Map info) throws DAOException;
    /**
     * 查询隶属小区总数
     *
     * @param info 隶属小区信息
     * @return 隶属小区数量
     */
    int queryOrgCommunitysCount(Map info);
}
UserService/src/main/java/com/java110/user/dao/impl/OrgCommunityServiceDaoImpl.java
New file
@@ -0,0 +1,134 @@
package com.java110.user.dao.impl;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.base.dao.BaseServiceDao;
import com.java110.user.dao.IOrgCommunityServiceDao;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.exception.DAOException;
import com.java110.utils.util.DateUtil;
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("orgCommunityServiceDaoImpl")
//@Transactional
public class OrgCommunityServiceDaoImpl extends BaseServiceDao implements IOrgCommunityServiceDao {
    private static Logger logger = LoggerFactory.getLogger(OrgCommunityServiceDaoImpl.class);
    /**
     * 隶属小区信息封装
     *
     * @param businessOrgCommunityInfo 隶属小区信息 封装
     * @throws DAOException DAO异常
     */
    @Override
    public void saveBusinessOrgCommunityInfo(Map businessOrgCommunityInfo) throws DAOException {
        businessOrgCommunityInfo.put("month", DateUtil.getCurrentMonth());
        // 查询business_user 数据是否已经存在
        logger.debug("保存隶属小区信息 入参 businessOrgCommunityInfo : {}", businessOrgCommunityInfo);
        int saveFlag = sqlSessionTemplate.insert("orgCommunityServiceDaoImpl.saveBusinessOrgCommunityInfo", businessOrgCommunityInfo);
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "保存隶属小区数据失败:" + JSONObject.toJSONString(businessOrgCommunityInfo));
        }
    }
    /**
     * 查询隶属小区信息
     *
     * @param info bId 信息
     * @return 隶属小区信息
     * @throws DAOException DAO异常
     */
    @Override
    public List<Map> getBusinessOrgCommunityInfo(Map info) throws DAOException {
        logger.debug("查询隶属小区信息 入参 info : {}", info);
        List<Map> businessOrgCommunityInfos = sqlSessionTemplate.selectList("orgCommunityServiceDaoImpl.getBusinessOrgCommunityInfo", info);
        return businessOrgCommunityInfos;
    }
    /**
     * 保存隶属小区信息 到 instance
     *
     * @param info bId 信息
     * @throws DAOException DAO异常
     */
    @Override
    public void saveOrgCommunityInfoInstance(Map info) throws DAOException {
        logger.debug("保存隶属小区信息Instance 入参 info : {}", info);
        int saveFlag = sqlSessionTemplate.insert("orgCommunityServiceDaoImpl.saveOrgCommunityInfoInstance", 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> getOrgCommunityInfo(Map info) throws DAOException {
        logger.debug("查询隶属小区信息 入参 info : {}", info);
        List<Map> businessOrgCommunityInfos = sqlSessionTemplate.selectList("orgCommunityServiceDaoImpl.getOrgCommunityInfo", info);
        return businessOrgCommunityInfos;
    }
    /**
     * 修改隶属小区信息
     *
     * @param info 修改信息
     * @throws DAOException DAO异常
     */
    @Override
    public void updateOrgCommunityInfoInstance(Map info) throws DAOException {
        logger.debug("修改隶属小区信息Instance 入参 info : {}", info);
        int saveFlag = sqlSessionTemplate.update("orgCommunityServiceDaoImpl.updateOrgCommunityInfoInstance", info);
        if (saveFlag < 1) {
            throw new DAOException(ResponseConstant.RESULT_PARAM_ERROR, "修改隶属小区信息Instance数据失败:" + JSONObject.toJSONString(info));
        }
    }
    /**
     * 查询隶属小区数量
     *
     * @param info 隶属小区信息
     * @return 隶属小区数量
     */
    @Override
    public int queryOrgCommunitysCount(Map info) {
        logger.debug("查询隶属小区数据 入参 info : {}", info);
        List<Map> businessOrgCommunityInfos = sqlSessionTemplate.selectList("orgCommunityServiceDaoImpl.queryOrgCommunitysCount", info);
        if (businessOrgCommunityInfos.size() < 1) {
            return 0;
        }
        return Integer.parseInt(businessOrgCommunityInfos.get(0).get("count").toString());
    }
}
UserService/src/main/java/com/java110/user/listener/orgCommunity/AbstractOrgCommunityBusinessServiceDataFlowListener.java
New file
@@ -0,0 +1,85 @@
package com.java110.user.listener.orgCommunity;
import com.alibaba.fastjson.JSONObject;
import com.java110.entity.center.Business;
import com.java110.event.service.AbstractBusinessServiceDataFlowListener;
import com.java110.user.dao.IOrgCommunityServiceDao;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.constant.StatusConstant;
import com.java110.utils.exception.ListenerExecuteException;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 隶属小区 服务侦听 父类
 * Created by wuxw on 2018/7/4.
 */
public abstract class AbstractOrgCommunityBusinessServiceDataFlowListener extends AbstractBusinessServiceDataFlowListener {
    private static Logger logger = LoggerFactory.getLogger(AbstractOrgCommunityBusinessServiceDataFlowListener.class);
    /**
     * 获取 DAO工具类
     *
     * @return
     */
    public abstract IOrgCommunityServiceDao getOrgCommunityServiceDaoImpl();
    /**
     * 刷新 businessOrgCommunityInfo 数据
     * 主要将 数据库 中字段和 接口传递字段建立关系
     *
     * @param businessOrgCommunityInfo
     */
    protected void flushBusinessOrgCommunityInfo(Map businessOrgCommunityInfo, String statusCd) {
        businessOrgCommunityInfo.put("newBId", businessOrgCommunityInfo.get("b_id"));
        businessOrgCommunityInfo.put("orgName", businessOrgCommunityInfo.get("org_name"));
        businessOrgCommunityInfo.put("operate", businessOrgCommunityInfo.get("operate"));
        businessOrgCommunityInfo.put("communityName", businessOrgCommunityInfo.get("community_name"));
        businessOrgCommunityInfo.put("communityId", businessOrgCommunityInfo.get("community_id"));
        businessOrgCommunityInfo.put("storeId", businessOrgCommunityInfo.get("store_id"));
        businessOrgCommunityInfo.put("orgId", businessOrgCommunityInfo.get("org_id"));
        businessOrgCommunityInfo.put("orgCommunityId", businessOrgCommunityInfo.get("org_community_id"));
        businessOrgCommunityInfo.remove("bId");
        businessOrgCommunityInfo.put("statusCd", statusCd);
    }
    /**
     * 当修改数据时,查询instance表中的数据 自动保存删除数据到business中
     *
     * @param businessOrgCommunity 隶属小区信息
     */
    protected void autoSaveDelBusinessOrgCommunity(Business business, JSONObject businessOrgCommunity) {
//自动插入DEL
        Map info = new HashMap();
        info.put("orgCommunityId", businessOrgCommunity.getString("orgCommunityId"));
        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
        List<Map> currentOrgCommunityInfos = getOrgCommunityServiceDaoImpl().getOrgCommunityInfo(info);
        if (currentOrgCommunityInfos == null || currentOrgCommunityInfos.size() != 1) {
            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "未找到需要修改数据信息,入参错误或数据有问题,请检查" + info);
        }
        Map currentOrgCommunityInfo = currentOrgCommunityInfos.get(0);
        currentOrgCommunityInfo.put("bId", business.getbId());
        currentOrgCommunityInfo.put("orgName", currentOrgCommunityInfo.get("org_name"));
        currentOrgCommunityInfo.put("operate", currentOrgCommunityInfo.get("operate"));
        currentOrgCommunityInfo.put("communityName", currentOrgCommunityInfo.get("community_name"));
        currentOrgCommunityInfo.put("communityId", currentOrgCommunityInfo.get("community_id"));
        currentOrgCommunityInfo.put("storeId", currentOrgCommunityInfo.get("store_id"));
        currentOrgCommunityInfo.put("orgId", currentOrgCommunityInfo.get("org_id"));
        currentOrgCommunityInfo.put("orgCommunityId", currentOrgCommunityInfo.get("org_community_id"));
        currentOrgCommunityInfo.put("operate", StatusConstant.OPERATE_DEL);
        getOrgCommunityServiceDaoImpl().saveBusinessOrgCommunityInfo(currentOrgCommunityInfo);
    }
}
UserService/src/main/java/com/java110/user/listener/orgCommunity/DeleteOrgCommunityInfoListener.java
New file
@@ -0,0 +1,180 @@
package com.java110.user.listener.orgCommunity;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.entity.center.Business;
import com.java110.user.dao.IOrgCommunityServiceDao;
import com.java110.utils.constant.BusinessTypeConstant;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.constant.StatusConstant;
import com.java110.utils.exception.ListenerExecuteException;
import com.java110.utils.util.Assert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 删除隶属小区信息 侦听
 * <p>
 * 处理节点
 * 1、businessOrgCommunity:{} 隶属小区基本信息节点
 * 2、businessOrgCommunityAttr:[{}] 隶属小区属性信息节点
 * 3、businessOrgCommunityPhoto:[{}] 隶属小区照片信息节点
 * 4、businessOrgCommunityCerdentials:[{}] 隶属小区证件信息节点
 * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E5%88%A0%E9%99%A4%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
 * Created by wuxw on 2018/5/18.
 */
@Java110Listener("deleteOrgCommunityInfoListener")
@Transactional
public class DeleteOrgCommunityInfoListener extends AbstractOrgCommunityBusinessServiceDataFlowListener {
    private final static Logger logger = LoggerFactory.getLogger(DeleteOrgCommunityInfoListener.class);
    @Autowired
    IOrgCommunityServiceDao orgCommunityServiceDaoImpl;
    @Override
    public int getOrder() {
        return 3;
    }
    @Override
    public String getBusinessTypeCd() {
        return BusinessTypeConstant.BUSINESS_TYPE_DELETE_ORG_COMMUNITY;
    }
    /**
     * 根据删除信息 查出Instance表中数据 保存至business表 (状态写DEL) 方便撤单时直接更新回去
     *
     * @param dataFlowContext 数据对象
     * @param business        当前业务对象
     */
    @Override
    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
        JSONObject data = business.getDatas();
        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
        //处理 businessOrgCommunity 节点
        if (data.containsKey("businessOrgCommunity")) {
            //处理 businessOrgCommunity 节点
            if (data.containsKey("businessOrgCommunity")) {
                Object _obj = data.get("businessOrgCommunity");
                JSONArray businessOrgCommunitys = null;
                if (_obj instanceof JSONObject) {
                    businessOrgCommunitys = new JSONArray();
                    businessOrgCommunitys.add(_obj);
                } else {
                    businessOrgCommunitys = (JSONArray) _obj;
                }
                //JSONObject businessOrgCommunity = data.getJSONObject("businessOrgCommunity");
                for (int _orgCommunityIndex = 0; _orgCommunityIndex < businessOrgCommunitys.size(); _orgCommunityIndex++) {
                    JSONObject businessOrgCommunity = businessOrgCommunitys.getJSONObject(_orgCommunityIndex);
                    doBusinessOrgCommunity(business, businessOrgCommunity);
                    if (_obj instanceof JSONObject) {
                        dataFlowContext.addParamOut("orgCommunityId", businessOrgCommunity.getString("orgCommunityId"));
                    }
                }
            }
        }
    }
    /**
     * 删除 instance数据
     *
     * @param dataFlowContext 数据对象
     * @param business        当前业务对象
     */
    @Override
    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
        String bId = business.getbId();
        //Assert.hasLength(bId,"请求报文中没有包含 bId");
        //隶属小区信息
        Map info = new HashMap();
        info.put("bId", business.getbId());
        info.put("operate", StatusConstant.OPERATE_DEL);
        //隶属小区信息
        List<Map> businessOrgCommunityInfos = orgCommunityServiceDaoImpl.getBusinessOrgCommunityInfo(info);
        if (businessOrgCommunityInfos != null && businessOrgCommunityInfos.size() > 0) {
            for (int _orgCommunityIndex = 0; _orgCommunityIndex < businessOrgCommunityInfos.size(); _orgCommunityIndex++) {
                Map businessOrgCommunityInfo = businessOrgCommunityInfos.get(_orgCommunityIndex);
                flushBusinessOrgCommunityInfo(businessOrgCommunityInfo, StatusConstant.STATUS_CD_INVALID);
                orgCommunityServiceDaoImpl.updateOrgCommunityInfoInstance(businessOrgCommunityInfo);
                dataFlowContext.addParamOut("orgCommunityId", businessOrgCommunityInfo.get("org_community_id"));
            }
        }
    }
    /**
     * 撤单
     * 从business表中查询到DEL的数据 将instance中的数据更新回来
     *
     * @param dataFlowContext 数据对象
     * @param business        当前业务对象
     */
    @Override
    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
        String bId = business.getbId();
        //Assert.hasLength(bId,"请求报文中没有包含 bId");
        Map info = new HashMap();
        info.put("bId", bId);
        info.put("statusCd", StatusConstant.STATUS_CD_INVALID);
        Map delInfo = new HashMap();
        delInfo.put("bId", business.getbId());
        delInfo.put("operate", StatusConstant.OPERATE_DEL);
        //隶属小区信息
        List<Map> orgCommunityInfo = orgCommunityServiceDaoImpl.getOrgCommunityInfo(info);
        if (orgCommunityInfo != null && orgCommunityInfo.size() > 0) {
            //隶属小区信息
            List<Map> businessOrgCommunityInfos = orgCommunityServiceDaoImpl.getBusinessOrgCommunityInfo(delInfo);
            //除非程序出错了,这里不会为空
            if (businessOrgCommunityInfos == null || businessOrgCommunityInfos.size() == 0) {
                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(orgCommunity),程序内部异常,请检查! " + delInfo);
            }
            for (int _orgCommunityIndex = 0; _orgCommunityIndex < businessOrgCommunityInfos.size(); _orgCommunityIndex++) {
                Map businessOrgCommunityInfo = businessOrgCommunityInfos.get(_orgCommunityIndex);
                flushBusinessOrgCommunityInfo(businessOrgCommunityInfo, StatusConstant.STATUS_CD_VALID);
                orgCommunityServiceDaoImpl.updateOrgCommunityInfoInstance(businessOrgCommunityInfo);
            }
        }
    }
    /**
     * 处理 businessOrgCommunity 节点
     *
     * @param business             总的数据节点
     * @param businessOrgCommunity 隶属小区节点
     */
    private void doBusinessOrgCommunity(Business business, JSONObject businessOrgCommunity) {
        Assert.jsonObjectHaveKey(businessOrgCommunity, "orgCommunityId", "businessOrgCommunity 节点下没有包含 orgCommunityId 节点");
        if (businessOrgCommunity.getString("orgCommunityId").startsWith("-")) {
            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "orgCommunityId 错误,不能自动生成(必须已经存在的orgCommunityId)" + businessOrgCommunity);
        }
        //自动插入DEL
        autoSaveDelBusinessOrgCommunity(business, businessOrgCommunity);
    }
    public IOrgCommunityServiceDao getOrgCommunityServiceDaoImpl() {
        return orgCommunityServiceDaoImpl;
    }
    public void setOrgCommunityServiceDaoImpl(IOrgCommunityServiceDao orgCommunityServiceDaoImpl) {
        this.orgCommunityServiceDaoImpl = orgCommunityServiceDaoImpl;
    }
}
UserService/src/main/java/com/java110/user/listener/orgCommunity/SaveOrgCommunityInfoListener.java
New file
@@ -0,0 +1,179 @@
package com.java110.user.listener.orgCommunity;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.core.factory.GenerateCodeFactory;
import com.java110.entity.center.Business;
import com.java110.user.dao.IOrgCommunityServiceDao;
import com.java110.utils.constant.BusinessTypeConstant;
import com.java110.utils.constant.StatusConstant;
import com.java110.utils.util.Assert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 保存 隶属小区信息 侦听
 * Created by wuxw on 2018/5/18.
 */
@Java110Listener("saveOrgCommunityInfoListener")
@Transactional
public class SaveOrgCommunityInfoListener extends AbstractOrgCommunityBusinessServiceDataFlowListener {
    private static Logger logger = LoggerFactory.getLogger(SaveOrgCommunityInfoListener.class);
    @Autowired
    private IOrgCommunityServiceDao orgCommunityServiceDaoImpl;
    @Override
    public int getOrder() {
        return 0;
    }
    @Override
    public String getBusinessTypeCd() {
        return BusinessTypeConstant.BUSINESS_TYPE_SAVE_ORG_COMMUNITY;
    }
    /**
     * 保存隶属小区信息 business 表中
     *
     * @param dataFlowContext 数据对象
     * @param business        当前业务对象
     */
    @Override
    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
        JSONObject data = business.getDatas();
        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
        //处理 businessOrgCommunity 节点
        if (data.containsKey("businessOrgCommunity")) {
            Object bObj = data.get("businessOrgCommunity");
            JSONArray businessOrgCommunitys = null;
            if (bObj instanceof JSONObject) {
                businessOrgCommunitys = new JSONArray();
                businessOrgCommunitys.add(bObj);
            } else {
                businessOrgCommunitys = (JSONArray) bObj;
            }
            //JSONObject businessOrgCommunity = data.getJSONObject("businessOrgCommunity");
            for (int bOrgCommunityIndex = 0; bOrgCommunityIndex < businessOrgCommunitys.size(); bOrgCommunityIndex++) {
                JSONObject businessOrgCommunity = businessOrgCommunitys.getJSONObject(bOrgCommunityIndex);
                doBusinessOrgCommunity(business, businessOrgCommunity);
                if (bObj instanceof JSONObject) {
                    dataFlowContext.addParamOut("orgCommunityId", businessOrgCommunity.getString("orgCommunityId"));
                }
            }
        }
    }
    /**
     * business 数据转移到 instance
     *
     * @param dataFlowContext 数据对象
     * @param business        当前业务对象
     */
    @Override
    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
        JSONObject data = business.getDatas();
        Map info = new HashMap();
        info.put("bId", business.getbId());
        info.put("operate", StatusConstant.OPERATE_ADD);
        //隶属小区信息
        List<Map> businessOrgCommunityInfo = orgCommunityServiceDaoImpl.getBusinessOrgCommunityInfo(info);
        if (businessOrgCommunityInfo != null && businessOrgCommunityInfo.size() > 0) {
            reFreshShareColumn(info, businessOrgCommunityInfo.get(0));
            orgCommunityServiceDaoImpl.saveOrgCommunityInfoInstance(info);
            if (businessOrgCommunityInfo.size() == 1) {
                dataFlowContext.addParamOut("orgCommunityId", businessOrgCommunityInfo.get(0).get("org_community_id"));
            }
        }
    }
    /**
     * 刷 分片字段
     *
     * @param info         查询对象
     * @param businessInfo 小区ID
     */
    private void reFreshShareColumn(Map info, Map businessInfo) {
        if (info.containsKey("vId")) {
            return;
        }
        if (!businessInfo.containsKey("v_id")) {
            return;
        }
        info.put("vId", businessInfo.get("v_id"));
    }
    /**
     * 撤单
     *
     * @param dataFlowContext 数据对象
     * @param business        当前业务对象
     */
    @Override
    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
        String bId = business.getbId();
        //Assert.hasLength(bId,"请求报文中没有包含 bId");
        Map info = new HashMap();
        info.put("bId", bId);
        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
        Map paramIn = new HashMap();
        paramIn.put("bId", bId);
        paramIn.put("statusCd", StatusConstant.STATUS_CD_INVALID);
        //隶属小区信息
        List<Map> orgCommunityInfo = orgCommunityServiceDaoImpl.getOrgCommunityInfo(info);
        if (orgCommunityInfo != null && orgCommunityInfo.size() > 0) {
            reFreshShareColumn(paramIn, orgCommunityInfo.get(0));
            orgCommunityServiceDaoImpl.updateOrgCommunityInfoInstance(paramIn);
        }
    }
    /**
     * 处理 businessOrgCommunity 节点
     *
     * @param business             总的数据节点
     * @param businessOrgCommunity 隶属小区节点
     */
    private void doBusinessOrgCommunity(Business business, JSONObject businessOrgCommunity) {
        Assert.jsonObjectHaveKey(businessOrgCommunity, "orgCommunityId", "businessOrgCommunity 节点下没有包含 orgCommunityId 节点");
        if (businessOrgCommunity.getString("orgCommunityId").startsWith("-")) {
            //刷新缓存
            //flushOrgCommunityId(business.getDatas());
            businessOrgCommunity.put("orgCommunityId", GenerateCodeFactory.getGeneratorId(GenerateCodeFactory.CODE_PREFIX_orgCommunityId));
        }
        businessOrgCommunity.put("bId", business.getbId());
        businessOrgCommunity.put("operate", StatusConstant.OPERATE_ADD);
        //保存隶属小区信息
        orgCommunityServiceDaoImpl.saveBusinessOrgCommunityInfo(businessOrgCommunity);
    }
    public IOrgCommunityServiceDao getOrgCommunityServiceDaoImpl() {
        return orgCommunityServiceDaoImpl;
    }
    public void setOrgCommunityServiceDaoImpl(IOrgCommunityServiceDao orgCommunityServiceDaoImpl) {
        this.orgCommunityServiceDaoImpl = orgCommunityServiceDaoImpl;
    }
}
UserService/src/main/java/com/java110/user/listener/orgCommunity/UpdateOrgCommunityInfoListener.java
New file
@@ -0,0 +1,190 @@
package com.java110.user.listener.orgCommunity;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.annotation.Java110Listener;
import com.java110.core.context.DataFlowContext;
import com.java110.entity.center.Business;
import com.java110.user.dao.IOrgCommunityServiceDao;
import com.java110.utils.constant.BusinessTypeConstant;
import com.java110.utils.constant.ResponseConstant;
import com.java110.utils.constant.StatusConstant;
import com.java110.utils.exception.ListenerExecuteException;
import com.java110.utils.util.Assert;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
 * 修改隶属小区信息 侦听
 * <p>
 * 处理节点
 * 1、businessOrgCommunity:{} 隶属小区基本信息节点
 * 2、businessOrgCommunityAttr:[{}] 隶属小区属性信息节点
 * 3、businessOrgCommunityPhoto:[{}] 隶属小区照片信息节点
 * 4、businessOrgCommunityCerdentials:[{}] 隶属小区证件信息节点
 * 协议地址 :https://github.com/java110/MicroCommunity/wiki/%E4%BF%AE%E6%94%B9%E5%95%86%E6%88%B7%E4%BF%A1%E6%81%AF-%E5%8D%8F%E8%AE%AE
 * Created by wuxw on 2018/5/18.
 */
@Java110Listener("updateOrgCommunityInfoListener")
@Transactional
public class UpdateOrgCommunityInfoListener extends AbstractOrgCommunityBusinessServiceDataFlowListener {
    private static Logger logger = LoggerFactory.getLogger(UpdateOrgCommunityInfoListener.class);
    @Autowired
    private IOrgCommunityServiceDao orgCommunityServiceDaoImpl;
    @Override
    public int getOrder() {
        return 2;
    }
    @Override
    public String getBusinessTypeCd() {
        return BusinessTypeConstant.BUSINESS_TYPE_UPDATE_ORG_COMMUNITY;
    }
    /**
     * business过程
     *
     * @param dataFlowContext 上下文对象
     * @param business        业务对象
     */
    @Override
    protected void doSaveBusiness(DataFlowContext dataFlowContext, Business business) {
        JSONObject data = business.getDatas();
        Assert.notEmpty(data, "没有datas 节点,或没有子节点需要处理");
        //处理 businessOrgCommunity 节点
        if (data.containsKey("businessOrgCommunity")) {
            //处理 businessOrgCommunity 节点
            if (data.containsKey("businessOrgCommunity")) {
                Object _obj = data.get("businessOrgCommunity");
                JSONArray businessOrgCommunitys = null;
                if (_obj instanceof JSONObject) {
                    businessOrgCommunitys = new JSONArray();
                    businessOrgCommunitys.add(_obj);
                } else {
                    businessOrgCommunitys = (JSONArray) _obj;
                }
                //JSONObject businessOrgCommunity = data.getJSONObject("businessOrgCommunity");
                for (int _orgCommunityIndex = 0; _orgCommunityIndex < businessOrgCommunitys.size(); _orgCommunityIndex++) {
                    JSONObject businessOrgCommunity = businessOrgCommunitys.getJSONObject(_orgCommunityIndex);
                    doBusinessOrgCommunity(business, businessOrgCommunity);
                    if (_obj instanceof JSONObject) {
                        dataFlowContext.addParamOut("orgCommunityId", businessOrgCommunity.getString("orgCommunityId"));
                    }
                }
            }
        }
    }
    /**
     * business to instance 过程
     *
     * @param dataFlowContext 数据对象
     * @param business        当前业务对象
     */
    @Override
    protected void doBusinessToInstance(DataFlowContext dataFlowContext, Business business) {
        JSONObject data = business.getDatas();
        Map info = new HashMap();
        info.put("bId", business.getbId());
        info.put("operate", StatusConstant.OPERATE_ADD);
        //隶属小区信息
        List<Map> businessOrgCommunityInfos = orgCommunityServiceDaoImpl.getBusinessOrgCommunityInfo(info);
        if (businessOrgCommunityInfos != null && businessOrgCommunityInfos.size() > 0) {
            for (int _orgCommunityIndex = 0; _orgCommunityIndex < businessOrgCommunityInfos.size(); _orgCommunityIndex++) {
                Map businessOrgCommunityInfo = businessOrgCommunityInfos.get(_orgCommunityIndex);
                flushBusinessOrgCommunityInfo(businessOrgCommunityInfo, StatusConstant.STATUS_CD_VALID);
                orgCommunityServiceDaoImpl.updateOrgCommunityInfoInstance(businessOrgCommunityInfo);
                if (businessOrgCommunityInfo.size() == 1) {
                    dataFlowContext.addParamOut("orgCommunityId", businessOrgCommunityInfo.get("org_community_id"));
                }
            }
        }
    }
    /**
     * 撤单
     *
     * @param dataFlowContext 数据对象
     * @param business        当前业务对象
     */
    @Override
    protected void doRecover(DataFlowContext dataFlowContext, Business business) {
        String bId = business.getbId();
        //Assert.hasLength(bId,"请求报文中没有包含 bId");
        Map info = new HashMap();
        info.put("bId", bId);
        info.put("statusCd", StatusConstant.STATUS_CD_VALID);
        Map delInfo = new HashMap();
        delInfo.put("bId", business.getbId());
        delInfo.put("operate", StatusConstant.OPERATE_DEL);
        //隶属小区信息
        List<Map> orgCommunityInfo = orgCommunityServiceDaoImpl.getOrgCommunityInfo(info);
        if (orgCommunityInfo != null && orgCommunityInfo.size() > 0) {
            //隶属小区信息
            List<Map> businessOrgCommunityInfos = orgCommunityServiceDaoImpl.getBusinessOrgCommunityInfo(delInfo);
            //除非程序出错了,这里不会为空
            if (businessOrgCommunityInfos == null || businessOrgCommunityInfos.size() == 0) {
                throw new ListenerExecuteException(ResponseConstant.RESULT_CODE_INNER_ERROR, "撤单失败(orgCommunity),程序内部异常,请检查! " + delInfo);
            }
            for (int _orgCommunityIndex = 0; _orgCommunityIndex < businessOrgCommunityInfos.size(); _orgCommunityIndex++) {
                Map businessOrgCommunityInfo = businessOrgCommunityInfos.get(_orgCommunityIndex);
                flushBusinessOrgCommunityInfo(businessOrgCommunityInfo, StatusConstant.STATUS_CD_VALID);
                orgCommunityServiceDaoImpl.updateOrgCommunityInfoInstance(businessOrgCommunityInfo);
            }
        }
    }
    /**
     * 处理 businessOrgCommunity 节点
     *
     * @param business             总的数据节点
     * @param businessOrgCommunity 隶属小区节点
     */
    private void doBusinessOrgCommunity(Business business, JSONObject businessOrgCommunity) {
        Assert.jsonObjectHaveKey(businessOrgCommunity, "orgCommunityId", "businessOrgCommunity 节点下没有包含 orgCommunityId 节点");
        if (businessOrgCommunity.getString("orgCommunityId").startsWith("-")) {
            throw new ListenerExecuteException(ResponseConstant.RESULT_PARAM_ERROR, "orgCommunityId 错误,不能自动生成(必须已经存在的orgCommunityId)" + businessOrgCommunity);
        }
        //自动保存DEL
        autoSaveDelBusinessOrgCommunity(business, businessOrgCommunity);
        businessOrgCommunity.put("bId", business.getbId());
        businessOrgCommunity.put("operate", StatusConstant.OPERATE_ADD);
        //保存隶属小区信息
        orgCommunityServiceDaoImpl.saveBusinessOrgCommunityInfo(businessOrgCommunity);
    }
    public IOrgCommunityServiceDao getOrgCommunityServiceDaoImpl() {
        return orgCommunityServiceDaoImpl;
    }
    public void setOrgCommunityServiceDaoImpl(IOrgCommunityServiceDao orgCommunityServiceDaoImpl) {
        this.orgCommunityServiceDaoImpl = orgCommunityServiceDaoImpl;
    }
}
UserService/src/main/java/com/java110/user/smo/impl/OrgCommunityInnerServiceSMOImpl.java
New file
@@ -0,0 +1,71 @@
package com.java110.user.smo.impl;
import com.java110.core.base.smo.BaseServiceSMO;
import com.java110.core.smo.org.IOrgCommunityInnerServiceSMO;
import com.java110.core.smo.user.IUserInnerServiceSMO;
import com.java110.dto.PageDto;
import com.java110.dto.org.OrgCommunityDto;
import com.java110.user.dao.IOrgCommunityServiceDao;
import com.java110.utils.util.BeanConvertUtil;
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 OrgCommunityInnerServiceSMOImpl extends BaseServiceSMO implements IOrgCommunityInnerServiceSMO {
    @Autowired
    private IOrgCommunityServiceDao orgCommunityServiceDaoImpl;
    @Autowired
    private IUserInnerServiceSMO userInnerServiceSMOImpl;
    @Override
    public List<OrgCommunityDto> queryOrgCommunitys(@RequestBody OrgCommunityDto orgCommunityDto) {
        //校验是否传了 分页信息
        int page = orgCommunityDto.getPage();
        if (page != PageDto.DEFAULT_PAGE) {
            orgCommunityDto.setPage((page - 1) * orgCommunityDto.getRow());
        }
        List<OrgCommunityDto> orgCommunitys = BeanConvertUtil.covertBeanList(orgCommunityServiceDaoImpl.getOrgCommunityInfo(BeanConvertUtil.beanCovertMap(orgCommunityDto)), OrgCommunityDto.class);
        return orgCommunitys;
    }
    @Override
    public int queryOrgCommunitysCount(@RequestBody OrgCommunityDto orgCommunityDto) {
        return orgCommunityServiceDaoImpl.queryOrgCommunitysCount(BeanConvertUtil.beanCovertMap(orgCommunityDto));
    }
    public IOrgCommunityServiceDao getOrgCommunityServiceDaoImpl() {
        return orgCommunityServiceDaoImpl;
    }
    public void setOrgCommunityServiceDaoImpl(IOrgCommunityServiceDao orgCommunityServiceDaoImpl) {
        this.orgCommunityServiceDaoImpl = orgCommunityServiceDaoImpl;
    }
    public IUserInnerServiceSMO getUserInnerServiceSMOImpl() {
        return userInnerServiceSMOImpl;
    }
    public void setUserInnerServiceSMOImpl(IUserInnerServiceSMO userInnerServiceSMOImpl) {
        this.userInnerServiceSMOImpl = userInnerServiceSMOImpl;
    }
}
WebService/src/main/java/com/java110/web/components/EditPrivilegeGroupComponent.java
New file
@@ -0,0 +1,48 @@
package com.java110.web.components;
import com.java110.core.context.IPageData;
import com.java110.web.smo.IPrivilegeServiceSMO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
/**
 * 添加权限组组件
 *
 * add by wuxw
 * 2019-04-08
 */
@Component("editPrivilegeGroup")
public class EditPrivilegeGroupComponent {
    @Autowired
    private IPrivilegeServiceSMO privilegeServiceSMOImpl;
    /**
     * 保存权限组信息
     * @param pd
     * @return
     */
    public ResponseEntity<String> editPrivilegeGroupInfo(IPageData pd){
        ResponseEntity<String> responseEntity = null;
        try{
            responseEntity =  privilegeServiceSMOImpl.editPrivilegeGroup(pd);
        }catch (Exception e){
            responseEntity = new ResponseEntity<String>(e.getMessage(), HttpStatus.INTERNAL_SERVER_ERROR);
        }finally {
            return responseEntity;
        }
    }
    public IPrivilegeServiceSMO getPrivilegeServiceSMOImpl() {
        return privilegeServiceSMOImpl;
    }
    public void setPrivilegeServiceSMOImpl(IPrivilegeServiceSMO privilegeServiceSMOImpl) {
        this.privilegeServiceSMOImpl = privilegeServiceSMOImpl;
    }
}
WebService/src/main/java/com/java110/web/components/org/AddOrgCommunityComponent.java
New file
@@ -0,0 +1,77 @@
package com.java110.web.components.org;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.context.IPageData;
import com.java110.core.context.PageData;
import com.java110.utils.constant.StateConstant;
import com.java110.web.smo.ICommunityServiceSMO;
import com.java110.web.smo.org.IAddOrgCommunitySMO;
import com.java110.web.smo.org.IAddOrgSMO;
import com.java110.web.smo.org.IListOrgCommunitysSMO;
import com.java110.web.smo.org.IListOrgNoCommunitysSMO;
import com.java110.web.smo.org.IListOrgsSMO;
import com.java110.web.smo.org.IListParentOrgsSMO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
/**
 * 添加组织管理组件
 */
@Component("addOrgCommunity")
public class AddOrgCommunityComponent {
    @Autowired
    private IAddOrgCommunitySMO addOrgCommunitySMOImpl;
    @Autowired
    private IListOrgNoCommunitysSMO listOrgNoCommunitysSMOImpl;
    @Autowired
    private IListParentOrgsSMO listParentOrgsSMOImpl;
    @Autowired
    private ICommunityServiceSMO communityServiceSMOImpl;
    /**
     * 添加组织管理数据
     *
     * @param pd 页面数据封装
     * @return ResponseEntity 对象
     */
    public ResponseEntity<String> save(IPageData pd) {
        return addOrgCommunitySMOImpl.saveOrgCommunity(pd);
    }
    /**
     * 查询组织管理列表
     *
     * @param pd 页面数据封装
     * @return 返回 ResponseEntity 对象
     */
    public ResponseEntity<String> list(IPageData pd) {
        return listOrgNoCommunitysSMOImpl.listOrgNoCommunitys(pd);
    }
    public ResponseEntity<String> getParentOrg(IPageData pd) {
        return listParentOrgsSMOImpl.listParentOrgs(pd);
    }
    public IListParentOrgsSMO getListParentOrgsSMOImpl() {
        return listParentOrgsSMOImpl;
    }
    public void setListParentOrgsSMOImpl(IListParentOrgsSMO listParentOrgsSMOImpl) {
        this.listParentOrgsSMOImpl = listParentOrgsSMOImpl;
    }
    public ICommunityServiceSMO getCommunityServiceSMOImpl() {
        return communityServiceSMOImpl;
    }
    public void setCommunityServiceSMOImpl(ICommunityServiceSMO communityServiceSMOImpl) {
        this.communityServiceSMOImpl = communityServiceSMOImpl;
    }
}
WebService/src/main/java/com/java110/web/components/org/DeleteOrgCommunityComponent.java
New file
@@ -0,0 +1,30 @@
package com.java110.web.components.org;
import com.java110.core.context.IPageData;
import com.java110.web.smo.org.IDeleteOrgCommunitySMO;
import com.java110.web.smo.org.IDeleteOrgSMO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
/**
 * 添加组织管理组件
 */
@Component("deleteOrgCommunity")
public class DeleteOrgCommunityComponent {
    @Autowired
    private IDeleteOrgCommunitySMO deleteOrgCommunitySMOImpl;
    /**
     * 添加组织管理数据
     *
     * @param pd 页面数据封装
     * @return ResponseEntity 对象
     */
    public ResponseEntity<String> delete(IPageData pd) {
        return deleteOrgCommunitySMOImpl.deleteOrgCommunity(pd);
    }
}
WebService/src/main/java/com/java110/web/components/org/OrgCommunityManageComponent.java
New file
@@ -0,0 +1,43 @@
package com.java110.web.components.org;
import com.java110.core.context.IPageData;
import com.java110.web.smo.org.IListOrgCommunitysSMO;
import com.java110.web.smo.org.IListOrgsSMO;
import com.java110.web.smo.org.IListParentOrgsSMO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
/**
 * 组织管理组件管理类
 *
 * add by wuxw
 *
 * 2019-06-29
 */
@Component("orgCommunityManage")
public class OrgCommunityManageComponent {
    @Autowired
    private IListOrgCommunitysSMO listOrgCommunitysSMOImpl;
    /**
     * 查询组织管理列表
     * @param pd 页面数据封装
     * @return 返回 ResponseEntity 对象
     */
    public ResponseEntity<String> list(IPageData pd){
        return listOrgCommunitysSMOImpl.listOrgCommunitys(pd);
    }
    public IListOrgCommunitysSMO getListOrgCommunitysSMOImpl() {
        return listOrgCommunitysSMOImpl;
    }
    public void setListOrgCommunitysSMOImpl(IListOrgCommunitysSMO listOrgCommunitysSMOImpl) {
        this.listOrgCommunitysSMOImpl = listOrgCommunitysSMOImpl;
    }
}
WebService/src/main/java/com/java110/web/smo/IPrivilegeServiceSMO.java
@@ -31,6 +31,13 @@
    public ResponseEntity<String> savePrivilegeGroup(IPageData pd);
    /**
     * 编辑权限组
     * @param pd
     * @return
     */
    public ResponseEntity<String> editPrivilegeGroup(IPageData pd);
    /**
     * 删除权限组
     * @param pd
     * @return
WebService/src/main/java/com/java110/web/smo/impl/PrivilegeServiceSMOImpl.java
@@ -22,6 +22,7 @@
    /**
     * 查询 权限组
     *
     * @param pd
     * @return
     */
@@ -61,6 +62,7 @@
    /**
     * 查询权限
     *
     * @param pd
     * @return
     */
@@ -90,6 +92,7 @@
    /**
     * 保存权限组
     *
     * @param pd
     * @return
     */
@@ -103,7 +106,6 @@
        Assert.jsonObjectHaveKey(privilegeInfoObj,"description","请求报文中未包含权限组描述 节点");
        Assert.hasLength(privilegeInfoObj.getString("name"),"请求报文中权限组名称不能为空");
        ResponseEntity<String> storeInfo = super.getStoreInfo(pd,restTemplate);
@@ -125,7 +127,45 @@
    }
    /**
     * 保存权限组
     *
     * @param pd
     * @return
     */
    @Override
    public ResponseEntity<String> editPrivilegeGroup(IPageData pd) {
        Assert.hasLength(pd.getUserId(), "用户未登录请先登录");
        JSONObject privilegeInfoObj = JSONObject.parseObject(pd.getReqData());
        Assert.jsonObjectHaveKey(privilegeInfoObj, "name", "请求报文中未包含权限组名称 节点");
        Assert.hasKeyAndValue(privilegeInfoObj, "pgId", "请求报文中未包含权限组ID 节点");
        Assert.jsonObjectHaveKey(privilegeInfoObj, "description", "请求报文中未包含权限组描述 节点");
        Assert.hasLength(privilegeInfoObj.getString("name"), "请求报文中权限组名称不能为空");
        ResponseEntity<String> storeInfo = super.getStoreInfo(pd, restTemplate);
        if (storeInfo.getStatusCode() != HttpStatus.OK) {
            return storeInfo;
        }
        // 商户返回信息
        JSONObject storeInfoObj = JSONObject.parseObject(storeInfo.getBody());
        String storeId = storeInfoObj.getString("storeId");
        String storeTypeCd = storeInfoObj.getString("storeTypeCd");
        privilegeInfoObj.put("storeId", storeId);
        privilegeInfoObj.put("storeTypeCd", storeTypeCd);
        ResponseEntity<String> privilegeGroup = super.callCenterService(restTemplate, pd, privilegeInfoObj.toJSONString(),
                ServiceConstant.SERVICE_API_URL + "/api/edit.privilegeGroup.info", HttpMethod.POST);
        return privilegeGroup;
    }
    /**
     * 删除权限组
     *
     * @param pd
     * @return
     */
@@ -174,16 +214,16 @@
        String  storeId = storeInfoObj.getString("storeId");
        String  storeTypeCd = storeInfoObj.getString("storeTypeCd");
        String pgId = privilegeInfoObj.getString("pgId");
        String pName = privilegeInfoObj.getString("pName");
        ResponseEntity<String> privileges = super.callCenterService(restTemplate,pd,"",
                ServiceConstant.SERVICE_API_URL+"/api/query.privilegeGroup.noAddPrivilege?storeId="+storeId+"&storeTypeCd="+storeTypeCd+"&pgId="+pgId , HttpMethod.GET);
                ServiceConstant.SERVICE_API_URL + "/api/query.privilegeGroup.noAddPrivilege?storeId=" + storeId + "&storeTypeCd=" + storeTypeCd + "&pgId=" + pgId + "&pName=" + pName, HttpMethod.GET);
        if(privileges.getStatusCode() != HttpStatus.OK){
            return privileges;
        }
        JSONObject resultObj = JSONObject.parseObject(privileges.getBody().toString());
        return new ResponseEntity<String>(resultObj.getJSONArray("privileges").toJSONString(),HttpStatus.OK);
@@ -196,7 +236,10 @@
        JSONObject privilegeInfoObj = JSONObject.parseObject(pd.getReqData());
        Assert.jsonObjectHaveKey(privilegeInfoObj,"pgId","请求报文中未包含权限组ID 节点");
        Assert.jsonObjectHaveKey(privilegeInfoObj,"pId","请求报文中未包含权限ID 节点");
        //Assert.jsonObjectHaveKey(privilegeInfoObj,"pId","请求报文中未包含权限ID 节点");
        if (!privilegeInfoObj.containsKey("pIds") || privilegeInfoObj.getJSONArray("pIds").size() < 1) {
            throw new IllegalArgumentException("请求报文中未包含权限");
        }
        ResponseEntity<String> storeInfo = super.getStoreInfo(pd,restTemplate);
@@ -216,6 +259,7 @@
    /**
     * 删除权限
     *
     * @param pd
     * @return
     */
@@ -245,7 +289,6 @@
    }
    /**
     *
     * @param pd
     * @return
     */
WebService/src/main/java/com/java110/web/smo/impl/StaffServiceSMOImpl.java
@@ -1,10 +1,12 @@
package com.java110.web.smo.impl;
import com.alibaba.fastjson.JSONObject;
import com.java110.entity.component.ComponentValidateResult;
import com.java110.utils.constant.ServiceConstant;
import com.java110.utils.util.Assert;
import com.java110.core.context.IPageData;
import com.java110.core.component.BaseComponentSMO;
import com.java110.utils.util.StringUtil;
import com.java110.web.smo.IStaffServiceSMO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@@ -37,12 +39,16 @@
        logger.debug("保存员工信息入参:{}", pd.toString());
        JSONObject reqJson = JSONObject.parseObject(pd.getReqData());
        Assert.hasKeyAndValue(reqJson, "username", "请求报文格式错误或未包含用户名信息");
        Assert.hasKeyAndValue(reqJson, "email", "请求报文格式错误或未包含邮箱信息");
        //Assert.hasKeyAndValue(reqJson, "email", "请求报文格式错误或未包含邮箱信息");
        Assert.hasKeyAndValue(reqJson, "tel", "请求报文格式错误或未包含手机信息");
        Assert.hasKeyAndValue(reqJson, "sex", "请求报文格式错误或未包含性别信息");
        Assert.hasKeyAndValue(reqJson, "address", "请求报文格式错误或未包含地址信息");
        Assert.hasKeyAndValue(reqJson, "orgId", "请求报文格式错误或未包含部门信息");
        Assert.hasKeyAndValue(reqJson, "relCd", "请求报文格式错误或未包含员工角色");
        if (reqJson.containsKey("email") && !StringUtil.isEmpty(reqJson.getString("email"))) {
            Assert.isEmail(reqJson, "email", "不是有效的邮箱格式");
        }
        ResponseEntity responseEntity = super.getStoreInfo(pd, restTemplate);
@@ -141,11 +147,12 @@
    public ResponseEntity<String> delete(IPageData pd) {
        ResponseEntity<String> responseEntity = null;
        Assert.jsonObjectHaveKey(pd.getReqData(), "userId", "请求报文格式错误或未包含用户ID信息");
        Assert.jsonObjectHaveKey(pd.getReqData(), "storeId", "请求报文格式错误或未包含商户ID信息");
        //Assert.jsonObjectHaveKey(pd.getReqData(), "storeId", "请求报文格式错误或未包含商户ID信息");
        ComponentValidateResult result = super.validateStoreStaffCommunityRelationship(pd, restTemplate);
        JSONObject paramIn = JSONObject.parseObject(pd.getReqData());
        JSONObject newParam = new JSONObject();
        newParam.put("userId", paramIn.getString("userId"));
        newParam.put("storeId", paramIn.getString("storeId"));
        newParam.put("storeId", result.getStoreId());
        //修改用户信息
        responseEntity = this.callCenterService(restTemplate, pd, newParam.toJSONString(),
                ServiceConstant.SERVICE_API_URL + "/api/user.staff.delete", HttpMethod.POST);
@@ -227,7 +234,7 @@
    public ResponseEntity<String> addStaffPrivilegeOrPrivilegeGroup(IPageData pd) {
        ResponseEntity<String> responseEntity = null;
        Assert.jsonObjectHaveKey(pd.getReqData(), "userId", "请求报文格式错误或未包含用户ID信息");
        Assert.jsonObjectHaveKey(pd.getReqData(), "pId", "请求报文格式错误或未包含权限ID信息");
        Assert.jsonObjectHaveKey(pd.getReqData(), "pIds", "请求报文格式错误或未包含权限ID信息");
        Assert.jsonObjectHaveKey(pd.getReqData(), "pFlag", "请求报文格式错误");
        JSONObject _paramObj = JSONObject.parseObject(pd.getReqData());
        responseEntity = super.getStoreInfo(pd, restTemplate);
@@ -283,10 +290,14 @@
    private void modifyStaffValidate(IPageData pd) {
        Assert.jsonObjectHaveKey(pd.getReqData(), "userId", "请求报文格式错误或未包含用户ID信息");
        Assert.jsonObjectHaveKey(pd.getReqData(), "username", "请求报文格式错误或未包含用户名信息");
        Assert.jsonObjectHaveKey(pd.getReqData(), "email", "请求报文格式错误或未包含邮箱信息");
        //Assert.jsonObjectHaveKey(pd.getReqData(), "email", "请求报文格式错误或未包含邮箱信息");
        Assert.jsonObjectHaveKey(pd.getReqData(), "tel", "请求报文格式错误或未包含手机信息");
        Assert.jsonObjectHaveKey(pd.getReqData(), "sex", "请求报文格式错误或未包含性别信息");
        Assert.jsonObjectHaveKey(pd.getReqData(), "address", "请求报文格式错误或未包含地址信息");
        JSONObject reqJson = JSONObject.parseObject(pd.getReqData());
        if (reqJson.containsKey("email") && !StringUtil.isEmpty(reqJson.getString("email"))) {
            Assert.isEmail(reqJson, "email", "不是有效的邮箱格式");
        }
    }
WebService/src/main/java/com/java110/web/smo/org/IAddOrgCommunitySMO.java
New file
@@ -0,0 +1,19 @@
package com.java110.web.smo.org;
import com.java110.core.context.IPageData;
import org.springframework.http.ResponseEntity;
/**
 * 添加组织管理接口
 *
 * add by wuxw 2019-06-30
 */
public interface IAddOrgCommunitySMO {
    /**
     * 添加组织管理
     * @param pd 页面数据封装
     * @return ResponseEntity 对象
     */
    ResponseEntity<String> saveOrgCommunity(IPageData pd);
}
WebService/src/main/java/com/java110/web/smo/org/IDeleteOrgCommunitySMO.java
New file
@@ -0,0 +1,19 @@
package com.java110.web.smo.org;
import com.java110.core.context.IPageData;
import org.springframework.http.ResponseEntity;
/**
 * 添加组织管理接口
 *
 * add by wuxw 2019-06-30
 */
public interface IDeleteOrgCommunitySMO {
    /**
     * 添加组织管理
     * @param pd 页面数据封装
     * @return ResponseEntity 对象
     */
    ResponseEntity<String> deleteOrgCommunity(IPageData pd);
}
WebService/src/main/java/com/java110/web/smo/org/IListOrgCommunitysSMO.java
New file
@@ -0,0 +1,22 @@
package com.java110.web.smo.org;
import com.java110.core.context.IPageData;
import com.java110.utils.exception.SMOException;
import org.springframework.http.ResponseEntity;
/**
 * 组织管理管理服务接口类
 * <p>
 * add by wuxw 2019-06-29
 */
public interface IListOrgCommunitysSMO {
    /**
     * 查询组织管理信息
     *
     * @param pd 页面数据封装
     * @return ResponseEntity 对象数据
     * @throws SMOException 业务代码层
     */
    ResponseEntity<String> listOrgCommunitys(IPageData pd) throws SMOException;
}
WebService/src/main/java/com/java110/web/smo/org/IListOrgNoCommunitysSMO.java
New file
@@ -0,0 +1,22 @@
package com.java110.web.smo.org;
import com.java110.core.context.IPageData;
import com.java110.utils.exception.SMOException;
import org.springframework.http.ResponseEntity;
/**
 * 组织管理管理服务接口类
 * <p>
 * add by wuxw 2019-06-29
 */
public interface IListOrgNoCommunitysSMO {
    /**
     * 查询组织管理信息
     *
     * @param pd 页面数据封装
     * @return ResponseEntity 对象数据
     * @throws SMOException 业务代码层
     */
    ResponseEntity<String> listOrgNoCommunitys(IPageData pd) throws SMOException;
}
WebService/src/main/java/com/java110/web/smo/org/impl/AddOrgCommunitySMOImpl.java
New file
@@ -0,0 +1,72 @@
package com.java110.web.smo.org.impl;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.component.AbstractComponentSMO;
import com.java110.core.context.IPageData;
import com.java110.entity.component.ComponentValidateResult;
import com.java110.utils.constant.PrivilegeCodeConstant;
import com.java110.utils.constant.ServiceConstant;
import com.java110.utils.util.Assert;
import com.java110.web.smo.org.IAddOrgCommunitySMO;
import com.java110.web.smo.org.IAddOrgSMO;
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("addOrgCommunitySMOImpl")
public class AddOrgCommunitySMOImpl extends AbstractComponentSMO implements IAddOrgCommunitySMO {
    @Autowired
    private RestTemplate restTemplate;
    @Override
    protected void validate(IPageData pd, JSONObject paramIn) {
        //super.validatePageInfo(pd);
        //Assert.hasKeyAndValue(paramIn, "xxx", "xxx");
        Assert.hasKeyAndValue(paramIn, "orgId", "必填,请填写组织ID");
        Assert.hasKeyAndValue(paramIn, "orgName", "必填,请填写组织名称");
        if (!paramIn.containsKey("communitys") || paramIn.getJSONArray("communitys").size() < 1) {
            throw new IllegalArgumentException("未包含小区信息");
        }
        //Assert.hasKeyAndValue(paramIn, "description", "必填,请填写描述");
        //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.LIST_ORG);
    }
    @Override
    protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) {
        ResponseEntity<String> responseEntity = null;
        ComponentValidateResult result = super.validateStoreStaffCommunityRelationship(pd, restTemplate);
        paramIn.put("storeId", result.getStoreId());
        responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(),
                ServiceConstant.SERVICE_API_URL + "/api/org.saveOrgCommunity",
                HttpMethod.POST);
        return responseEntity;
    }
    @Override
    public ResponseEntity<String> saveOrgCommunity(IPageData pd) {
        return super.businessProcess(pd);
    }
    public RestTemplate getRestTemplate() {
        return restTemplate;
    }
    public void setRestTemplate(RestTemplate restTemplate) {
        this.restTemplate = restTemplate;
    }
}
WebService/src/main/java/com/java110/web/smo/org/impl/AddOrgSMOImpl.java
@@ -34,7 +34,6 @@
        Assert.hasKeyAndValue(paramIn, "orgName", "必填,请填写组织名称");
        Assert.hasKeyAndValue(paramIn, "orgLevel", "必填,请填写报修人名称");
        Assert.hasKeyAndValue(paramIn, "parentOrgId", "必填,请选择上级ID");
        Assert.hasKeyAndValue(paramIn, "belongCommunityId", "必填,请选择隶属小区");
        //Assert.hasKeyAndValue(paramIn, "description", "必填,请填写描述");
WebService/src/main/java/com/java110/web/smo/org/impl/DeleteOrgCommunitySMOImpl.java
New file
@@ -0,0 +1,66 @@
package com.java110.web.smo.org.impl;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.component.AbstractComponentSMO;
import com.java110.core.context.IPageData;
import com.java110.entity.component.ComponentValidateResult;
import com.java110.utils.constant.PrivilegeCodeConstant;
import com.java110.utils.constant.ServiceConstant;
import com.java110.utils.util.Assert;
import com.java110.web.smo.org.IDeleteOrgCommunitySMO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpMethod;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.client.RestTemplate;
/**
 * 添加小区服务实现类
 * delete by wuxw 2019-06-30
 */
@Service("deleteOrgCommunitySMOImpl")
public class DeleteOrgCommunitySMOImpl extends AbstractComponentSMO implements IDeleteOrgCommunitySMO {
    @Autowired
    private RestTemplate restTemplate;
    @Override
    protected void validate(IPageData pd, JSONObject paramIn) {
        //super.validatePageInfo(pd);
        //Assert.hasKeyAndValue(paramIn, "xxx", "xxx");
        Assert.hasKeyAndValue(paramIn, "orgCommunityId", "组织ID不能为空");
        super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.LIST_ORG);
    }
    @Override
    protected ResponseEntity<String> doBusinessProcess(IPageData pd, JSONObject paramIn) {
        ResponseEntity<String> responseEntity = null;
        //super.validateStoreStaffCommunityRelationship(pd, restTemplate);
        ComponentValidateResult result = super.validateStoreStaffCommunityRelationship(pd, restTemplate);
        paramIn.put("storeId", result.getStoreId());
        responseEntity = this.callCenterService(restTemplate, pd, paramIn.toJSONString(),
                ServiceConstant.SERVICE_API_URL + "/api/org.deleteOrgCommunity",
                HttpMethod.POST);
        return responseEntity;
    }
    @Override
    public ResponseEntity<String> deleteOrgCommunity(IPageData pd) {
        return super.businessProcess(pd);
    }
    public RestTemplate getRestTemplate() {
        return restTemplate;
    }
    public void setRestTemplate(RestTemplate restTemplate) {
        this.restTemplate = restTemplate;
    }
}
WebService/src/main/java/com/java110/web/smo/org/impl/EditOrgSMOImpl.java
@@ -33,8 +33,6 @@
        Assert.hasKeyAndValue(paramIn, "orgName", "必填,请填写组织名称");
        Assert.hasKeyAndValue(paramIn, "orgLevel", "必填,请填写报修人名称");
        Assert.hasKeyAndValue(paramIn, "parentOrgId", "必填,请选择上级ID");
        Assert.hasKeyAndValue(paramIn, "belongCommunityId", "必填,请选择隶属小区");
        //Assert.hasKeyAndValue(paramIn, "description", "必填,请填写描述");
WebService/src/main/java/com/java110/web/smo/org/impl/ListOrgCommunitysSMOImpl.java
New file
@@ -0,0 +1,69 @@
package com.java110.web.smo.org.impl;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.component.AbstractComponentSMO;
import com.java110.core.context.IPageData;
import com.java110.entity.component.ComponentValidateResult;
import com.java110.utils.constant.PrivilegeCodeConstant;
import com.java110.utils.constant.ServiceConstant;
import com.java110.utils.exception.SMOException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.web.smo.org.IListOrgCommunitysSMO;
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;
/**
 * 查询org服务类
 */
@Service("listOrgCommunitysSMOImpl")
public class ListOrgCommunitysSMOImpl extends AbstractComponentSMO implements IListOrgCommunitysSMO {
    @Autowired
    private RestTemplate restTemplate;
    @Override
    public ResponseEntity<String> listOrgCommunitys(IPageData pd) throws SMOException {
        return businessProcess(pd);
    }
    @Override
    protected void validate(IPageData pd, JSONObject paramIn) {
        super.validatePageInfo(pd);
        Assert.hasKeyAndValue(paramIn,"orgId","请求报文中未包含组织信息");
        //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.LIST_ORG);
    }
    @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/org.listOrgCommunitys" + 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;
    }
}
WebService/src/main/java/com/java110/web/smo/org/impl/ListOrgNoCommunitysSMOImpl.java
New file
@@ -0,0 +1,69 @@
package com.java110.web.smo.org.impl;
import com.alibaba.fastjson.JSONObject;
import com.java110.core.component.AbstractComponentSMO;
import com.java110.core.context.IPageData;
import com.java110.entity.component.ComponentValidateResult;
import com.java110.utils.constant.ServiceConstant;
import com.java110.utils.exception.SMOException;
import com.java110.utils.util.Assert;
import com.java110.utils.util.BeanConvertUtil;
import com.java110.web.smo.org.IListOrgCommunitysSMO;
import com.java110.web.smo.org.IListOrgNoCommunitysSMO;
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;
/**
 * 查询org服务类
 */
@Service("listOrgNoCommunitysSMOImpl")
public class ListOrgNoCommunitysSMOImpl extends AbstractComponentSMO implements IListOrgNoCommunitysSMO {
    @Autowired
    private RestTemplate restTemplate;
    @Override
    public ResponseEntity<String> listOrgNoCommunitys(IPageData pd) throws SMOException {
        return businessProcess(pd);
    }
    @Override
    protected void validate(IPageData pd, JSONObject paramIn) {
        super.validatePageInfo(pd);
        Assert.hasKeyAndValue(paramIn,"orgId","请求报文中未包含组织信息");
        //super.checkUserHasPrivilege(pd, restTemplate, PrivilegeCodeConstant.LIST_ORG);
    }
    @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/org.listOrgNoCommunitys" + 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;
    }
}
WebService/src/main/resources/components/demoPackage/map/map.html
WebService/src/main/resources/components/demoPackage/map/map.js
WebService/src/main/resources/components/orgPackage/add-org/addOrg.html
@@ -32,7 +32,7 @@
                                        <option v-for="parentOrg in addOrgInfo.parentOrg" :value="parentOrg.orgId">{{parentOrg.orgName}}</option>
                                    </select></div>
                            </div>
                            <div class="form-group row">
                            <!--<div class="form-group row">
                                <label class="col-sm-2 col-form-label">隶属小区</label>
                                <div class="col-sm-10">
                                    <select class="custom-select" v-model="addOrgInfo.belongCommunityId" v-bind:disabled="addOrgInfo.orgLevel == 3">
@@ -42,7 +42,7 @@
                                            {{belongCommunity.name}}
                                        </option>
                                    </select></div>
                            </div>
                            </div>-->
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">描述</label>
                                <div class="col-sm-10">
WebService/src/main/resources/components/orgPackage/add-org/addOrg.js
@@ -89,18 +89,6 @@
                            errInfo: "上级ID不正确"
                        },
                    ],
                    'addOrgInfo.belongCommunityId': [
                        {
                            limit: "required",
                            param: "",
                            errInfo: "隶属小区不能为空"
                        },
                        {
                            limit: "num",
                            param: "",
                            errInfo: "隶属小区不正确"
                        },
                    ],
                    'addOrgInfo.description': [
                        {
WebService/src/main/resources/components/orgPackage/addOrgCommunity/addOrgCommunity.html
New file
@@ -0,0 +1,75 @@
<div id="addOrgCommunityModel" class="modal fade" tabindex="-1" role="dialog"
     aria-labelledby="addOrgCommunityModelLabel"
     aria-hidden="true">
    <div class="modal-dialog modal-lg">
        <div class="modal-content">
            <div class="modal-header">
                <h3 class="modal-title" id="addOrgCommunityModelLabel">添加隶属小区</h3>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <div class=" row">
                    <div class="col-lg-12">
                        <div class="ibox ">
                            <div class="row">
                                <div class="col-sm-7 m-b-xs">
                                </div>
                                <div class="col-sm-5">
                                    <div class="input-group">
                                        <input placeholder="输入小区名称" type="text"
                                               v-model="addOrgCommunityInfo.communityName"
                                               class="form-control form-control-sm">
                                        <span class="input-group-append">
                                                <button type="button" class="btn btn-sm btn-primary"
                                                        v-on:click="queryCommunitys()">查询</button>
                                            </span>
                                    </div>
                                </div>
                            </div>
                            <div class="table-responsive" style="margin-top:15px">
                                <table class="table table-striped">
                                    <thead>
                                    <tr>
                                        <th class="text-center">
                                            <input type="checkbox"  class="i-checks " @click="checkAll($event)" id="quan">
                                        </th>
                                        <th class="text-center">小区ID</th>
                                        <th class="text-center">小区名称</th>
                                        <th class="text-center">小区地址</th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr v-for="community in addOrgCommunityInfo.communitys">
                                        <td class="text-center">
                                            <input type="checkbox" class="i-checks checkItem" v-bind:value="community.communityId" v-model="addOrgCommunityInfo.selectCommunitys" >
                                        </td>
                                        <td class="text-center">{{community.communityId}}</td>
                                        <td class="text-center">{{community.name}}</td>
                                        <td class="text-center">{{community.address}}</td>
                                    </tr>
                                    </tbody>
                                </table>
                                <!-- 分页 -->
                                <vc:create namespace="addOrgCommunity" name="paginationPlus"></vc:create>
                                <div class="ibox-content" v-if="addOrgCommunityInfo.communitys.length > 0">
                                    <button class="btn btn-primary float-right" type="button" v-on:click="addOrgCommunity()"><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>
</div>
WebService/src/main/resources/components/orgPackage/addOrgCommunity/addOrgCommunity.js
New file
@@ -0,0 +1,139 @@
(function(vc){
    vc.extends({
        propTypes: {
           emitListener:vc.propTypes.string,
           emitFunction:vc.propTypes.string
        },
        data:{
            addOrgCommunityInfo:{
                communitys:[],
                communityName:'',
                orgId:'',
                orgName:'',
                selectCommunitys:[]
            }
        },
        watch: { // 监视双向绑定的数据数组
            checkData: {
                handler(){ // 数据数组有变化将触发此函数
                    if(vc.component.addOrgCommunityInfo.selectCommunitys.length == vc.component.addOrgCommunityInfo.communitys.length){
                        document.querySelector('#quan').checked = true;
                    }else {
                        document.querySelector('#quan').checked = false;
                    }
                },
                deep: true // 深度监视
            }
        },
        _initMethod:function(){
        },
        _initEvent:function(){
            vc.on('addOrgCommunity','openAddOrgCommunityModal',function(_param){
                vc.component._refreshChooseOrgInfo();
                $('#addOrgCommunityModel').modal('show');
                vc.copyObject(_param,vc.component.addOrgCommunityInfo);
                vc.component._loadAllCommunityInfo(1,10,'');
            });
            vc.on('addOrgCommunity','paginationPlus', 'page_event', function (_currentPage) {
                vc.component._listOrgCommunitys(_currentPage, DEFAULT_ROWS);
            });
        },
        methods:{
            _loadAllCommunityInfo:function(_page,_row,_name){
                var param = {
                    params:{
                        page:_page,
                        row:_row,
                        name:_name,
                        orgId:vc.component.addOrgCommunityInfo.orgId
                    }
                };
                //发送get请求
               vc.http.get('addOrgCommunity',
                            'list',
                             param,
                             function(json){
                                var _communityInfo = JSON.parse(json);
                                vc.component.addOrgCommunityInfo.communitys = _communityInfo.communitys;
                                vc.emit('addOrgCommunity','paginationPlus', 'init', {
                                    total: _communityInfo.records,
                                    currentPage: _page
                                });
                             },function(){
                                console.log('请求失败处理');
                             }
                           );
            },
            addOrgCommunity:function(_org){
                var _selectCommunitys = vc.component.addOrgCommunityInfo.selectCommunitys;
                var _tmpCommunitys = vc.component.addOrgCommunityInfo.communitys;
                if(_selectCommunitys.length <1){
                    vc.toast("请选择隶属小区");
                    return ;
                }
                var _communitys = [];
                for(var _selectIndex = 0 ;_selectIndex <_selectCommunitys.length ;_selectIndex ++){
                    for(var _communityIndex =0; _communityIndex < _tmpCommunitys.length;_communityIndex++){
                        if(_selectCommunitys[_selectIndex] == _tmpCommunitys[_communityIndex].communityId){
                            _communitys.push({
                                communityId:_tmpCommunitys[_communityIndex].communityId,
                                communityName:_tmpCommunitys[_communityIndex].name
                            });
                        }
                    }
                }
                var _objData = {
                    orgId:vc.component.addOrgCommunityInfo.orgId,
                    orgName:vc.component.addOrgCommunityInfo.orgName,
                    communitys:_communitys
                }
                vc.http.post('addOrgCommunity',
                    'save',
                    JSON.stringify(_objData),
                    {
                        emulateJSON: true
                    },
                 function(json,res){
                    $('#addOrgCommunityModel').modal('hide');
                    if(res.status == 200){
                        vc.emit($props.emitListener,$props.emitFunction,{
                        });
                        return ;
                    }
                    vc.toast(json);
                 },function(){
                    console.log('请求失败处理');
                 }
               );
                $('#addOrgCommunityModel').modal('hide');
            },
            queryCommunitys:function(){
                vc.component._loadAllCommunityInfo(1,10,vc.component.addOrgCommunityInfo.communityName);
            },
            _refreshChooseOrgInfo:function(){
                vc.component.addOrgCommunityInfo={
                    communitys:[],
                    communityName:'',
                    orgId:'',
                    orgName:'',
                    selectCommunitys:[]
                };
            },
            checkAll:function(e){
                    var checkObj = document.querySelectorAll('.checkItem'); // 获取所有checkbox项
                    if(e.target.checked){ // 判定全选checkbox的勾选状态
                        for(var i=0;i<checkObj.length;i++){
                            if(!checkObj[i].checked){ // 将未勾选的checkbox选项push到绑定数组中
                                vc.component.addOrgCommunityInfo.selectCommunitys.push(checkObj[i].value);
                            }
                        }
                    }else { // 如果是去掉全选则清空checkbox选项绑定数组
                        vc.component.addOrgCommunityInfo.selectCommunitys = [];
                    }
            }
        }
    });
})(window.vc);
WebService/src/main/resources/components/orgPackage/deleteOrgCommunity/deleteOrgCommunity.html
New file
@@ -0,0 +1,19 @@
<div class="modal fade" id="deleteOrgCommunityModel" 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="closeDeleteOrgCommunityModel()">点错了</button>
                <button type="button" class="btn btn-primary" v-on:click="deleteOrgCommunity()">确认删除</button>
            </div>
        </div>
    </div>
</div>
WebService/src/main/resources/components/orgPackage/deleteOrgCommunity/deleteOrgCommunity.js
New file
@@ -0,0 +1,52 @@
(function(vc,vm){
    vc.extends({
        data:{
            deleteOrgCommunityInfo:{
            }
        },
         _initMethod:function(){
         },
         _initEvent:function(){
             vc.on('deleteOrgCommunity','openDeleteOrgCommunityModal',function(_params){
                vc.component.deleteOrgCommunityInfo = _params;
                $('#deleteOrgCommunityModel').modal('show');
            });
        },
        methods:{
            deleteOrgCommunity:function(){
                vc.component.deleteOrgCommunityInfo.communityId=vc.getCurrentCommunity().communityId;
                vc.http.post(
                    'deleteOrgCommunity',
                    'delete',
                    JSON.stringify(vc.component.deleteOrgCommunityInfo),
                    {
                        emulateJSON:true
                     },
                     function(json,res){
                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
                        if(res.status == 200){
                            //关闭model
                            $('#deleteOrgCommunityModel').modal('hide');
                            vc.emit('orgCommunityManageInfo','listOrgCommunity',{});
                            return ;
                        }
                        vc.message(json);
                     },
                     function(errInfo,error){
                        console.log('请求失败处理');
                        vc.message(json);
                     });
            },
            closeDeleteOrgCommunityModel:function(){
                $('#deleteOrgCommunityModel').modal('hide');
            }
        }
    });
})(window.vc,window.vc.component);
WebService/src/main/resources/components/orgPackage/edit-org/editOrg.html
@@ -31,7 +31,7 @@
                                        <option v-for="parentOrg in editOrgInfo.parentOrg" :value="parentOrg.orgId">{{parentOrg.orgName}}</option>
                                    </select></div>
                            </div>
                            <div class="form-group row">
                           <!-- <div class="form-group row">
                                <label class="col-sm-2 col-form-label">隶属小区</label>
                                <div class="col-sm-10">
                                    <select class="custom-select" v-model="editOrgInfo.belongCommunityId" v-bind:disabled="editOrgInfo.orgLevel == 3">
@@ -41,7 +41,7 @@
                                            {{belongCommunity.name}}
                                        </option>
                                    </select></div>
                            </div>
                            </div>-->
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">描述</label>
                                <div class="col-sm-10">
WebService/src/main/resources/components/orgPackage/org-manage/orgManage.html
@@ -1,5 +1,5 @@
<div id="component" class="wrapper wrapper-content animated fadeInRight ecommerce">
    <div class="row">
    <div class="row" v-show="orgManageInfo.showBelongCommunity == false">
        <div class="col-lg-3">
            <div id="orgTree" class="" style="background: #fff;"></div>
        </div>
@@ -73,8 +73,7 @@
                                    <th class="text-center">组织名称</th>
                                    <th class="text-center">组织级别</th>
                                    <th class="text-center">上级组织</th>
                                    <th class="text-center">隶属小区</th>
                                    <th class="text-center">操作</th>
                                    <th class="text-right">操作</th>
                                </tr>
                                </thead>
                                <tbody>
@@ -83,8 +82,10 @@
                                    <td class="text-center">{{org.orgName}}</td>
                                    <td class="text-center">{{org.orgLevelName}}</td>
                                    <td class="text-center">{{org.orgLevel == 1 ? '无' : org.parentOrgName}}</td>
                                    <td class="text-center">{{org.belongCommunityName}}</td>
                                    <td class="text-center">
                                    <td class="text-right">
                                        <div v-if="org.allowOperation == 'F' && org.belongCommunityId == '9999'">
                                            隶属所有小区
                                        </div>
                                        <div class="btn-group" v-if="org.allowOperation == 'T'">
                                            <button class="btn-white btn btn-xs" v-on:click="_openEditOrgModel(org)">
                                                修改
@@ -93,6 +94,11 @@
                                        <div class="btn-group" v-if="org.allowOperation == 'T'">
                                            <button class="btn-white btn btn-xs" v-on:click="_openDeleteOrgModel(org)">
                                                删除
                                            </button>
                                        </div>
                                        <div class="btn-group" v-if="org.orgLevel == 2 && org.allowOperation == 'T'">
                                            <button class="btn-white btn btn-xs" v-on:click="_openBeyondCommunity(org)">
                                                隶属小区
                                            </button>
                                        </div>
                                    </td>
@@ -116,6 +122,10 @@
        </div>
    </div>
    <div  v-if="orgManageInfo.showBelongCommunity == true">
        <vc:create name="orgCommunityManage"></vc:create>
    </div>
    <vc:create name="addOrg"
               callBackListener=""
               callBackFunction=""
@@ -123,4 +133,5 @@
    <vc:create name="editOrg"></vc:create>
    <vc:create name="deleteOrg"></vc:create>
</div>
WebService/src/main/resources/components/orgPackage/org-manage/orgManage.js
@@ -11,7 +11,9 @@
                orgs: [],
                total: 0,
                records: 1,
                currentSelectOrgId:"-1",
                moreCondition: false,
                showBelongCommunity:false,
                orgName: '',
                headOrg: [],
                branchOrg: [],
@@ -75,6 +77,9 @@
            vc.on('pagination', 'page_event', function (_currentPage) {
                vc.component._listOrgs(_currentPage, DEFAULT_ROWS);
            });
            vc.on('orgManage','onBack',function(_param){
                 vc.component.orgManageInfo.showBelongCommunity = false;
            })
        },
        methods: {
@@ -84,14 +89,17 @@
                    selectedBackColor: '#1ab394'
                });
                $('#orgTree').on('nodeSelected', function (event, data) {
                    //console.log(event,data);
                    console.log(event,data);
                    vc.component.orgManageInfo.currentSelectOrgId = data.orgId;
                    vc.component.orgManageInfo.conditions.orgLevel = (parseInt(data.orgLevel) + 1);
                    vc.component.orgManageInfo.conditions.parentOrgId = data.orgId;
                    vc.component.orgManageInfo.currentBelongCommunityId = data.belongCommunityId;
                    vc.component._listOrgs(DEFAULT_PAGE, DEFAULT_ROWS);
                });
                $('#orgTree').treeview("selectNode", [0]);
//                if(vc.component.orgManageInfo.currentSelectOrgId == '-1'){
//                    console.log('是否进入');
//                    $('#orgTree').treeview("selectNode", [0]);
//                }
            },
            _loadBranchOrgTrees: function () {
                //默认查询分公司组织信息
@@ -118,12 +126,27 @@
                    function (json, res) {
                        var _tmpOrgs = JSON.parse(json).orgs;
                        _tmpOrgs.forEach(function (_item) {
                            var _selected = false;
                            var _currentSelectOrgId = vc.component.orgManageInfo.currentSelectOrgId;
                            if(_currentSelectOrgId == '-1' && _orgLevel == 1){
                                _selected = true;
                                vc.component.orgManageInfo.currentSelectOrgId = _item.orgId;
                                vc.component.orgManageInfo.conditions.orgLevel = (parseInt(_item.orgLevel) + 1);
                                vc.component.orgManageInfo.conditions.parentOrgId = _item.orgId;
                                vc.component.orgManageInfo.currentBelongCommunityId = _item.belongCommunityId;
                                vc.component._listOrgs(DEFAULT_PAGE, DEFAULT_ROWS);
                            }else if(_item.orgId == vc.component.orgManageInfo.currentSelectOrgId){
                                _selected = true;
                            }
                            _nodes.push({
                                orgId: _item.orgId,
                                orgLevel: _orgLevel,
                                text: _item.orgLevelName + '|' + _item.orgName,
                                belongCommunityId:_item.belongCommunityId,
                                href: function (_item) {
                                },
                                state:{
                                    selected:_selected
                                },
                                tags: [0],
                                nodes: []
@@ -174,6 +197,10 @@
            _openDeleteOrgModel: function (_org) {
                vc.emit('deleteOrg', 'openDeleteOrgModal', _org);
            },
            _openBeyondCommunity:function(_org){
                vc.component.orgManageInfo.showBelongCommunity = true;
                vc.emit('orgCommunityManageInfo', 'openOrgCommunity',_org);
            },
            _queryOrgMethod: function () {
                vc.component._listOrgs(DEFAULT_PAGE, DEFAULT_ROWS);
WebService/src/main/resources/components/orgPackage/orgCommunityManage/orgCommunityManage.html
New file
@@ -0,0 +1,67 @@
<div class="row">
    <div class="col-lg-12">
        <div class="ibox">
            <div class="ibox-title">
                <h5>{{orgCommunityManageInfo.orgName}}隶属小区</h5>
                <div class="ibox-tools" style="top:10px;">
                    <button type="button" class="btn btn-primary btn-sm" v-on:click="_goBack()">
                        <i class="glyphicon glyphicon-plus"></i>
                        返回
                    </button>
                    <button type="button" class="btn btn-primary btn-sm" v-on:click="_openAddOrgCommunityModal()">
                        <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 class="text-center">组织ID</th>
                        <th class="text-center">组织名称</th>
                        <th class="text-center">小区ID</th>
                        <th class="text-center">小区名称</th>
                        <th class="text-right">操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <tr v-for="orgCommunity in orgCommunityManageInfo.orgCommunitys">
                        <td class="text-center">{{orgCommunity.orgId}}</td>
                        <td class="text-center">{{orgCommunity.orgName}}</td>
                        <td class="text-center">{{orgCommunity.communityId}}</td>
                        <td class="text-center">{{orgCommunity.communityName}}</td>
                        <td class="text-right">
                            <div class="btn-group">
                                <button class="btn-white btn btn-xs"
                                        v-on:click="_openDeleteOrgCommunityModel(orgCommunity)">
                                    删除
                                </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>
    <vc:create name="addOrgCommunity"
               emitListener="orgCommunityManageInfo"
               emitFunction="listOrgCommunity"
    ></vc:create>
    <vc:create name="deleteOrgCommunity"></vc:create>
</div>
WebService/src/main/resources/components/orgPackage/orgCommunityManage/orgCommunityManage.js
New file
@@ -0,0 +1,100 @@
/**
 入驻小区
 **/
(function (vc) {
    var DEFAULT_PAGE = 1;
    var DEFAULT_ROWS = 10;
    var ALL_ROWS = 100;
    vc.extends({
        data: {
            orgCommunityManageInfo: {
                orgCommunitys: [],
                total: 0,
                records: 1,
                moreCondition: false,
                orgId:'',
                orgName:''
            }
        },
        _initMethod: function () {
        },
        _initEvent: function () {
            vc.on('orgCommunityManageInfo', 'openOrgCommunity', function (_param) {
                vc.copyObject(_param, vc.component.orgCommunityManageInfo);
                vc.component._listOrgCommunitys(DEFAULT_PAGE, DEFAULT_ROWS);
            });
            vc.on('orgCommunityManageInfo', 'listOrgCommunity', function (_param) {
                //vc.copyObject(_param, vc.component.orgCommunityManageInfo.conditions);
                vc.component._listOrgCommunitys(DEFAULT_PAGE, DEFAULT_ROWS);
            });
            vc.on('pagination', 'page_event', function (_currentPage) {
                vc.component._listOrgCommunitys(_currentPage, DEFAULT_ROWS);
            });
        },
        methods: {
            _listOrgCommunitys: function (_page, _rows) {
                var param = {
                    params: {
                        page:_page,
                        row:_rows,
                        orgId:vc.component.orgCommunityManageInfo.orgId
                    }
                };
                //发送get请求
                vc.http.get('orgCommunityManage',
                    'list',
                    param,
                    function (json, res) {
                        var _orgCommunityManageInfo = JSON.parse(json);
                        vc.component.orgCommunityManageInfo.total = _orgCommunityManageInfo.total;
                        vc.component.orgCommunityManageInfo.records = _orgCommunityManageInfo.records;
                        vc.component.orgCommunityManageInfo.orgCommunitys = _orgCommunityManageInfo.orgCommunitys;
                        vc.emit('pagination', 'init', {
                            total: vc.component.orgCommunityManageInfo.records,
                            currentPage: _page
                        });
                    }, function (errInfo, error) {
                        console.log('请求失败处理');
                    }
                );
            },
            _openAddOrgCommunityModal: function () {
                vc.emit('addOrgCommunity', 'openAddOrgCommunityModal', {
                    orgId: vc.component.orgCommunityManageInfo.orgId,
                    orgName: vc.component.orgCommunityManageInfo.orgName
                });
            },
            _openEditOrgCommunityModel: function (_orgCommunity) {
                vc.emit('editOrgCommunity', 'openEditOrgCommunityModal', _orgCommunity);
            },
            _openDeleteOrgCommunityModel: function (_orgCommunity) {
                vc.emit('deleteOrgCommunity', 'openDeleteOrgCommunityModal', _orgCommunity);
            },
            _openBeyondCommunity:function(_orgCommunity){
            },
            _queryOrgCommunityMethod: function () {
                vc.component._listOrgCommunitys(DEFAULT_PAGE, DEFAULT_ROWS);
            },
            _moreCondition: function () {
                if (vc.component.orgCommunityManageInfo.moreCondition) {
                    vc.component.orgCommunityManageInfo.moreCondition = false;
                } else {
                    vc.component.orgCommunityManageInfo.moreCondition = true;
                }
            },
            _goBack:function(){
                vc.emit('orgManage','onBack',{});
            }
        }
    });
})(window.vc);
WebService/src/main/resources/components/paginationPackage/pagination/pagination.html
WebService/src/main/resources/components/paginationPackage/pagination/pagination.js
WebService/src/main/resources/components/paginationPackage/paginationPlus/paginationPlus.html
New file
@@ -0,0 +1,20 @@
<nav aria-label="Page navigation example" v-if="this.paginationPlusInfo.total != 0">
    <ul class="pagination justify-content-end">
        <li class="page-item" v-bind:class="{disabled:this.paginationPlusInfo.currentPage == 1}">
            <a class="page-link" v-on:click="current(1)"> « </a>
        </li>
        <li class="page-item" v-bind:class="{disabled:this.paginationPlusInfo.currentPage == 1}">
            <a class="page-link" v-on:click="previous()"> ‹ </a>
        </li>
        <li class="page-item" v-for="pageInfo in this.paginationPlusInfo.pageList" v-bind:class="{active:pageInfo.currentPage}">
            <a class="page-link" v-on:click="current(pageInfo.page)">{{pageInfo.pageView}}</a>
        </li>
        <li class="page-item" v-bind:class="{disabled:this.paginationPlusInfo.currentPage == this.paginationPlusInfo.total}">
            <a class="page-link" v-on:click="next()"> › </a>
        </li>
        <li class="page-item" v-bind:class="{disabled:this.paginationPlusInfo.currentPage == this.paginationPlusInfo.total}">
            <a class="page-link" v-on:click="current(this.paginationPlusInfo.total)"> » </a>
        </li>
        <span class="total" style="line-height: 30px;margin-left: 10px;" v-if="this.paginationPlusInfo.dataCount != 0">共 {{this.paginationPlusInfo.dataCount}} 条</span>
    </ul>
</nav>
WebService/src/main/resources/components/paginationPackage/paginationPlus/paginationPlus.js
New file
@@ -0,0 +1,171 @@
/**
 分页组件
 **/
(function (vc) {
    vc.extends({
        data: {
            paginationPlusInfo: {
                total:0,
                dataCount: 0,
                currentPage: 1,
                pageList: []
            }
        },
        _initEvent: function () {
            vc.on($namespace,'paginationPlus','info_event', function (_paginationPlusInfo) {
                this.paginationPlusInfo.total = _paginationPlusInfo.total;
                if(_paginationPlusInfo.hasOwnProperty("dataCount")){
                    this.paginationPlusInfo.dataCount = _paginationPlusInfo.dataCount;
                }
                this.paginationPlusInfo.currentPage = _paginationPlusInfo.currentPage;
                this._freshPageList();
            });
            vc.on($namespace,'paginationPlus', 'init', function (_paginationPlusInfo) {
                this.paginationPlusInfo.total = _paginationPlusInfo.total;
                if(_paginationPlusInfo.hasOwnProperty("dataCount")) {
                    this.paginationPlusInfo.dataCount = _paginationPlusInfo.dataCount;
                }
                this.paginationPlusInfo.currentPage = _paginationPlusInfo.currentPage;
                this._freshPageList();
            });
        },
        methods: {
            previous: function () {
                // 当前页为 1时 不触发消息
                if (this.paginationPlusInfo.currentPage <= 1) {
                    return;
                }
                this.paginationPlusInfo.currentPage = this.paginationPlusInfo.currentPage - 1;
                vc.emit($namespace,'paginationPlus','page_event', this.paginationPlusInfo.currentPage);
            },
            next: function () {
                if (this.paginationPlusInfo.currentPage >= this.paginationPlusInfo.total) {
                    return;
                }
                this.paginationPlusInfo.currentPage = this.paginationPlusInfo.currentPage + 1;
                vc.emit($namespace,'paginationPlus','page_event', this.paginationPlusInfo.currentPage);
            },
            current: function (_page) {
                if(_page == -1){
                    return;
                }
                if (_page > this.paginationPlusInfo.total) {
                    return;
                }
                this.paginationPlusInfo.currentPage = _page;
                vc.emit($namespace,'paginationPlus','page_event', this.paginationPlusInfo.currentPage);
            },
            _freshPageList: function () {
                var current = this.paginationPlusInfo.currentPage;
                var total = this.paginationPlusInfo.total;
                this.paginationPlusInfo.pageList = [];
                if (total > 6) {
                    //当前页数小于5时显示省略号
                    if (current < 5) {
                        for (var i = 1; i < 6; i++) {
                            if (current == i) {
                                this.paginationPlusInfo.pageList.push({
                                    "page": i,
                                    "pageView": i + "",
                                    "currentPage": true
                                });
                            } else {
                                this.paginationPlusInfo.pageList.push({
                                    "page": i,
                                    "pageView": i + "",
                                    "currentPage": false
                                });
                            }
                        }
                        this.paginationPlusInfo.pageList.push({
                            "page": -1,
                            "pageView": "...",
                            "currentPage": false
                        });
                        this.paginationPlusInfo.pageList.push({
                            "page": total,
                            "pageView": total + "",
                            "currentPage": false
                        });
                    } else {
                        //判断页码在末尾的时候
                        if (current < total - 3) {
                            for (var i = current - 2; i < current + 3; i++) {
                                if (current == i) {
                                    this.paginationPlusInfo.pageList.push({
                                        "page": i,
                                        "pageView": i + "",
                                        "currentPage": true
                                    });
                                } else {
                                    this.paginationPlusInfo.pageList.push({
                                        "page": i,
                                        "pageView": i + "",
                                        "currentPage": false
                                    });
                                }
                            }
                            this.paginationPlusInfo.pageList.push({
                                "page": -1,
                                "pageView": "...",
                                "currentPage": false
                            });
                            this.paginationPlusInfo.pageList.push({
                                "page": total,
                                "pageView": total + "",
                                "currentPage": false
                            });
                            //页码在中间部分时候
                        } else {
                            this.paginationPlusInfo.pageList.push({
                                "page": 1,
                                "pageView": 1 + "",
                                "currentPage": false
                            });
                            this.paginationPlusInfo.pageList.push({
                                "page": -1,
                                "pageView": "...",
                                "currentPage": false
                            });
                            for (var i = total - 4; i < total + 1; i++) {
                                if (current == i) {
                                    this.paginationPlusInfo.pageList.push({
                                        "page": i,
                                        "pageView": i + "",
                                        "currentPage": true
                                    });
                                } else {
                                    this.paginationPlusInfo.pageList.push({
                                        "page": i,
                                        "pageView": i + "",
                                        "currentPage": false
                                    });
                                }
                            }
                        }
                    }
                    //页面总数小于6的时候
                } else {
                    for (var i = 1; i < total + 1; i++) {
                        if (current == i) {
                            this.paginationPlusInfo.pageList.push({
                                "page": i,
                                "pageView": i + "",
                                "currentPage": true
                            });
                        } else {
                            this.paginationPlusInfo.pageList.push({
                                "page": i,
                                "pageView": i + "",
                                "currentPage": false
                            });
                        }
                    }
                }
            }
        }
    });
})(window.vc);
WebService/src/main/resources/components/privilegePackage/add-privilege/addPrivilege.html
@@ -18,9 +18,9 @@
                                    </div>
                                    <div class="col-sm-5">
                                        <div class="input-group">
                                            <input placeholder="输入权限名称" type="text" class="form-control form-control-sm">
                                            <input placeholder="输入权限名称" type="text" v-model = "addPrivilegeInfo._pName" class="form-control form-control-sm">
                                            <span class="input-group-append">
                                                <button type="button" class="btn btn-sm btn-primary">查询</button>
                                                <button type="button" class="btn btn-sm btn-primary" @click="listNoAddPrivilege()">查询</button>
                                            </span>
                                        </div>
                                    </div>
@@ -29,28 +29,34 @@
                                    <table class="table table-striped">
                                        <thead>
                                        <tr>
                                            <th class="text-center">
                                                <input type="checkbox"  class="i-checks " @click="checkAll($event)" id="quan">
                                            </th>
                                            <th>权限编码</th>
                                            <th>权限名称</th>
                                            <th>资源路径</th>
                                            <th>权限描述</th>
                                            <th>创建时间</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                            <tr v-for="noAddPrivilege in addPrivilegeInfo._noAddPrivilege">
                                                <td class="text-center">
                                                    <input type="checkbox" class="i-checks checkItem" v-bind:value="noAddPrivilege.pId" v-model="addPrivilegeInfo.selectPrivileges" >
                                                </td>
                                                <td>{{noAddPrivilege.pId}}</td>
                                                <td>{{noAddPrivilege.name}}</td>
                                                <td>{{noAddPrivilege.resource}}</td>
                                                <td>{{noAddPrivilege.description}}</td>
                                                <td>{{vc.dateFormat(noAddPrivilege.createTime)}}</td>
                                                <td>
                                                    <button class="btn btn-primary btn-xs" v-on:click="addPrivilegeToPrivilegeGroup(noAddPrivilege)">添加</button>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    <div class="ibox-content" v-if="addPrivilegeInfo._noAddPrivilege.length > 0">
                                        <button class="btn btn-primary float-right" type="button" v-on:click="addPrivilegeToPrivilegeGroup()"><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>
WebService/src/main/resources/components/privilegePackage/add-privilege/addPrivilege.js
@@ -4,10 +4,24 @@
        data:{
            addPrivilegeInfo:{
                _currentPgId:'',
                _pName:'',
                name:'',
                description:'',
                errorInfo:'',
                _noAddPrivilege:[]
                _noAddPrivilege:[],
                selectPrivileges:[]
            }
        },
        watch: { // 监视双向绑定的数据数组
            addPrivilegeInfo: {
                handler(){ // 数据数组有变化将触发此函数
                    if(vc.component.addPrivilegeInfo.selectPrivileges.length == vc.component.addPrivilegeInfo._noAddPrivilege.length){
                        document.querySelector('#quan').checked = true;
                    }else {
                        document.querySelector('#quan').checked = false;
                    }
                },
                deep: true // 深度监视
            }
        },
         _initMethod:function(){
@@ -26,7 +40,8 @@
                vc.component.addPrivilegeInfo._noAddPrivilege=[];
                var param = {
                    params:{
                        pgId:vc.component.addPrivilegeInfo._currentPgId
                        pgId:vc.component.addPrivilegeInfo._currentPgId,
                        pName:vc.component.addPrivilegeInfo._pName
                    }
                }
                vc.http.get(
@@ -47,14 +62,30 @@
                                vc.component.addPrivilegeInfo.errorInfo = errInfo;
                             });
            },
            addPrivilegeToPrivilegeGroup:function(_privilegeInfo){
            addPrivilegeToPrivilegeGroup:function(){
                vc.component.addPrivilegeInfo.errorInfo = "";
                _privilegeInfo.pgId = vc.component.addPrivilegeInfo._currentPgId;
                var _selectPrivileges = vc.component.addPrivilegeInfo.selectPrivileges;
                if(_selectPrivileges.length < 1){
                    vc.toast("请先选择权限");
                    return ;
                }
                var _pIds = [];
                for(var selectIndex = 0;selectIndex < _selectPrivileges.length;selectIndex ++){
                    var _pId = {
                        pId: _selectPrivileges[selectIndex]
                    };
                    _pIds.push(_pId);
                }
                var _objData = {
                    pgId:vc.component.addPrivilegeInfo._currentPgId,
                    pIds:_pIds
                };
                vc.http.post(
                    'addPrivilege',
                    'addPrivilegeToPrivilegeGroup',
                    JSON.stringify(_privilegeInfo),
                    JSON.stringify(_objData),
                    {
                        emulateJSON:true
                     },
@@ -63,6 +94,7 @@
                        if(res.status == 200){
                            //关闭model
                            vc.component.listNoAddPrivilege();
                            $('#addPrivilegeModel').modal('hide');
                            vc.component.$emit('privilege_loadPrivilege',vc.component.addPrivilegeInfo._currentPgId);
                            return ;
                        }
@@ -73,6 +105,18 @@
                        vc.component.addPrivilegeInfo.errorInfo = errInfo;
                     });
            },
            checkAll:function(e){
                    var checkObj = document.querySelectorAll('.checkItem'); // 获取所有checkbox项
                    if(e.target.checked){ // 判定全选checkbox的勾选状态
                        for(var i=0;i<checkObj.length;i++){
                            if(!checkObj[i].checked){ // 将未勾选的checkbox选项push到绑定数组中
                                vc.component.addPrivilegeInfo.selectPrivileges.push(checkObj[i].value);
                            }
                        }
                    }else { // 如果是去掉全选则清空checkbox选项绑定数组
                        vc.component.addPrivilegeInfo.selectPrivileges = [];
                    }
            }
        }
    });
WebService/src/main/resources/components/privilegePackage/add-staff-privilege/addStaffPrivilege.html
@@ -18,46 +18,48 @@
                                    <table class="table table-striped" v-if="addStaffPrivilegeInfo._currentTab == 1">
                                        <thead>
                                        <tr>
                                            <th class="text-center">
                                                <input type="checkbox"  class="i-checks" v-bind:checked="addStaffPrivilegeInfo.quanGroup == true" @click="checkAllGroup($event)" >
                                            </th>
                                            <th>权限组编码</th>
                                            <th>权限组名称</th>
                                            <th>权限组描述</th>
                                            <th>创建时间</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                            <tr v-for="privilegeGroup in addStaffPrivilegeInfo._noAddPrivilegeGroup">
                                                <td class="text-center">
                                                    <input type="checkbox" class="i-checks checkGroupItem" v-bind:value="privilegeGroup.pgId" v-model="addStaffPrivilegeInfo.selectPrivilegeGroups" >
                                                </td>
                                                <td>{{privilegeGroup.pgId}}</td>
                                                <td>{{privilegeGroup.name}}</td>
                                                <td>{{privilegeGroup.description}}</td>
                                                <td>{{vc.dateFormat(privilegeGroup.createTime)}}</td>
                                                <td>
                                                    <button class="btn btn-primary btn-xs" v-on:click="userAddPrivilegeGroup(privilegeGroup.pgId)">添加</button>
                                                </td>
                                            </tr>
                                        </tbody>
                                    </table>
                                    <table class="table table-striped" v-if="addStaffPrivilegeInfo._currentTab == 2">
                                        <thead>
                                        <tr>
                                            <th class="text-center">
                                                <input type="checkbox"  class="i-checks " v-bind:checked="addStaffPrivilegeInfo.quan == true" @click="checkAll($event)">
                                            </th>
                                            <th>权限编码</th>
                                            <th>权限名称</th>
                                            <th>权限描述</th>
                                            <th>创建时间</th>
                                            <th>操作</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr v-for="privilege in addStaffPrivilegeInfo._noAddPrivilege">
                                            <td class="text-center">
                                                <input type="checkbox" class="i-checks checkItem" v-bind:value="privilege.pId" v-model="addStaffPrivilegeInfo.selectPrivileges" >
                                            </td>
                                            <td>{{privilege.pId}}</td>
                                            <td>{{privilege.name}}</td>
                                            <td>{{privilege.description}}</td>
                                            <td>{{vc.dateFormat(privilege.createTime)}}</td>
                                            <td>
                                                <button class="btn btn-primary btn-xs" v-on:click="userAddPrivilege(privilege.pId)">添加</button>
                                            </td>
                                        </tr>
                                        </tbody>
                                    </table>
@@ -69,6 +71,7 @@
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">关闭</button>
                <button type="button" class="btn btn-primary" v-on:click="addStaffPrivilege()">提交</button>
            </div>
        </div>
    </div>
WebService/src/main/resources/components/privilegePackage/add-staff-privilege/addStaffPrivilege.js
@@ -9,7 +9,29 @@
                errorInfo:'',
                _noAddPrivilege:[],
                _noAddPrivilegeGroup:[],
                _currentTab:1
                _currentTab:1,
                selectPrivileges:[],
                selectPrivilegeGroups:[],
                quanGroup:false,
                quan:false
            }
        },
        watch: { // 监视双向绑定的数据数组
            addStaffPrivilegeInfo: {
                handler(){ // 数据数组有变化将触发此函数
                    if(vc.component.addStaffPrivilegeInfo.selectPrivileges.length == vc.component.addStaffPrivilegeInfo._noAddPrivilege.length){
                       vc.component.addStaffPrivilegeInfo.quan= true;
                    }else {
                       vc.component.addStaffPrivilegeInfo.quan= false;
                    }
                    if(vc.component.addStaffPrivilegeInfo.selectPrivilegeGroups.length == vc.component.addStaffPrivilegeInfo._noAddPrivilegeGroup.length){
                       vc.component.addStaffPrivilegeInfo.quanGroup= true;
                    }else {
                       vc.component.addStaffPrivilegeInfo.quanGroup= false;
                    }
                },
                deep: true // 深度监视
            }
        },
         _initMethod:function(){
@@ -86,12 +108,34 @@
                                vc.component.addStaffPrivilegeInfo.errorInfo = errInfo;
                             });
            },
            addStaffPrivilege:function(_pId,_privilegeFlag){
            addStaffPrivilege:function(){
                vc.component.addStaffPrivilegeInfo.errorInfo = "";
                var _pIds = [];
                var _selectPrivilegeGroups = vc.component.addStaffPrivilegeInfo.selectPrivilegeGroups;
                var _selectPrivileges = vc.component.addStaffPrivilegeInfo.selectPrivileges;
                if(vc.component.addStaffPrivilegeInfo._currentTab == 1){
                    for(var _pIndex = 0;_pIndex < _selectPrivilegeGroups.length;_pIndex++){
                        var _pgId = {
                            pId: _selectPrivilegeGroups[_pIndex]
                        }
                        _pIds.push(_pgId);
                    }
                }else{
                    for(var _pIndex = 0;_pIndex < _selectPrivileges.length;_pIndex++){
                        var _pId = {
                            pId: _selectPrivileges[_pIndex]
                        }
                        _pIds.push(_pId);
                    }
                }
                if(_pIds.length < 1){
                    vc.toast('未选择相应权限或权限组');
                    return ;
                }
                var param = {
                    userId:vc.component.addStaffPrivilegeInfo._currentUserId,
                    pId:_pId,
                    pFlag:_privilegeFlag
                    pIds:_pIds,
                    pFlag:vc.component.addStaffPrivilegeInfo._currentTab
                };
                vc.http.post(
                    'addStaffPrivilege',
@@ -118,13 +162,29 @@
                        vc.component.addStaffPrivilegeInfo.errorInfo = errInfo;
                     });
            },
            userAddPrivilegeGroup:function(_pgId){
                console.log("需要添加权限:",_pgId);
                vc.component.addStaffPrivilege(_pgId,1)
            checkAll:function(e){
                    var checkObj = document.querySelectorAll('.checkItem'); // 获取所有checkbox项
                    if(e.target.checked){ // 判定全选checkbox的勾选状态
                        for(var i=0;i<checkObj.length;i++){
                            if(!checkObj[i].checked){ // 将未勾选的checkbox选项push到绑定数组中
                                vc.component.addStaffPrivilegeInfo.selectPrivileges.push(checkObj[i].value);
                            }
                        }
                    }else { // 如果是去掉全选则清空checkbox选项绑定数组
                        vc.component.addStaffPrivilegeInfo.selectPrivileges = [];
                    }
            },
            userAddPrivilege:function(_pId){
                console.log("需要添加权限:",_pId);
                vc.component.addStaffPrivilege(_pId,2)
            checkAllGroup:function(e){
                     var checkObj = document.querySelectorAll('.checkGroupItem'); // 获取所有checkbox项
                     if(e.target.checked){ // 判定全选checkbox的勾选状态
                         for(var i=0;i<checkObj.length;i++){
                             if(!checkObj[i].checked){ // 将未勾选的checkbox选项push到绑定数组中
                                 vc.component.addStaffPrivilegeInfo.selectPrivilegeGroups.push(checkObj[i].value);
                             }
                         }
                     }else { // 如果是去掉全选则清空checkbox选项绑定数组
                         vc.component.addStaffPrivilegeInfo.selectPrivilegeGroups = [];
                     }
            }
        }
    });
WebService/src/main/resources/components/privilegePackage/edit-privilege-group/editPrivilegeGroup.html
New file
@@ -0,0 +1,28 @@
<div id = "editPrivilegeGroupModel" 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>
                        <p style="color:red;">{{editPrivilegeGroupInfo.errorInfo}}</p>
                        <div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">权限组名称</label>
                                <div class="col-sm-10"><input v-model="editPrivilegeGroupInfo.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="editPrivilegeGroupInfo.description" type="text" placeholder="必填,请填写员工名称" class="form-control"></div>
                            </div>
                            <div class="ibox-content">
                                <button class="btn btn-primary float-right" type="button" v-on:click="saveEditPrivilegeGroup()" ><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>
WebService/src/main/resources/components/privilegePackage/edit-privilege-group/editPrivilegeGroup.js
New file
@@ -0,0 +1,102 @@
(function(vc){
    vc.extends({
        data:{
            editPrivilegeGroupInfo:{
                pgId:'',
                name:'',
                description:'',
                errorInfo:''
            }
        },
         _initMethod:function(){
         },
         _initEvent:function(){
             vc.on('editPrivilegeGroup','openPrivilegeGroupModel',function(_params){
                vc.copyObject(_params,vc.component.editPrivilegeGroupInfo)
                $('#editPrivilegeGroupModel').modal('show');
            });
        },
        methods:{
            editPrivilegeGroupValidate(){
                return vc.validate.validate({
                    editPrivilegeGroupInfo:vc.component.editPrivilegeGroupInfo
                },{
                    'editPrivilegeGroupInfo.pgId':[
                        {
                            limit:"required",
                            param:"",
                            errInfo:"权限组ID不能为空"
                        }
                    ],
                    'editPrivilegeGroupInfo.name':[
                        {
                            limit:"required",
                            param:"",
                            errInfo:"权限组名不能为空"
                        },
                        {
                            limit:"maxin",
                            param:"2,10",
                            errInfo:"权限组名长度必须在2位至10位"
                        },
                    ],
                    'editPrivilegeGroupInfo.description':[
                        {
                            limit:"required",
                            param:"",
                            errInfo:"权限组描述不能为空"
                        },
                        {
                            limit:"maxLength",
                            param:"200",
                            errInfo:"权限组描述长度不能超过200位"
                        },
                    ]
                });
            },
            saveEditPrivilegeGroup:function(){
                if(!vc.component.editPrivilegeGroupValidate()){
                    vc.component.editPrivilegeGroupInfo.errorInfo = vc.validate.errInfo;
                    return ;
                }
                vc.component.editPrivilegeGroupInfo.errorInfo = "";
                vc.http.post(
                    'editPrivilegeGroup',
                    'editPrivilegeGroupInfo',
                    JSON.stringify(vc.component.editPrivilegeGroupInfo),
                    {
                        emulateJSON:true
                     },
                     function(json,res){
                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
                        if(res.status == 200){
                            //关闭model
                            $('#editPrivilegeGroupModel').modal('hide');
                            vc.component.clearEditPrivilegeGroupInfo();
                            vc.component.$emit('privilegeGroup_loadPrivilegeGroup',{});
                            return ;
                        }
                        vc.component.editPrivilegeGroupInfo.errorInfo = json;
                     },
                     function(errInfo,error){
                        console.log('请求失败处理');
                        vc.component.editPrivilegeGroupInfo.errorInfo = errInfo;
                     });
            },
            clearEditPrivilegeGroupInfo:function(){
                vc.component.editPrivilegeGroupInfo = {
                    pgId:'',
                    name:'',
                    description:'',
                    errorInfo:''
                };
            }
        }
    });
})(window.vc);
WebService/src/main/resources/components/privilegePackage/privilege-group/privilegeGroup.html
@@ -1,4 +1,4 @@
<div class="col-lg-3">
<div class="col-lg-3" style="background:#FFFFFF">
    <div class="ibox ">
        <div class="ibox-content mailbox-content">
            <div class="file-manager">
@@ -14,6 +14,10 @@
                            <i v-if="pGroup.storeId != '9999'" class="glyphicon glyphicon-remove-sign float-right"
                               style="color:#dc3545"
                               v-on:click.stop="openDeletePrivilegeGroupModel(pGroup)"></i>
                            <i v-if="pGroup.storeId != '9999'" class="glyphicon glyphicon-edit float-right"
                               style="color:#1ab394"
                               v-on:click.stop="openEditPrivilegeGroupModel(pGroup)"></i>
                        </a>
                    </li>
                </ul>
@@ -22,6 +26,7 @@
            </div>
            <vc:create name="addPrivilegeGroup"></vc:create>
            <vc:create name="editPrivilegeGroup"></vc:create>
            <vc:create name="deletePrivilegeGroup"></vc:create>
        </div>
    </div>
WebService/src/main/resources/components/privilegePackage/privilege-group/privilegeGroup.js
@@ -54,6 +54,9 @@
            openPrivilegeGroupModel:function(){
                vc.component.$emit('addPrivilegeGroup_openPrivilegeGroupModel',{});
            },
            openEditPrivilegeGroupModel:function(_pGroup){
                vc.emit('editPrivilegeGroup','openPrivilegeGroupModel',_pGroup);
            },
            openDeletePrivilegeGroupModel:function(_pGroup){
                vc.component.$emit('deletePrivilegeGroup_openDeletePrivilegeGroupModel',_pGroup);
            }
WebService/src/main/resources/components/privilegePackage/privilege-manage/privilege.html
@@ -29,10 +29,9 @@
                    <tr>
                        <th>权限编码</th>
                        <th>权限名称</th>
                        <th>资源路径</th>
                        <th>权限描述</th>
                        <th>创建时间</th>
                        <th>操作</th>
                        <th class="text-right">操作</th>
                    </tr>
                </thead>
                <tbody>
@@ -41,13 +40,12 @@
                        {{privilege.pId}}
                    </td>
                    <td class="mail-ontact">{{privilege.name}}</td>
                    <td class="mail-ontact">{{privilege.resource}}</td>
                    <td class="mail-subject">{{privilege.description}}</td>
                    <td class="">{{vc.dateFormat(privilege.createTime)}}</td>
                    <td class="text-right mail-date">
                        <i  v-if="privilegeInfo._currentStoreId != '9999'"
                                                         v-on:click="openDeletePrivilegeModel(privilege)"
                                                         class="glyphicon glyphicon-remove"></i>
                    <td class="text-right">
                        <div class="btn-group">
                            <button class="btn-white btn btn-xs" v-on:click="openDeletePrivilegeModel(privilege)">删除</button>
                        </div>
                    </td>
                </tr>
WebService/src/main/resources/components/privilegePackage/privilege-manage/privilege.js
@@ -31,7 +31,7 @@
                var param = {
                    params:{
                        pgId:_pgId,
                        name:vc.component.privilegeInfo._currentPgName
                        name:vc.component.privilegeInfo._pName
                    }
                };
@@ -50,7 +50,7 @@
            },
            openAddPrivilegeModel:function(){
                vc.component.$emit('addPrivilege_openPrivilegeModel',{
                            pgId:vc.component.privilegeInfo._pName
                            pgId:vc.component.privilegeInfo._currentPgId
                });
            },
            openDeletePrivilegeModel:function(_p){
WebService/src/main/resources/components/servicePackage/add-service/addService.js
@@ -170,7 +170,7 @@
                    return ;
                }
                vc.component.addServiceInfo.communityId = vc.getCurrentCommunity().communityId;
                //vc.component.addServiceInfo.communityId = vc.getCurrentCommunity().communityId;
                //不提交数据将数据 回调给侦听处理
                if(vc.notNull($props.callBackListener)){
                    vc.emit($props.callBackListener,$props.callBackFunction,vc.component.addServiceInfo);
WebService/src/main/resources/components/staffPackage/addStaffView/addStaffView.html
@@ -38,7 +38,7 @@
                <div class="form-group row">
                    <label class="col-sm-2 col-form-label">员工邮箱</label>
                    <div class="col-sm-10">
                        <input v-model="addStaffViewInfo.email" type="text" placeholder="必填,请填写员工邮箱"
                        <input v-model="addStaffViewInfo.email" type="text" placeholder="可选,请填写员工邮箱"
                               class="form-control">
                    </div>
                </div>
WebService/src/main/resources/components/staffPackage/addStaffView/addStaffView.js
@@ -2,7 +2,8 @@
    vc.extends({
        propTypes: {
           callBackListener:vc.propTypes.string, //父组件名称
            callBackListener: vc.propTypes.string,
            //父组件名称
           callBackFunction:vc.propTypes.string //父组件监听方法
        },
        data:{
@@ -29,7 +30,8 @@
         },
         _initEvent:function(){
            vc.on('addStaffViewInfo', 'onIndex', function(_index){
            vc.on('addStaffViewInfo', 'onIndex',
            function(_index) {
                vc.component.addStaffViewInfo.index = _index;
            });
        },
@@ -37,9 +39,9 @@
            addStaffValidate(){
                return vc.validate.validate({
                    addStaffViewInfo:vc.component.addStaffViewInfo
                },{
                    'addStaffViewInfo.username':[
                },
{
                    'addStaffViewInfo.username': [{
                            limit:"required",
                            param:"",
                            errInfo:"员工名称不能为空"
@@ -50,15 +52,13 @@
                            errInfo:"员工名称长度必须在2位至10位"
                        },
                    ],
'addStaffViewInfo.sex':[
{
                    'addStaffViewInfo.sex': [{
                            limit:"required",
                            param:"",
                            errInfo:"员工性别不能为空"
                        },
                    ],
                    'addStaffViewInfo.relCd':[
                    {
                    'addStaffViewInfo.relCd': [{
                        limit:"required",
                        param:"",
                        errInfo:"员工岗位不能为空"
@@ -69,27 +69,13 @@
                        errInfo:"员工岗位错误"
                    },
                    ],
'addStaffViewInfo.email':[
{
                            limit:"required",
                            param:"",
                            errInfo:"员工邮箱不能为空"
                        },
 {
                            limit:"email",
                            param:"",
                            errInfo:"员工邮箱不是有效邮箱"
                        },
                    ],
'addStaffViewInfo.tel':[
 {
                    'addStaffViewInfo.tel': [{
                            limit:"photo",
                            param:"",
                            errInfo:"联系方式不是有效手机"
                        },
                    ],
'addStaffViewInfo.address':[
{
                    'addStaffViewInfo.address': [{
                            limit:"required",
                            param:"",
                            errInfo:"家庭住址不能为空"
WebService/src/main/resources/components/staffPackage/edit-staff/editStaff.html
@@ -13,7 +13,7 @@
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">员工邮箱</label>
                                <div class="col-sm-10"><input v-model="editStaffInfo.email" type="email" placeholder="必填,请填写员工名称" class="form-control"></div>
                                <div class="col-sm-10"><input v-model="editStaffInfo.email" type="email" placeholder="可选,请填写员工名称" class="form-control"></div>
                            </div>
                            <div class="form-group row">
                                <label class="col-sm-2 col-form-label">手机号码</label>
WebService/src/main/resources/components/staffPackage/edit-staff/editStaff.js
@@ -47,18 +47,6 @@
                            errInfo:"用户名长度必须在2位至10位"
                        },
                    ],
                    'editStaffInfo.email':[
                        {
                            limit:"required",
                            param:"",
                            errInfo:"密码不能为空"
                        },
                        {
                            limit:"email",
                            param:"",
                            errInfo:"不是有效的邮箱"
                        },
                    ],
                    'editStaffInfo.tel':[
                        {
                            limit:"required",
docs/document/services/org/DeleteOrgCommunityInfo.md
New file
@@ -0,0 +1,114 @@
**1\. 删除隶属小区**
###### 接口功能
> API服务做删除隶属小区时调用该接口
###### URL
> [http://orgCommunity-service/orgCommunityApi/service](http://orgCommunity-service/orgCommunityApi/service)
###### 支持格式
> JSON
###### HTTP请求方式
> POST
###### 协议接口
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-:|
|-|orders|1|Object|-|订单节点|-|
|-|business|1|Array|-|业务节点|-|
###### orders
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
|-|orders|1|Object|-|订单节点|-|
|orders|appId|1|String|10|系统ID|由中心服务提供|
|orders|transactionId|1|String|30|交互流水|appId+'00'+YYYYMMDD+10位序列|
|orders|userId|1|String|30|用户ID|已有用户ID|
|orders|orderTypeCd|1|String|4|订单类型|查看订单类型说明|
|orders|requestTime|1|String|14|请求时间|YYYYMMDDhhmmss|
|orders|remark|1|String|200|备注|备注|
|orders|sign|?|String|64|签名|查看加密说明|
|orders|attrs|?|Array|-|订单属性|-|
|attrs|specCd|1|String|12|规格编码|由中心服务提供|
|attrs|value|1|String|50|属性值|-|
|orders|response|1|Object|-|返回结果节点|-|
|response|code|1|String|4|返回状态|查看状态说明|
|response|message|1|String|200|返回状态描述|-|
###### business
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
|-|business|?|Array|-|业务节点|-|
|business|businessTypeCd|1|String|12|业务类型编码|500100030002|
|business|datas|1|Object|-|数据节点|不同的服务下的节点不一样|
|datas|businessOrgCommunityInfo|1|Object|-|小区成员|小区成员|
|businessOrgCommunityInfo|orgCommunityId|1|String|30|-|-|
###### 返回协议
当http返回状态不为200 时请求处理失败 body内容为失败的原因
当http返回状态为200时请求处理成功,body内容为返回内容,
###### 举例
> 地址:[http://orgCommunity-service/orgCommunityApi/service](http://orgCommunity-service/orgCommunityApi/service)
``` javascript
请求头信息:
Content-Type:application/json
请求报文:
{
  "orders": {
    "appId": "外系统ID,分配得到",
    "transactionId": "100000000020180409224736000001",
    "userId": "用户ID",
    "orderTypeCd": "订单类型,查询,受理",
    "requestTime": "20180409224736",
    "remark": "备注",
    "sign": "这个服务是否要求MD5签名",
    "businessType":"I",
    "attrs": [{
      "specCd": "配置的字段ID",
      "value": "具体值"
    }]
  },
  "business": {
    "businessTypeCd": "140300050001",
    "bId":"1234567892",
    "remark": "备注",
    "datas": {
      "businessOrgCommunityInfo": {
                "orgCommunityId":"填写存在的值"
      }
    },
    "attrs": [{
      "specCd": "配置的字段ID",
      "value": "具体值"
    }]
  }
}
返回报文:
 {
    "orderTypeCd": "D",
    "response": {
        "code": "0000",
        "message": "成功"
    },
    "responseTime": "20190418102004",
    "bId": "202019041810750003",
    "businessType": "B",
    "transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
    "dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
}
```
docs/document/services/org/SaveOrgCommunityInfo.md
New file
@@ -0,0 +1,124 @@
**1\. 保存隶属小区**
###### 接口功能
> API服务做保存隶属小区时调用该接口
###### URL
> [http://orgCommunity-service/orgCommunityApi/service](http://orgCommunity-service/orgCommunityApi/service)
###### 支持格式
> JSON
###### HTTP请求方式
> POST
###### 协议接口
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-:|
|-|orders|1|Object|-|订单节点|-|
|-|business|1|Array|-|业务节点|-|
###### orders
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
|-|orders|1|Object|-|订单节点|-|
|orders|appId|1|String|10|系统ID|由中心服务提供|
|orders|transactionId|1|String|30|交互流水|appId+'00'+YYYYMMDD+10位序列|
|orders|userId|1|String|30|用户ID|已有用户ID|
|orders|orderTypeCd|1|String|4|订单类型|查看订单类型说明|
|orders|requestTime|1|String|14|请求时间|YYYYMMDDhhmmss|
|orders|remark|1|String|200|备注|备注|
|orders|sign|?|String|64|签名|查看加密说明|
|orders|attrs|?|Array|-|订单属性|-|
|attrs|specCd|1|String|12|规格编码|由中心服务提供|
|attrs|value|1|String|50|属性值|-|
|orders|response|1|Object|-|返回结果节点|-|
|response|code|1|String|4|返回状态|查看状态说明|
|response|message|1|String|200|返回状态描述|-|
###### business
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
|-|business|?|Array|-|业务节点|-|
|business|businessTypeCd|1|String|12|业务类型编码|500100030002|
|business|datas|1|Object|-|数据节点|不同的服务下的节点不一样|
|datas|businessOrgCommunityInfo|1|Object|-|小区成员|小区成员|
|businessOrgCommunityInfo|orgName|1|String|30|-|-|
|businessOrgCommunityInfo|communityName|1|String|30|-|-|
|businessOrgCommunityInfo|communityId|1|String|30|-|-|
|businessOrgCommunityInfo|storeId|1|String|30|-|-|
|businessOrgCommunityInfo|orgId|1|String|30|-|-|
|businessOrgCommunityInfo|orgCommunityId|1|String|30|-|-|
###### 返回协议
当http返回状态不为200 时请求处理失败 body内容为失败的原因
当http返回状态为200时请求处理成功,body内容为返回内容,
###### 举例
> 地址:[http://orgCommunity-service/orgCommunityApi/service](http://orgCommunity-service/orgCommunityApi/service)
``` javascript
请求头信息:
Content-Type:application/json
请求报文:
{
  "orders": {
    "appId": "外系统ID,分配得到",
    "transactionId": "100000000020180409224736000001",
    "userId": "用户ID",
    "orderTypeCd": "订单类型,查询,受理",
    "requestTime": "20180409224736",
    "remark": "备注",
    "sign": "这个服务是否要求MD5签名",
    "businessType":"I",
    "attrs": [{
      "specCd": "配置的字段ID",
      "value": "具体值"
    }]
  },
  "business": {
    "businessTypeCd": "140300030001",
    "bId":"1234567892",
    "remark": "备注",
    "datas": {
      "businessOrgCommunityInfo": {
                "orgName":"填写具体值",
        "communityName":"填写具体值",
        "communityId":"填写具体值",
        "storeId":"填写具体值",
        "orgId":"填写具体值",
        "orgCommunityId":"填写具体值"
      }
    },
    "attrs": [{
      "specCd": "配置的字段ID",
      "value": "具体值"
    }]
  }
}
返回报文:
 {
    "orderTypeCd": "D",
    "response": {
        "code": "0000",
        "message": "成功"
    },
    "responseTime": "20190418102004",
    "bId": "202019041810750003",
    "businessType": "B",
    "transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
    "dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
}
```
docs/document/services/org/UpdateOrgCommunityInfo.md
New file
@@ -0,0 +1,124 @@
**1\. 修改隶属小区**
###### 接口功能
> API服务做修改隶属小区时调用该接口
###### URL
> [http://orgCommunity-service/orgCommunityApi/service](http://orgCommunity-service/orgCommunityApi/service)
###### 支持格式
> JSON
###### HTTP请求方式
> POST
###### 协议接口
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-:|
|-|orders|1|Object|-|订单节点|-|
|-|business|1|Array|-|业务节点|-|
###### orders
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
|-|orders|1|Object|-|订单节点|-|
|orders|appId|1|String|10|系统ID|由中心服务提供|
|orders|transactionId|1|String|30|交互流水|appId+'00'+YYYYMMDD+10位序列|
|orders|userId|1|String|30|用户ID|已有用户ID|
|orders|orderTypeCd|1|String|4|订单类型|查看订单类型说明|
|orders|requestTime|1|String|14|请求时间|YYYYMMDDhhmmss|
|orders|remark|1|String|200|备注|备注|
|orders|sign|?|String|64|签名|查看加密说明|
|orders|attrs|?|Array|-|订单属性|-|
|attrs|specCd|1|String|12|规格编码|由中心服务提供|
|attrs|value|1|String|50|属性值|-|
|orders|response|1|Object|-|返回结果节点|-|
|response|code|1|String|4|返回状态|查看状态说明|
|response|message|1|String|200|返回状态描述|-|
###### business
|父元素名称|参数名称|约束|类型|长度|描述|取值说明|
| :-: | :-: | :-: | :-: | :-: | :-: | :-: |
|-|business|?|Array|-|业务节点|-|
|business|businessTypeCd|1|String|12|业务类型编码|500100030002|
|business|datas|1|Object|-|数据节点|不同的服务下的节点不一样|
|datas|businessOrgCommunityInfo|1|Object|-|小区成员|小区成员|
|businessOrgCommunityInfo|orgName|1|String|30|-|-|
|businessOrgCommunityInfo|communityName|1|String|30|-|-|
|businessOrgCommunityInfo|communityId|1|String|30|-|-|
|businessOrgCommunityInfo|storeId|1|String|30|-|-|
|businessOrgCommunityInfo|orgId|1|String|30|-|-|
|businessOrgCommunityInfo|orgCommunityId|1|String|30|-|-|
###### 返回协议
当http返回状态不为200 时请求处理失败 body内容为失败的原因
当http返回状态为200时请求处理成功,body内容为返回内容,
###### 举例
> 地址:[http://orgCommunity-service/orgCommunityApi/service](http://orgCommunity-service/orgCommunityApi/service)
``` javascript
请求头信息:
Content-Type:application/json
请求报文:
{
  "orders": {
    "appId": "外系统ID,分配得到",
    "transactionId": "100000000020180409224736000001",
    "userId": "用户ID",
    "orderTypeCd": "订单类型,查询,受理",
    "requestTime": "20180409224736",
    "remark": "备注",
    "sign": "这个服务是否要求MD5签名",
    "businessType":"I",
    "attrs": [{
      "specCd": "配置的字段ID",
      "value": "具体值"
    }]
  },
  "business": {
    "businessTypeCd": "140300040001",
    "bId":"1234567892",
    "remark": "备注",
    "datas": {
      "businessOrgCommunityInfo": {
                "orgName":"填写具体值",
        "communityName":"填写具体值",
        "communityId":"填写具体值",
        "storeId":"填写具体值",
        "orgId":"填写具体值",
        "orgCommunityId":"填写具体值"
      }
    },
    "attrs": [{
      "specCd": "配置的字段ID",
      "value": "具体值"
    }]
  }
}
返回报文:
 {
    "orderTypeCd": "D",
    "response": {
        "code": "0000",
        "message": "成功"
    },
    "responseTime": "20190418102004",
    "bId": "202019041810750003",
    "businessType": "B",
    "transactionId": "3a5a411ec65a4c3f895935638aa1d2bc",
    "dataFlowId": "44fde86d39ce46f4b4aab5f6b14f3947"
}
```
java110-bean/src/main/java/com/java110/dto/community/CommunityDto.java
@@ -20,6 +20,7 @@
    private String cityCode;
    private String name;
    private String communityId;
    private String[] notInCommunityId;
    private String mapY;
    private String mapX;
    private String memberId;
@@ -147,4 +148,12 @@
    public void setAuditStatusCd(String auditStatusCd) {
        this.auditStatusCd = auditStatusCd;
    }
    public String[] getNotInCommunityId() {
        return notInCommunityId;
    }
    public void setNotInCommunityId(String[] notInCommunityId) {
        this.notInCommunityId = notInCommunityId;
    }
}
java110-bean/src/main/java/com/java110/dto/org/OrgCommunityDto.java
New file
@@ -0,0 +1,95 @@
package com.java110.dto.org;
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 OrgCommunityDto extends PageDto implements Serializable {
    private String orgName;
    private String communityName;
    private String communityId;
    private String storeId;
    private String orgId;
    private String orgCommunityId;
    private Date createTime;
    private String statusCd = "0";
    public String getOrgName() {
        return orgName;
    }
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }
    public String getCommunityName() {
        return communityName;
    }
    public void setCommunityName(String communityName) {
        this.communityName = communityName;
    }
    public String getCommunityId() {
        return communityId;
    }
    public void setCommunityId(String communityId) {
        this.communityId = communityId;
    }
    public String getStoreId() {
        return storeId;
    }
    public void setStoreId(String storeId) {
        this.storeId = storeId;
    }
    public String getOrgId() {
        return orgId;
    }
    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }
    public String getOrgCommunityId() {
        return orgCommunityId;
    }
    public void setOrgCommunityId(String orgCommunityId) {
        this.orgCommunityId = orgCommunityId;
    }
    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;
    }
}
java110-bean/src/main/java/com/java110/vo/api/org/ApiOrgCommunityDataVo.java
New file
@@ -0,0 +1,53 @@
package com.java110.vo.api.org;
import java.io.Serializable;
public class ApiOrgCommunityDataVo implements Serializable {
    private String orgCommunityId;
    private String orgId;
    private String orgName;
    private String communityId;
    private String communityName;
    public String getOrgCommunityId() {
        return orgCommunityId;
    }
    public void setOrgCommunityId(String orgCommunityId) {
        this.orgCommunityId = orgCommunityId;
    }
    public String getOrgId() {
        return orgId;
    }
    public void setOrgId(String orgId) {
        this.orgId = orgId;
    }
    public String getOrgName() {
        return orgName;
    }
    public void setOrgName(String orgName) {
        this.orgName = orgName;
    }
    public String getCommunityId() {
        return communityId;
    }
    public void setCommunityId(String communityId) {
        this.communityId = communityId;
    }
    public String getCommunityName() {
        return communityName;
    }
    public void setCommunityName(String communityName) {
        this.communityName = communityName;
    }
}
java110-bean/src/main/java/com/java110/vo/api/org/ApiOrgCommunityVo.java
New file
@@ -0,0 +1,19 @@
package com.java110.vo.api.org;
import com.java110.vo.MorePageVo;
import java.io.Serializable;
import java.util.List;
public class ApiOrgCommunityVo extends MorePageVo implements Serializable {
    List<ApiOrgCommunityDataVo> orgCommunitys;
    public List<ApiOrgCommunityDataVo> getOrgCommunitys() {
        return orgCommunitys;
    }
    public void setOrgCommunitys(List<ApiOrgCommunityDataVo> orgCommunitys) {
        this.orgCommunitys = orgCommunitys;
    }
}
java110-code-generator/src/main/java/com/java110/OrgCommunityGeneratorApplication.java
New file
@@ -0,0 +1,92 @@
package com.java110;
import com.java110.code.Data;
import com.java110.code.GeneratorAbstractBussiness;
import com.java110.code.GeneratorDeleteInfoListener;
import com.java110.code.GeneratorDtoBean;
import com.java110.code.GeneratorIInnerServiceSMO;
import com.java110.code.GeneratorIServiceDaoListener;
import com.java110.code.GeneratorInnerServiceSMOImpl;
import com.java110.code.GeneratorSaveInfoListener;
import com.java110.code.GeneratorServiceDaoImplListener;
import com.java110.code.GeneratorServiceDaoImplMapperListener;
import com.java110.code.GeneratorUpdateInfoListener;
import java.util.HashMap;
import java.util.Map;
/**
 * Hello world!
 */
public class OrgCommunityGeneratorApplication {
    protected OrgCommunityGeneratorApplication() {
        // prevents calls from subclass
        throw new UnsupportedOperationException();
    }
    /**
     * 代码生成器 入口方法
     *  此处生成的mapper文件包含过程表和实例表的sql,所以要求两张表的特殊字段也要写上
     *   BusinessTypeCd
     * @param args 参数
     */
    public static void main(String[] args) {
        Data data = new Data();
        data.setId("orgCommunityId");
        data.setName("orgCommunity");
        data.setDesc("隶属小区");
        data.setShareParam("vId");
        data.setShareColumn("v_id");
        data.setNewBusinessTypeCd("BUSINESS_TYPE_SAVE_ORG_COMMUNITY");
        data.setUpdateBusinessTypeCd("BUSINESS_TYPE_UPDATE_ORG_COMMUNITY");
        data.setDeleteBusinessTypeCd("BUSINESS_TYPE_DELETE_ORG_COMMUNITY");
        data.setNewBusinessTypeCdValue("140300030001");
        data.setUpdateBusinessTypeCdValue("140300040001");
        data.setDeleteBusinessTypeCdValue("140300050001");
        data.setBusinessTableName("business_org_community");
        data.setTableName("u_org_community");
        Map<String, String> param = new HashMap<String, String>();
        param.put("orgCommunityId", "org_community_id");       //map的key为你自定义的字段名就是驼峰命名法的那个,value为数据库表的字段名
        param.put("orgId", "org_id");
        param.put("communityId", "community_id");
        param.put("storeId", "store_id");
        param.put("orgName", "org_name");
        param.put("communityName", "community_name");
        param.put("statusCd", "status_cd");
        param.put("operate", "operate");
        param.put("bId", "b_id");
        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);
    }
}
java110-core/src/main/java/com/java110/core/factory/GenerateCodeFactory.java
@@ -95,6 +95,7 @@
    public static final String CODE_PREFIX_repairId = "82";
    public static final String CODE_PREFIX_ruId = "83";
    public static final String CODE_PREFIX_orgId = "84";
    public static final String CODE_PREFIX_orgCommunityId = "85";
    public static final String CODE_PREFIX_relId = "84";
    public static final String CODE_PREFIX_resId = "85";
    public static final String CODE_PREFIX_auditUserId = "86";
java110-core/src/main/java/com/java110/core/smo/org/IOrgCommunityInnerServiceSMO.java
New file
@@ -0,0 +1,41 @@
package com.java110.core.smo.org;
import com.java110.core.feign.FeignConfiguration;
import com.java110.dto.org.OrgCommunityDto;
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 IOrgCommunityInnerServiceSMO
 * @Description 隶属小区接口类
 * @Author wuxw
 * @Date 2019/4/24 9:04
 * @Version 1.0
 * add by wuxw 2019/4/24
 **/
@FeignClient(name = "user-service", configuration = {FeignConfiguration.class})
@RequestMapping("/orgCommunityApi")
public interface IOrgCommunityInnerServiceSMO {
    /**
     * <p>查询小区楼信息</p>
     *
     * @param orgCommunityDto 数据对象分享
     * @return OrgCommunityDto 对象数据
     */
    @RequestMapping(value = "/queryOrgCommunitys", method = RequestMethod.POST)
    List<OrgCommunityDto> queryOrgCommunitys(@RequestBody OrgCommunityDto orgCommunityDto);
    /**
     * 查询<p>小区楼</p>总记录数
     *
     * @param orgCommunityDto 数据对象分享
     * @return 小区下的小区楼记录数
     */
    @RequestMapping(value = "/queryOrgCommunitysCount", method = RequestMethod.POST)
    int queryOrgCommunitysCount(@RequestBody OrgCommunityDto orgCommunityDto);
}
java110-db/db/UserService/create_organization.sql
@@ -23,6 +23,19 @@
    operate VARCHAR(3) NOT NULL COMMENT '数据状态,添加ADD,修改MOD 删除DEL'
);
-- 组织部门
create table business_org_community(
    org_community_id VARCHAR(30) NOT NULL COMMENT '组织ID',
    org_id VARCHAR(30) NOT NULL COMMENT '组织ID',
    community_id VARCHAR(30) NOT NULL COMMENT '小区ID',
    community_name VARCHAR(30) NOT NULL COMMENT '小区名称',
    b_id VARCHAR(30) NOT NULL COMMENT '业务Id',
    store_id varchar(30) not null comment '商户ID',
    org_name varchar(200) not null comment '组织名称',
    create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    operate VARCHAR(3) NOT NULL COMMENT '数据状态,添加ADD,修改MOD 删除DEL'
);
create table u_org(
    org_id VARCHAR(30) NOT NULL COMMENT '组织ID',
    b_id VARCHAR(30) NOT NULL COMMENT '业务Id',
@@ -46,3 +59,16 @@
    create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    status_cd VARCHAR(2) NOT NULL default '0' COMMENT '数据状态,详细参考c_status表,0在用,1失效'
);
-- 组织部门
create table u_org_community(
    org_community_id VARCHAR(30) NOT NULL COMMENT '组织ID',
    org_id VARCHAR(30) NOT NULL COMMENT '组织ID',
    community_id VARCHAR(30) NOT NULL COMMENT '小区ID',
    community_name VARCHAR(30) NOT NULL COMMENT '小区名称',
    b_id VARCHAR(30) NOT NULL COMMENT '业务Id',
    store_id varchar(30) not null comment '商户ID',
    org_name varchar(200) not null comment '组织名称',
    create_time TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '创建时间',
    status_cd VARCHAR(2) NOT NULL default '0' COMMENT '数据状态,详细参考c_status表,0在用,1失效'
);
java110-db/src/main/resources/mapper/center/PrivilegeDAOImplMapper.xml
@@ -26,6 +26,26 @@
        INSERT INTO p_privilege_group(pg_id,`name`,description,store_id,domain)
        VALUES(#{pgId},#{name},#{description},#{storeId},#{storeTypeCd})
    </insert>
    <update id="updatePrivilegeGroup" parameterType="Map">
        UPDATE p_privilege_group a SET
        <if test="name != null and name != ''">
             a.name = #{name},
        </if>
        <if test="description != null and description != ''">
             a.description = #{description}
        </if>
        WHERE 1= 1
        <if test="storeId != null and storeId != ''">
            and a.store_id = #{storeId}
        </if>
        and a.pg_id = #{pgId}
        <if test="storeTypeCd != null and storeTypeCd != ''">
            and a.domain= #{storeTypeCd}
        </if>
    </update>
    <!-- 删除权限组 -->
    <update id="deletePrivilegeGroup" parameterType="Map">
        UPDATE p_privilege_group a SET a.`status_cd` = '1'
java110-db/src/main/resources/mapper/community/CommunityServiceDaoImplMapper.xml
@@ -472,6 +472,12 @@
        <if test="memberId !=null and memberId !='' and auditStatusCd != null and auditStatusCd !=''">
            and cm.audit_status_cd = #{auditStatusCd}
        </if>
        <if test="notInCommunityId != null ">
            and t.community_id not in
            <foreach collection="notInCommunityId" item="item" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="page != -1 and page != null ">
            limit #{page}, #{row}
        </if>
@@ -506,6 +512,12 @@
        <if test="communityId !=null and communityId != ''">
            and t.community_id= #{communityId}
        </if>
        <if test="communityIds !=null">
            and t.community_id in
            <foreach collection="communityIds" item="item" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
        <if test="bId !=null and bId != ''">
            and t.b_id= #{bId}
        </if>
@@ -523,6 +535,15 @@
                and cm.member_id = #{memberId}
                and cm.status_cd = '0'
        </if>
        <if test="memberId !=null and memberId !='' and auditStatusCd != null and auditStatusCd !=''">
            and cm.audit_status_cd = #{auditStatusCd}
        </if>
        <if test="notInCommunityId != null ">
            and t.community_id not in
            <foreach collection="notInCommunityId" item="item" open="(" close=")" separator=",">
                #{item}
            </foreach>
        </if>
    </select>
java110-db/src/main/resources/mapper/user/OrgCommunityServiceDaoImplMapper.xml
New file
@@ -0,0 +1,187 @@
<?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="orgCommunityServiceDaoImpl">
    <!-- 保存隶属小区信息 add by wuxw 2018-07-03 -->
       <insert id="saveBusinessOrgCommunityInfo" parameterType="Map">
           insert into business_org_community(
org_name,operate,community_name,community_id,store_id,b_id,org_id,org_community_id
) values (
#{orgName},#{operate},#{communityName},#{communityId},#{storeId},#{bId},#{orgId},#{orgCommunityId}
)
       </insert>
       <!-- 查询隶属小区信息(Business) add by wuxw 2018-07-03 -->
       <select id="getBusinessOrgCommunityInfo" parameterType="Map" resultType="Map">
           select  t.org_name,t.org_name orgName,t.operate,t.community_name,t.community_name communityName,t.community_id,t.community_id communityId,t.store_id,t.store_id storeId,t.b_id,t.b_id bId,t.org_id,t.org_id orgId,t.org_community_id,t.org_community_id orgCommunityId
from business_org_community t
where 1 =1
<if test="orgName !=null and orgName != ''">
   and t.org_name= #{orgName}
</if>
<if test="operate !=null and operate != ''">
   and t.operate= #{operate}
</if>
<if test="communityName !=null and communityName != ''">
   and t.community_name= #{communityName}
</if>
<if test="communityId !=null and communityId != ''">
   and t.community_id= #{communityId}
</if>
<if test="storeId !=null and storeId != ''">
   and t.store_id= #{storeId}
</if>
<if test="bId !=null and bId != ''">
   and t.b_id= #{bId}
</if>
<if test="orgId !=null and orgId != ''">
   and t.org_id= #{orgId}
</if>
<if test="orgCommunityId !=null and orgCommunityId != ''">
   and t.org_community_id= #{orgCommunityId}
</if>
       </select>
    <!-- 保存隶属小区信息至 instance表中 add by wuxw 2018-07-03 -->
    <insert id="saveOrgCommunityInfoInstance" parameterType="Map">
        insert into u_org_community(
org_name,community_name,status_cd,community_id,store_id,b_id,org_id,org_community_id
) select t.org_name,t.community_name,'0',t.community_id,t.store_id,t.b_id,t.org_id,t.org_community_id from business_org_community t where 1=1
<if test="orgName !=null and orgName != ''">
   and t.org_name= #{orgName}
</if>
   and t.operate= 'ADD'
<if test="communityName !=null and communityName != ''">
   and t.community_name= #{communityName}
</if>
<if test="communityId !=null and communityId != ''">
   and t.community_id= #{communityId}
</if>
<if test="storeId !=null and storeId != ''">
   and t.store_id= #{storeId}
</if>
<if test="bId !=null and bId != ''">
   and t.b_id= #{bId}
</if>
<if test="orgId !=null and orgId != ''">
   and t.org_id= #{orgId}
</if>
<if test="orgCommunityId !=null and orgCommunityId != ''">
   and t.org_community_id= #{orgCommunityId}
</if>
    </insert>
    <!-- 查询隶属小区信息 add by wuxw 2018-07-03 -->
    <select id="getOrgCommunityInfo" parameterType="Map" resultType="Map">
        select  t.org_name,t.org_name orgName,t.community_name,t.community_name communityName,t.status_cd,t.status_cd statusCd,t.community_id,t.community_id communityId,t.store_id,t.store_id storeId,t.b_id,t.b_id bId,t.org_id,t.org_id orgId,t.org_community_id,t.org_community_id orgCommunityId
from u_org_community t
where 1 =1
<if test="orgName !=null and orgName != ''">
   and t.org_name= #{orgName}
</if>
<if test="communityName !=null and communityName != ''">
   and t.community_name= #{communityName}
</if>
<if test="statusCd !=null and statusCd != ''">
   and t.status_cd= #{statusCd}
</if>
<if test="communityId !=null and communityId != ''">
   and t.community_id= #{communityId}
</if>
<if test="storeId !=null and storeId != ''">
   and t.store_id= #{storeId}
</if>
<if test="bId !=null and bId != ''">
   and t.b_id= #{bId}
</if>
<if test="orgId !=null and orgId != ''">
   and t.org_id= #{orgId}
</if>
<if test="orgCommunityId !=null and orgCommunityId != ''">
   and t.org_community_id= #{orgCommunityId}
</if>
order by t.create_time desc
<if test="page != -1 and page != null ">
   limit #{page}, #{row}
</if>
    </select>
    <!-- 修改隶属小区信息 add by wuxw 2018-07-03 -->
    <update id="updateOrgCommunityInfoInstance" parameterType="Map">
        update  u_org_community t set t.status_cd = #{statusCd}
<if test="newBId != null and newBId != ''">
,t.b_id = #{newBId}
</if>
<if test="orgName !=null and orgName != ''">
, t.org_name= #{orgName}
</if>
<if test="communityName !=null and communityName != ''">
, t.community_name= #{communityName}
</if>
<if test="communityId !=null and communityId != ''">
, t.community_id= #{communityId}
</if>
<if test="storeId !=null and storeId != ''">
, t.store_id= #{storeId}
</if>
<if test="orgId !=null and orgId != ''">
, t.org_id= #{orgId}
</if>
 where 1=1 <if test="bId !=null and bId != ''">
and t.b_id= #{bId}
</if>
<if test="orgCommunityId !=null and orgCommunityId != ''">
and t.org_community_id= #{orgCommunityId}
</if>
    </update>
    <!-- 查询隶属小区数量 add by wuxw 2018-07-03 -->
     <select id="queryOrgCommunitysCount" parameterType="Map" resultType="Map">
        select  count(1) count
from u_org_community t
where 1 =1
<if test="orgName !=null and orgName != ''">
   and t.org_name= #{orgName}
</if>
<if test="communityName !=null and communityName != ''">
   and t.community_name= #{communityName}
</if>
<if test="statusCd !=null and statusCd != ''">
   and t.status_cd= #{statusCd}
</if>
<if test="communityId !=null and communityId != ''">
   and t.community_id= #{communityId}
</if>
<if test="storeId !=null and storeId != ''">
   and t.store_id= #{storeId}
</if>
<if test="bId !=null and bId != ''">
   and t.b_id= #{bId}
</if>
<if test="orgId !=null and orgId != ''">
   and t.org_id= #{orgId}
</if>
<if test="orgCommunityId !=null and orgCommunityId != ''">
   and t.org_community_id= #{orgCommunityId}
</if>
     </select>
</mapper>
java110-utils/src/main/java/com/java110/utils/constant/BusinessTypeConstant.java
@@ -577,6 +577,18 @@
    public static final String BUSINESS_TYPE_DELETE_ORG_STAFF_REL ="140200050001";
    /**
     *  保存员工组织关系
     * 14开头  3保存
     */
    public static final String BUSINESS_TYPE_SAVE_ORG_COMMUNITY="140300030001";
    public static final String BUSINESS_TYPE_UPDATE_ORG_COMMUNITY="140300040001";
    /**
     *  删除员工组织关系
     */
    public static final String BUSINESS_TYPE_DELETE_ORG_COMMUNITY ="140300050001";
    /**
     *  保存 资源
     * 14开头  3保存
     */
java110-utils/src/main/java/com/java110/utils/constant/ServiceCodeOrgConstant.java
@@ -27,10 +27,35 @@
     */
    public static final String LIST_ORGS = "org.listOrgs";
    /**
     * 查询 上级组织管理
     */
    public static final String LIST_PARENT_ORGS = "org.listParentOrgs";
    /**
     * 查询 组织管理
     */
    public static final String LIST_ORG_COMMUNITYS = "org.listOrgCommunitys";
    /**
     * 查询 组织未隶属小区
     */
    public static final String LIST_ORG_NO_COMMUNITYS = "org.listOrgNoCommunitys";
    /**
     * 添加 组织管理
     */
    public static final String ADD_ORG_COMMUNITY = "org.saveOrgCommunity";
    /**
     * 删除 组织管理
     */
    public static final String DELETE_ORG_COMMUNITY = "org.deleteOrgCommunity";
}
java110-utils/src/main/java/com/java110/utils/util/Assert.java
@@ -249,6 +249,7 @@
    /**
     * 检验是否在 infos 中存在 flowComponent 对应组件的key
     *
     * @param infos
     * @param flowComponent
     * @param key
@@ -307,4 +308,18 @@
    }
    /**
     * 检验是否在 infos 中存在 flowComponent 对应组件的key
     *
     * @param key
     * @param message
     */
    public static void isEmail(JSONObject info, String key, String message) {
        hasKeyAndValue(info, key, message);
        if (!ValidatorUtil.isEmail(info.getString(key))) {
            throw new IllegalArgumentException(message);
        }
    }
}