wuxw
2020-02-19 ac50588df7c5d7800c43c181a16ff6cd9c29db1e
加入小区审核撤回功能
4个文件已修改
3个文件已添加
205 ■■■■ 已修改文件
WebService/src/main/java/com/java110/web/components/community/RecallAuditCommunityComponent.java 46 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/smo/impl/NavServiceSMOImpl.java 44 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/communityPackage/community-manage/communityManage.html 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/communityPackage/community-manage/communityManage.js 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/communityPackage/recallAuditFinishCommunity/recallAuditFinishCommunity.html 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/resources/components/communityPackage/recallAuditFinishCommunity/recallAuditFinishCommunity.js 56 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
java110-utils/src/main/java/com/java110/utils/util/StringUtil.java 26 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
WebService/src/main/java/com/java110/web/components/community/RecallAuditCommunityComponent.java
New file
@@ -0,0 +1,46 @@
package com.java110.web.components.community;
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.community.IAuditCommunitySMO;
import com.java110.web.smo.community.IListCommunitysSMO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Component;
/**
 * 小区审核
 * <p>
 * add by wuxw
 * <p>
 * 2019-06-29
 */
@Component("recallAuditCommunity")
public class RecallAuditCommunityComponent {
    @Autowired
    private IAuditCommunitySMO auditCommunitySMOImpl;
    /**
     * 审核 小区
     *
     * @param pd 页面数据封装
     * @return 返回 ResponseEntity 对象
     */
    public ResponseEntity<String> recall(IPageData pd) {
        return auditCommunitySMOImpl.auditCommunity(pd);
    }
    public IAuditCommunitySMO getAuditCommunitySMOImpl() {
        return auditCommunitySMOImpl;
    }
    public void setAuditCommunitySMOImpl(IAuditCommunitySMO auditCommunitySMOImpl) {
        this.auditCommunitySMOImpl = auditCommunitySMOImpl;
    }
}
WebService/src/main/java/com/java110/web/smo/impl/NavServiceSMOImpl.java
@@ -7,6 +7,7 @@
import com.java110.utils.util.CommonUtil;
import com.java110.core.context.IPageData;
import com.java110.core.component.BaseComponentSMO;
import com.java110.utils.util.StringUtil;
import com.java110.web.smo.ICommunityServiceSMO;
import com.java110.web.smo.INavServiceSMO;
import org.slf4j.Logger;
@@ -60,34 +61,27 @@
    @Override
    public ResponseEntity<String> getUserInfo(IPageData pd) {
        Assert.hasLength(pd.getUserId(), "用户未登录请先登录");
        /*ResponseEntity<String> responseEntity = null;
        responseEntity = this.callCenterService(restTemplate,pd,"",
        ServiceConstant.SERVICE_API_URL+"/api/query.user.userInfo?userId="+pd.getUserId(), HttpMethod.GET);
        // 过滤返回报文中的字段,只返回name字段
        //{"address":"","orderTypeCd":"Q","serviceCode":"","responseTime":"20190401194712","sex":"",
        "localtionCd":"","userId":"302019033054910001","levelCd":"00","transactionId":"-1","dataFlowId":"-1",
        "response":{"code":"0000","message":"成功"},"name":"996icu","tel":"18909780341","bId":"-1","businessType":"","email":""}
        if(responseEntity.getStatusCode() == HttpStatus.OK){
            JSONObject tmpUserInfo = JSONObject.parseObject(responseEntity.getBody().toString());
            JSONObject resultUserInfo = new JSONObject();
            resultUserInfo.put("name",tmpUserInfo.getString("name"));
            responseEntity = new ResponseEntity<String>(resultUserInfo.toJSONString(),HttpStatus.OK);
        }*/
        ResponseEntity<String> responseEntity = null;
        responseEntity = super.getUserInfo(pd, restTemplate);
        if (responseEntity.getStatusCode() == HttpStatus.OK) {
            JSONObject tmpUserInfo = JSONObject.parseObject(responseEntity.getBody().toString());
            JSONObject resultUserInfo = new JSONObject();
            resultUserInfo.put("name", tmpUserInfo.getString("name"));
            resultUserInfo.put("address", tmpUserInfo.getString("address"));
            resultUserInfo.put("sex", tmpUserInfo.getString("sex"));
            resultUserInfo.put("localtionCd", tmpUserInfo.getString("localtionCd"));
            resultUserInfo.put("levelCd", tmpUserInfo.getString("levelCd"));
            resultUserInfo.put("tel", CommonUtil.mobileEncrypt(tmpUserInfo.getString("tel")));
            resultUserInfo.put("email", tmpUserInfo.getString("email"));
            responseEntity = new ResponseEntity<String>(resultUserInfo.toJSONString(), HttpStatus.OK);
        if (responseEntity.getStatusCode() != HttpStatus.OK) {
            return responseEntity;
        }
        JSONObject tmpUserInfo = JSONObject.parseObject(responseEntity.getBody().toString());
        JSONObject resultUserInfo = new JSONObject();
        responseEntity = super.getStoreInfo(pd, restTemplate);
        if (responseEntity.getStatusCode() == HttpStatus.OK && StringUtil.jsonHasKayAndValue(responseEntity.getBody().toString(),"storeTypeCd")) {
            String storeTypeCd = JSONObject.parseObject(responseEntity.getBody().toString()).getString("storeTypeCd");
            resultUserInfo.put("storeTypeCd", storeTypeCd);
        }
        resultUserInfo.put("name", tmpUserInfo.getString("name"));
        resultUserInfo.put("address", tmpUserInfo.getString("address"));
        resultUserInfo.put("sex", tmpUserInfo.getString("sex"));
        resultUserInfo.put("localtionCd", tmpUserInfo.getString("localtionCd"));
        resultUserInfo.put("levelCd", tmpUserInfo.getString("levelCd"));
        resultUserInfo.put("tel", CommonUtil.mobileEncrypt(tmpUserInfo.getString("tel")));
        resultUserInfo.put("email", tmpUserInfo.getString("email"));
        responseEntity = new ResponseEntity<String>(resultUserInfo.toJSONString(), HttpStatus.OK);
        return responseEntity;
    }
WebService/src/main/resources/components/communityPackage/community-manage/communityManage.html
@@ -36,13 +36,13 @@
                            <td>
                                <div class="btn-group">
                                    <button class="btn-white btn btn-xs"
                                            v-bind:disabled="community.state == '1100'"
                                            v-bind:disabled="community.state == '1100' && storeTypeCd != '800900000001'"
                                            v-on:click="_openEditCommunityModel(community)">修改
                                    </button>
                                </div>
                                <!-- <div class="btn-group">
                                     <button class="btn-white btn btn-xs" v-on:click="_openDeleteCommunityModel(community)">删除</button>
                                 </div></td>-->
                                 <div class="btn-group" v-if="community.state != '1000' && storeTypeCd == '800900000001'">
                                     <button class="btn-white btn btn-xs" v-on:click="_openRecallCommunityModel(community)">审核撤回</button>
                                 </div></td>
                        </tr>
                        </tbody>
WebService/src/main/resources/components/communityPackage/community-manage/communityManage.js
@@ -9,7 +9,8 @@
            communityManageInfo:{
                communitys:[],
                total:0,
                records:1
                records:1,
                storeTypeCd:vc.getData('/nav/getUserInfo').storeTypeCd
            }
        },
        _initMethod:function(){
@@ -58,6 +59,9 @@
            },
            _openDeleteCommunityModel:function(_community){
                vc.emit('deleteCommunity','openDeleteCommunityModal',_community);
            },
            _openRecallCommunityModel:function(_community){
                vc.emit('recallAuditFinishCommunity','openRecallAuditFinishCommunityModal',_community);
            }
        }
    });
