wuxw лет назад: 6
Родитель
Сommit
ec86d036d7
17 измененных файлов с 250 добавлено и 31 удалено
  1. 23 4
      Api/src/main/java/com/java110/api/listener/community/ListMyEnteredCommunitysListener.java
  2. 4 2
      Api/src/main/java/com/java110/api/listener/org/ListOrgNoCommunitysListener.java
  3. 2 1
      Api/src/main/java/com/java110/api/listener/org/SaveOrgListener.java
  4. 1 1
      Api/src/main/java/com/java110/api/listener/org/UpdateOrgListener.java
  5. 0 1
      WebService/src/main/java/com/java110/web/smo/org/impl/AddOrgSMOImpl.java
  6. 0 2
      WebService/src/main/java/com/java110/web/smo/org/impl/EditOrgSMOImpl.java
  7. 0 12
      WebService/src/main/resources/components/orgPackage/add-org/addOrg.js
  8. 4 1
      WebService/src/main/resources/components/orgPackage/addOrgCommunity/addOrgCommunity.html
  9. 8 0
      WebService/src/main/resources/components/orgPackage/addOrgCommunity/addOrgCommunity.js
  10. 1 1
      WebService/src/main/resources/components/orgPackage/deleteOrgCommunity/deleteOrgCommunity.js
  11. 4 3
      WebService/src/main/resources/components/orgPackage/org-manage/orgManage.html
  12. 1 1
      WebService/src/main/resources/components/orgPackage/orgCommunityManage/orgCommunityManage.html
  13. 0 0
      WebService/src/main/resources/components/paginationPackage/pagination/pagination.html
  14. 0 0
      WebService/src/main/resources/components/paginationPackage/pagination/pagination.js
  15. 20 0
      WebService/src/main/resources/components/paginationPackage/paginationPlus/paginationPlus.html
  16. 171 0
      WebService/src/main/resources/components/paginationPackage/paginationPlus/paginationPlus.js
  17. 11 2
      java110-db/src/main/resources/mapper/community/CommunityServiceDaoImplMapper.xml

+ 23 - 4
Api/src/main/java/com/java110/api/listener/community/ListMyEnteredCommunitysListener.java

@@ -5,9 +5,11 @@ 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.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;
@@ -38,6 +40,9 @@ public class ListMyEnteredCommunitysListener extends AbstractServiceApiListener
     @Autowired
     private IOrgStaffRelInnerServiceSMO orgStaffRelInnerServiceSMOImpl;
 
+    @Autowired
+    private IOrgCommunityInnerServiceSMO orgCommunityInnerServiceSMOImpl;
+
     @Autowired
     private IOrgInnerServiceSMO orgInnerServiceSMOImpl;
 
@@ -92,6 +97,7 @@ public class ListMyEnteredCommunitysListener extends AbstractServiceApiListener
         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 @@ public class ListMyEnteredCommunitysListener extends AbstractServiceApiListener
                 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<>();
+            }
         }
 
 

+ 4 - 2
Api/src/main/java/com/java110/api/listener/org/ListOrgNoCommunitysListener.java

@@ -72,8 +72,10 @@ public class ListOrgNoCommunitysListener extends AbstractServiceApiListener {
         for(OrgCommunityDto tmpOrgCommunityDto : orgCommunityDtos){
             communityIds.add(tmpOrgCommunityDto.getCommunityId());
         }
-        CommunityDto communityDto = new CommunityDto();
-        communityDto.setNotInCommunityId(communityIds.toArray(new String[communityIds.size()]));
+        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);

+ 2 - 1
Api/src/main/java/com/java110/api/listener/org/SaveOrgListener.java

