WebIndexController.java 3.85 KB
package com.lhcredit.project.webbusiness.controller;

import com.lhcredit.framework.web.domain.AjaxResult;
import com.lhcredit.project.business.BasicInformation.service.BasicInformationService;
import com.lhcredit.project.business.TianYC.entity.param.RequestParams;
import com.lhcredit.project.business.judicial.service.JudicialService;
import com.lhcredit.project.business.jycount.domain.Jycount;
import com.lhcredit.project.business.jycount.service.IJycountService;
import com.lhcredit.project.business.memberUnit.service.IMemberUnitService;
import com.lhcredit.project.business.organization.domain.Organization;
import com.lhcredit.project.business.organization.service.IOrganizationService;
import com.lhcredit.project.business.sfcount.domain.Sfcount;
import com.lhcredit.project.business.sfcount.service.ISfcountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Controller
@RequestMapping("/web/index")
public class WebIndexController {
    @Autowired
    IMemberUnitService memberUnitService;

    @Autowired
    IOrganizationService organizationService;

    @Autowired
    BasicInformationService basicInformationService;

    @Autowired
    private JudicialService judicialService;

    @Autowired
    private ISfcountService sfcountService;

    @Autowired
    private IJycountService jycountService;

    @RequestMapping("/baseinfo")
    @ResponseBody
    public AjaxResult baseinfo() {
        Map respData = new HashMap();
        List<Map> listLevel= organizationService.selectAllOrganizationGroupLevel();
        if(!listLevel.contains("D")){
            Map resp = new HashMap();
            resp.put("creditLevel","D");
            resp.put("count",0);
            listLevel.add(resp);
        }
        respData.put("level",listLevel);

        List<Map> listreg = organizationService.selectAllOrganizationGroupReg();
        respData.put("RegistCapi",listreg);

        List<Map> listOrgType=organizationService.selectAllOrganizationGroupOrgTyp();
        respData.put("OrgType",listOrgType);

        List<Map> listScopeType=organizationService.selectAllOrganizationGroupScopeTyp();
        respData.put("ScopeType",listScopeType);

        int orgCount=organizationService.selectAllOrganizationCount();
        respData.put("orgCount",orgCount);
        int memberCount=memberUnitService.selectMemberUnitCount();
        respData.put("memberCount",memberCount);

        return AjaxResult.success(respData);
    }

    @RequestMapping("/getJudiciary")
    @ResponseBody
    public AjaxResult getJudiciary() {
        Map respData = new HashMap();
        Sfcount sf=new Sfcount();
        sf.setStatus("0");
        List<Sfcount> list=sfcountService.selectSfcountList(sf);
        int count=0;
        for(Sfcount sfcount:list){
            count+=sfcount.getMs()+sfcount.getXs()+sfcount.getXz()+sfcount.getFsbq()+sfcount.getZx()+sfcount.getPc();
        }
        respData.put("sfNum",count);
        respData.put("SfcountList",list);

        return AjaxResult.success(respData);
    }

    @RequestMapping("/getOperate")
    @ResponseBody
    public AjaxResult getOperate() {
        Map respData = new HashMap();
        Jycount jy=new Jycount();
        jy.setStatus("0");
        List<Jycount> list=jycountService.selectJycountList(jy);
        int count=0;
        for(Jycount jycount:list){
            count+=jycount.getJyyc()+jycount.getXzcf()+jycount.getYzwf()+jycount.getGqcz()+jycount.getGqdj()+jycount.getQsgg()+jycount.getQsxx()+jycount.getTddy()+jycount.getCcjc();
        }
        respData.put("jyNum",count);
        respData.put("jycountList",list);
        return AjaxResult.success(respData);
    }


}