WebService/src/main/resources/components/communityPackage/recallAuditFinishCommunity/recallAuditFinishCommunity.html
New file
@@ -0,0 +1,19 @@
<div class="modal fade" id="recallAuditFinishCommunityModel" 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="closeRecallAuditFinishCommunityModel()">点错了</button>
                <button type="button" class="btn btn-primary" v-on:click="recallAuditFinishCommunity()">确认撤回</button>
            </div>
        </div>
    </div>
</div>
WebService/src/main/resources/components/communityPackage/recallAuditFinishCommunity/recallAuditFinishCommunity.js
New file
@@ -0,0 +1,56 @@
(function(vc,vm){
    vc.extends({
        data:{
            recallAuditFinishCommunityInfo:{
            }
        },
         _initMethod:function(){
         },
         _initEvent:function(){
             vc.on('recallAuditFinishCommunity','openRecallAuditFinishCommunityModal',function(_params){
                vc.component.recallAuditFinishCommunityInfo = _params;
                $('#recallAuditFinishCommunityModel').modal('show');
            });
        },
        methods:{
            recallAuditFinishCommunity:function(){
                var _paramObj = {
                    communityId:vc.component.recallAuditFinishCommunityInfo.communityId,
                    state:'1000',
                    remark:'撤回审核'
                };
                vc.http.post(
                    'recallAuditFinishCommunity',
                    'recall',
                    JSON.stringify(_paramObj),
                    {
                        emulateJSON:true
                     },
                     function(json,res){
                        //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
                        if(res.status == 200){
                            //关闭model
                            $('#recallAuditFinishCommunityModel').modal('hide');
                            vc.emit('communityManage','listCommunity',{});
                            return ;
                        }
                        vc.message(json);
                     },
                     function(errInfo,error){
                        console.log('请求失败处理');
                        vc.message(json);
                     });
            },
            closeRecallAuditFinishCommunityModel:function(){
                $('#recallAuditFinishCommunityModel').modal('hide');
            }
        }
    });
})(window.vc,window.vc.component);
java110-utils/src/main/java/com/java110/utils/util/StringUtil.java
@@ -486,23 +486,41 @@
    /**
     * json是否包含key 并且存在值
     *
     * @param param
     * @param key
     * @return
     */
    public static boolean jsonHasKayAndValue(JSONObject param,String key){
        if(param == null){
    public static boolean jsonHasKayAndValue(JSONObject param, String key) {
        if (param == null) {
            return false;
        }
        if(!param.containsKey(key)){
        if (!param.containsKey(key)) {
            return false;
        }
        if(isEmpty(param.getString(key))){
        if (isEmpty(param.getString(key))) {
            return false;
        }
        return true;
    }
    /**
     * json是否包含key 并且存在值
     *
     * @param param
     * @param key
     * @return
     */
    public static boolean jsonHasKayAndValue(String param, String key) {
        JSONObject paramObj = null;
        try {
            paramObj = JSONObject.parseObject(param);
            return jsonHasKayAndValue(paramObj, key);
        } catch (Exception e) {
            return false;
        }
    }
}