@@ -31,7 +31,7 @@ public class SaveOrgListener extends AbstractServiceApiListener {
         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 @@ public class SaveOrgListener extends AbstractServiceApiListener {
         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;

+ 1 - 1
Api/src/main/java/com/java110/api/listener/org/UpdateOrgListener.java

@@ -38,7 +38,6 @@ public class UpdateOrgListener extends AbstractServiceApiListener {
         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 @@ public class UpdateOrgListener extends AbstractServiceApiListener {
         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;

+ 0 - 1
WebService/src/main/java/com/java110/web/smo/org/impl/AddOrgSMOImpl.java

@@ -34,7 +34,6 @@ public class AddOrgSMOImpl extends AbstractComponentSMO implements IAddOrgSMO {
         Assert.hasKeyAndValue(paramIn, "orgName", "必填,请填写组织名称");
         Assert.hasKeyAndValue(paramIn, "orgLevel", "必填,请填写报修人名称");
         Assert.hasKeyAndValue(paramIn, "parentOrgId", "必填,请选择上级ID");
-        Assert.hasKeyAndValue(paramIn, "belongCommunityId", "必填,请选择隶属小区");
         //Assert.hasKeyAndValue(paramIn, "description", "必填,请填写描述");
 
 

+ 0 - 2
WebService/src/main/java/com/java110/web/smo/org/impl/EditOrgSMOImpl.java

@@ -33,8 +33,6 @@ public class EditOrgSMOImpl extends AbstractComponentSMO implements IEditOrgSMO
         Assert.hasKeyAndValue(paramIn, "orgName", "必填,请填写组织名称");
         Assert.hasKeyAndValue(paramIn, "orgLevel", "必填,请填写报修人名称");
         Assert.hasKeyAndValue(paramIn, "parentOrgId", "必填,请选择上级ID");
-        Assert.hasKeyAndValue(paramIn, "belongCommunityId", "必填,请选择隶属小区");
-
         //Assert.hasKeyAndValue(paramIn, "description", "必填,请填写描述");
 
 

+ 0 - 12
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': [
 
                         {

+ 4 - 1
WebService/src/main/resources/components/orgPackage/addOrgCommunity/addOrgCommunity.html

@@ -53,7 +53,10 @@
                                     </tr>
                                     </tbody>
                                 </table>
-                                <div class="ibox-content">
+                                <!-- 分页 -->
+                                <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>

+ 8 - 0
WebService/src/main/resources/components/orgPackage/addOrgCommunity/addOrgCommunity.js

@@ -34,6 +34,10 @@
                 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){
@@ -53,6 +57,10 @@
                              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('请求失败处理');
                              }

+ 1 - 1
WebService/src/main/resources/components/orgPackage/deleteOrgCommunity/deleteOrgCommunity.js

@@ -32,7 +32,7 @@
                         if(res.status == 200){
                             //关闭model
                             $('#deleteOrgCommunityModel').modal('hide');
-                            vc.emit('orgCommunityManage','listOrgCommunity',{});
+                            vc.emit('orgCommunityManageInfo','listOrgCommunity',{});
                             return ;
                         }
                         vc.message(json);

+ 4 - 3
WebService/src/main/resources/components/orgPackage/org-manage/orgManage.html

@@ -83,8 +83,9 @@
                                     <td class="text-center">{{org.orgLevelName}}</td>
                                     <td class="text-center">{{org.orgLevel == 1 ? '无' : org.parentOrgName}}</td>
                                     <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)">
                                                 修改
@@ -95,7 +96,7 @@
                                                 删除
                                             </button>
                                         </div>
-                                        <div class="btn-group" v-if="org.orgLevel == 2">
+                                        <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>

+ 1 - 1
WebService/src/main/resources/components/orgPackage/orgCommunityManage/orgCommunityManage.html

@@ -35,7 +35,7 @@
                         <td class="text-center">{{orgCommunity.communityId}}</td>
                         <td class="text-center">{{orgCommunity.communityName}}</td>
                         <td class="text-right">
-                            <div class="btn-group" v-if="orgCommunity.allowOperation == 'T'">
+                            <div class="btn-group">
                                 <button class="btn-white btn btn-xs"
                                         v-on:click="_openDeleteOrgCommunityModel(orgCommunity)">
                                     删除

WebService/src/main/resources/components/paginationPackage/pagination.html → WebService/src/main/resources/components/paginationPackage/pagination/pagination.html


WebService/src/main/resources/components/paginationPackage/pagination.js → WebService/src/main/resources/components/paginationPackage/pagination/pagination.js


+ 20 - 0
WebService/src/main/resources/components/paginationPackage/paginationPlus/paginationPlus.html

@@ -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>

+ 171 - 0
WebService/src/main/resources/components/paginationPackage/paginationPlus/paginationPlus.js

@@ -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);

+ 11 - 2
java110-db/src/main/resources/mapper/community/CommunityServiceDaoImplMapper.xml

@@ -512,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>
@@ -526,8 +532,11 @@
         </if>
         <if test="memberId !=null and memberId !=''">
             and cm.community_id = t.community_id
-                and cm.member_id = #{memberId}
-                and cm.status_cd = '0'
+            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