package cn.com.countrygarden.bi.main.service.districtReport.impl;

import cn.com.countrygarden.bi.main.core.Response;
import cn.com.countrygarden.bi.main.core.Result;
import cn.com.countrygarden.bi.main.dao.districtReport.RdDistrictInfoMapper;
import cn.com.countrygarden.bi.main.dao.districtReport.RdUncollectedBuildingProjectsMapper;
import cn.com.countrygarden.bi.main.dao.twerp.hm.ManagerMapForErpMapper;
import cn.com.countrygarden.bi.main.dto.districtReport.RdUncollectedBuildingProjectsDTO;
import cn.com.countrygarden.bi.main.dto.districtReport.RdUncollectedBuildingProjectsVO;
import cn.com.countrygarden.bi.main.exception.ServiceException;
import cn.com.countrygarden.bi.main.model.AccessToken;
import cn.com.countrygarden.bi.main.model.PageData;
import cn.com.countrygarden.bi.main.model.districtReport.RdDistrictInfo;
import cn.com.countrygarden.bi.main.model.districtReport.RdUncollectedBuildingProjects;
import cn.com.countrygarden.bi.main.model.dup.DupComm;
import cn.com.countrygarden.bi.main.model.dup.DupOrgan;
import cn.com.countrygarden.bi.main.service.districtReport.RdProjectpermissionService;
import cn.com.countrygarden.bi.main.service.districtReport.RdUncollectedBuildingProjectsService;
import cn.com.countrygarden.bi.main.util.ExportExcelUtil;
import cn.com.countrygarden.bi.main.util.erp.StringUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import org.apache.commons.lang.StringUtils;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.xssf.usermodel.XSSFWorkbook;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.commons.CommonsMultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.BufferedInputStream;
import java.io.IOException;
import java.math.BigDecimal;
import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.*;

/**
 * 未收楼项目信息-业务逻辑层实现
 *
 * @author 吕伟峰
 * @email www.justintoforest@gamail.com
 * @url 
 * @date 2019-08-14
 */
@Service
@Transactional
public class RdUncollectedBuildingProjectsServiceImpl implements RdUncollectedBuildingProjectsService{
    @Autowired
    private RdUncollectedBuildingProjectsMapper rdUncollectedBuildingProjectsMapper;

    @Autowired
    private ManagerMapForErpMapper managerMapForErpMapper;

    @Autowired
    private RdDistrictInfoMapper rdDistrictInfoMapper;

    @Autowired
    private RdProjectpermissionService rdProjectpermissionService;

    @Override
    public Result queryPageList(RdUncollectedBuildingProjectsDTO rdUncollectedBuildingProjectsDTO, int page, int size,AccessToken accessToken) {

        // 获取登录人的角色授权
        Map<String, Object> rolesMap = rdProjectpermissionService.findRoleInfoMap(accessToken.getUserCode());

        List<String> organCodeString=new ArrayList<>();
        List<String> commIdString=new ArrayList<>();
        List<String> principaString=new ArrayList<>();
        List<Integer> paixu=rdProjectpermissionService.roleInfoList(rolesMap);

        for (int i=0;i<paixu.size();i++) {
            if (paixu.get(i)==1||paixu.get(i)==2){
                break;
            }else if (paixu.get(i)==3){
                principaString=rdProjectpermissionService.principalList(accessToken.getUserCode());
                break;
            }else if(paixu.get(i)==4||paixu.get(i)==5){
                organCodeString=managerMapForErpMapper.organCodeString(accessToken.getUserCode(),null);
                if(organCodeString==null||organCodeString.size()==0){
                    return null;
                }
                break;
            }else if(paixu.get(i)==6){
                rdUncollectedBuildingProjectsDTO.setCreateBy(accessToken.getUserCode());
                commIdString=null;
                organCodeString=null;
                break;
                /*commIdString=managerMapForErpMapper.commIdString(accessToken.getUserCode());
                if(commIdString==null||commIdString.size()==0){
                    return null;
                }
                break;*/
            }
        }

       if(StringUtil.isNotBlank(rdUncollectedBuildingProjectsDTO.getOpenDateList())){
           String[] openDateList=rdUncollectedBuildingProjectsDTO.getOpenDateList().split(",");
           rdUncollectedBuildingProjectsDTO.setOpenDateString1(openDateList[0]);
           rdUncollectedBuildingProjectsDTO.setOpenDateString2(openDateList[1]);
       }
       if(StringUtil.isNotBlank(rdUncollectedBuildingProjectsDTO.getOpeningDateList())){
           String[] openingDateList=rdUncollectedBuildingProjectsDTO.getOpeningDateList().split(",");
           rdUncollectedBuildingProjectsDTO.setOpeningDateString1(openingDateList[0]);
           rdUncollectedBuildingProjectsDTO.setOpeningDateString2(openingDateList[1]);
       }
        Page<Object> pageList = PageHelper.startPage(page, size);
		List<RdUncollectedBuildingProjectsDTO> queryPageList=rdUncollectedBuildingProjectsMapper.queryPageList(rdUncollectedBuildingProjectsDTO,organCodeString,commIdString,principaString);
        PageData data=new PageData(pageList);
        data.setData(pageList.getResult());
        return Response.response(data);
    }

    @Override
    public Result queryById(Integer id) {
        return Response.response(rdUncollectedBuildingProjectsMapper.queryById(id));
    }

    @Override
    public Result buildingProjectsAddOne(String districtCode, String projectCode,AccessToken accessToken) {
        Map<String, Object> rolesMap = rdProjectpermissionService.findRoleInfoMap(accessToken.getUserCode());
        List<Integer> paixu=new ArrayList<>();
        for (Map.Entry<String, Object> entry : rolesMap.entrySet()) {
            if(entry.getKey().equals("project_manager_admin")){
                paixu.add(1);
            }
            if(entry.getKey().equals("project_manager_regionAdmin")){
                paixu.add(2);
            }
            if(entry.getKey().equals("project_manager_regionUser")){
                paixu.add(3);
            }
            if(entry.getKey().equals("project_manager_projectUser")){
                paixu.add(4);
            }
            if(entry.getKey().equals("role")){
                throw new ServiceException("权限不足,无法使用此模块");
            }
        }
        Collections.sort(paixu);
        String createdBy=null;
        if(paixu.get(0)==4){
            createdBy=accessToken.getUserCode();
        }
        return Response.response(rdUncollectedBuildingProjectsMapper.buildingProjectsAddOne(districtCode,projectCode,createdBy));
    }

    @Override
    public Result add(RdUncollectedBuildingProjects rdUncollectedBuildingProjects, AccessToken accessToken) {
        int count=rdUncollectedBuildingProjectsMapper.dUncollectedBuildingProjectsAddone(rdUncollectedBuildingProjects);
        if(count>0){
            return Response.responseFail("项目名不能重复，请核实");
        }
        rdUncollectedBuildingProjects.setId(null);
        rdUncollectedBuildingProjects.setCreateTime(new Date());
        rdUncollectedBuildingProjects.setCreateBy(accessToken.getUserCode());
        rdUncollectedBuildingProjects.setEnable(1);
        rdUncollectedBuildingProjectsMapper.insert(rdUncollectedBuildingProjects);
        return Response.response();
    }

    @Override
    public Result edit(RdUncollectedBuildingProjects rdUncollectedBuildingProjects, AccessToken accessToken) {
        rdUncollectedBuildingProjects.setUpdateTime(new Date());
        rdUncollectedBuildingProjectsMapper.updateByPrimary(rdUncollectedBuildingProjects);
        return Response.response();
    }

    @Override
    public Result del(Integer id,AccessToken accessToken,String updateName) {
        int count = rdUncollectedBuildingProjectsMapper.deleteUpdate(id,accessToken.getUserCode(),updateName);
        return Response.response(count);
    }

    @Override
    public Result delpiliang(String ids,AccessToken accessToken,String updateName) {
        String[] idString=ids.split(",");
        List<String> rids =  Arrays.asList(idString);
        rdUncollectedBuildingProjectsMapper.delpingliangtag(rids,accessToken.getUserCode(),updateName);
        return Response.response("删除成功");
    }

    @Override
    public Result excelToxls(Integer radio, MultipartFile multipartFile, String fileName, String usname, String userCode, AccessToken accessToken) {

        SimpleDateFormat dFormat = new SimpleDateFormat("yyyy/MM/dd");
        BufferedInputStream bf = null;
        Sheet sheet = null;
        Workbook xwb = null;

        try {
            // 获取登录人的角色授权
            Map<String, Object> rolesMap = rdProjectpermissionService.findRoleInfoMap(accessToken.getUserCode());

            List<String> organCodeString=new ArrayList<>();
            List<String> commIdString=new ArrayList<>();
            List<String> principaString=new ArrayList<>();
            List<Integer> paixu=rdProjectpermissionService.roleInfoList(rolesMap);

            for (int i=0;i<paixu.size();i++) {
                if (paixu.get(i)==1||paixu.get(i)==2){
                    break;
                }else if(paixu.get(i)==3){
                    principaString=rdProjectpermissionService.principalList(accessToken.getUserCode());
                    break;
                }else if(paixu.get(i)==4||paixu.get(i)==5){
                    organCodeString=managerMapForErpMapper.organCodeString(accessToken.getUserCode(),null);
                    if(organCodeString==null||organCodeString.size()==0){
                        return null;
                    }
                    break;
                }else if(paixu.get(i)==6){
                    commIdString=managerMapForErpMapper.commIdString(accessToken.getUserCode());
                    if(commIdString==null||commIdString.size()==0){
                        return null;
                    }
                    break;
                }
            }

            CommonsMultipartFile commonsMultipartFile = (CommonsMultipartFile) multipartFile;
            bf = new BufferedInputStream(commonsMultipartFile.getInputStream());
            if (fileName.endsWith("xls")) { // Excel&nbsp;2003
                xwb = new HSSFWorkbook(bf);
            } else if (fileName.endsWith("xlsx")) { // Excel 2007/2010
                xwb = new XSSFWorkbook(bf);
            }
            sheet = xwb.getSheetAt(0);//获取第几个页面0开始
            Row row = null;
            Cell cell;
            RdUncollectedBuildingProjectsDTO rdUncollectedBuildingProjectsDTO=null;
            RdUncollectedBuildingProjects rdUncollectedBuildingProjects=null;
            List<RdUncollectedBuildingProjectsDTO> done=new ArrayList<>();
            for (int i = 0; i < sheet.getPhysicalNumberOfRows(); i++) {
                row = sheet.getRow(i+3);
                if(row==null) {
                    break;
                }

                for(int j =0;j<sheet.getRow(i+1).getPhysicalNumberOfCells();j++) {
                    cell = row.getCell(0);
                    if(cell==null) {
                        break;
                    }
                    cell.setCellType(CellType.STRING);
                    String districtName=cell.getStringCellValue();
                    if(StringUtils.isBlank(districtName)){
                        break;
                    }
                    cell = row.getCell(1);
                    cell.setCellType(CellType.STRING);
                    String projectName=cell.getStringCellValue();

                    if(StringUtils.isBlank(projectName)){
                        throw new ServiceException("第" + (i + 4) + "行" + "项目不能为空");
                    }

                    cell = row.getCell(2);
                    cell.setCellType(CellType.STRING);
                    String marketingLevel=cell.getStringCellValue();

                    if(StringUtils.isBlank(marketingLevel)){
                        throw new ServiceException("第" + (i + 4) + "行" + "营销定级不能为空");
                    }

                    cell = row.getCell(3);
                    cell.setCellType(CellType.STRING);
                    String propertyLevel=cell.getStringCellValue();

                    if(StringUtils.isBlank(propertyLevel)){
                        throw new ServiceException("第" + (i + 4) + "行" + "物业定级不能为空");
                    }

                    cell = row.getCell(4);
                    cell.setCellType(CellType.STRING);
                    String openDate=cell.getStringCellValue();

                    if(StringUtils.isBlank(openDate)){
                        throw new ServiceException("第" + (i + 4) + "行" + "开放时间不能为空");
                    }

                    cell = row.getCell(5);
                    cell.setCellType(CellType.STRING);
                    String openingDate=cell.getStringCellValue();

                    if(StringUtils.isBlank(openingDate)){
                        throw new ServiceException("第" + (i + 4) + "行" + "开盘时间不能为空");
                    }

                    cell = row.getCell(6);
                    cell.setCellType(CellType.STRING);
                    String projectResponsibler=cell.getStringCellValue();

                    if(StringUtils.isBlank(projectResponsibler)){
                        throw new ServiceException("第" + (i + 4) + "行" + "项目（驻场）负责人不能为空");
                    }

                    cell = row.getCell(7);
                    cell.setCellType(CellType.STRING);
                    String contact=cell.getStringCellValue();

                    if(StringUtils.isBlank(contact)){
                        throw new ServiceException("第" + (i + 4) + "行" + "联系方式不能为空");
                    }

                    cell = row.getCell(8);
                    cell.setCellType(CellType.STRING);
                    String caseCount=cell.getStringCellValue();

                    if(StringUtils.isBlank(caseCount)){
                        throw new ServiceException("第" + (i + 4) + "行" + "案场数量不能为空");
                    }

                    cell = row.getCell(9);
                    cell.setCellType(CellType.STRING);
                    String goodsSold=cell.getStringCellValue();

                    if(StringUtils.isBlank(goodsSold)){
                        throw new ServiceException("第" + (i + 4) + "行" + "已售货值不能为空");
                    }

                    cell = row.getCell(10);
                    cell.setCellType(CellType.STRING);
                    String goodsRemaining=cell.getStringCellValue();

                    if(StringUtils.isBlank(goodsRemaining)){
                        throw new ServiceException("第" + (i + 4) + "行" + "剩余货值不能为空");
                    }

                    cell = row.getCell(11);
                    cell.setCellType(CellType.STRING);
                    String managementType=cell.getStringCellValue();

                    if(StringUtils.isBlank(managementType)){
                        throw new ServiceException("第" + (i + 4) + "行" + "管理状态不能为空");
                    }

                    cell = row.getCell(12);
                    cell.setCellType(CellType.STRING);
                    String managerArea=cell.getStringCellValue();

                    if(StringUtils.isBlank(managerArea)){
                        throw new ServiceException("第" + (i + 4) + "行" + "接管面积不能为空");
                    }

                    cell = row.getCell(13);
                    cell.setCellType(CellType.STRING);
                    String dayPassengerCount=cell.getStringCellValue();

                    if(StringUtils.isBlank(dayPassengerCount)){
                        throw new ServiceException("第" + (i + 4) + "行" + "接日客流量不能为空");
                    }

                    cell = row.getCell(14);
                    cell.setCellType(CellType.STRING);
                    String villaCount=cell.getStringCellValue();

                    if(StringUtils.isBlank(villaCount)){
                        throw new ServiceException("第" + (i + 4) + "行" + "别墅样板房不能为空");
                    }

                    cell = row.getCell(15);
                    cell.setCellType(CellType.STRING);
                    String houseCount=cell.getStringCellValue();

                    if(StringUtils.isBlank(houseCount)){
                        throw new ServiceException("第" + (i + 4) + "行" + "洋房样板房不能为空");
                    }

                    cell = row.getCell(16);
                    cell.setCellType(CellType.STRING);
                    String seniorCount=cell.getStringCellValue();

                    if(StringUtils.isBlank(seniorCount)){
                        throw new ServiceException("第" + (i + 4) + "行" + "高层样板房不能为空");
                    }

                    List<DupComm> CaseDistrictCommName=managerMapForErpMapper.queryAllCommCaseDistrictCommName(null,projectName,commIdString);
                    if (CaseDistrictCommName.size()==0||CaseDistrictCommName==null){
                        throw new ServiceException("第" + (i + 4) + "行" + "没有该项目,或者没有该项目权限");
                    }
                    List<DupOrgan> result =managerMapForErpMapper.queryAllRegionRdDistrict(null,CaseDistrictCommName.get(0).getOrganCode(),organCodeString);
                    if (result.size()==0||result==null){
                        throw new ServiceException("第" + (i + 4) + "行" + "没有该区域,或者没有该区域权限");
                    }
                    List<RdDistrictInfo> rdDistrictInfoBown=rdDistrictInfoMapper.rdDistrictInfoBownName(null,districtName,principaString);
                    rdUncollectedBuildingProjectsDTO=new RdUncollectedBuildingProjectsDTO();

                    Date open=null;
                    Date opening=null;
                    if (StringUtils.isNotBlank(openDate)){
                        try {
                            open = dFormat.parse(openDate);
                            rdUncollectedBuildingProjectsDTO.setOpenDate(open);
                        }catch (ParseException e) {
                            throw new ServiceException("第" + (i + 4) + "行" + "时间格式错误，请按照  yyyy/MM/dd  格式添加");
                        }catch (Exception e) {
                            throw new ServiceException("第" + (i + 4) + "行" + "时间格式错误，请按照  yyyy/MM/dd  格式添加");
                        }
                    }
                    if (StringUtils.isNotBlank(openingDate)){
                        try {
                            opening = dFormat.parse(openingDate);
                            rdUncollectedBuildingProjectsDTO.setOpeningDate(opening);
                        }catch (ParseException e) {
                            throw new ServiceException("第" + (i + 4) + "行" + "时间格式错误，请按照  yyyy/MM/dd  格式添加");
                        }catch (Exception e) {
                            throw new ServiceException("第" + (i + 4) + "行" + "时间格式错误，请按照  yyyy/MM/dd  格式添加");
                        }
                    }

                    if (rdDistrictInfoBown.size()==0||rdDistrictInfoBown==null){
                        throw new ServiceException("第" + (i + 4) + "行" + "没有该片区或者没有该片区权限");
                    }else {
                        rdUncollectedBuildingProjectsDTO.setDistrictName(districtName);
                        rdUncollectedBuildingProjectsDTO.setProjectName(projectName);
                        done=rdUncollectedBuildingProjectsMapper.BuildingProjectsOne(rdUncollectedBuildingProjectsDTO);
                    }

                    int countMp=rdDistrictInfoMapper.countProjectMp(rdDistrictInfoBown.get(0).getDistrictCode(),projectName);
                    if(countMp==0){
                        throw new ServiceException("第" + (i + 4) + "行" + "该片区下没有这项目名称");
                    }

                    if(done.size()==0||done==null){
                        rdUncollectedBuildingProjects=new RdUncollectedBuildingProjects();
                        rdUncollectedBuildingProjects.setDistrictCode(rdDistrictInfoBown.get(0).getDistrictCode());
                        rdUncollectedBuildingProjects.setProjectCode(CaseDistrictCommName.get(0).getCommId());
                        rdUncollectedBuildingProjects.setProjectName(projectName);
                        rdUncollectedBuildingProjects.setMarketingLevel(marketingLevel);
                        rdUncollectedBuildingProjects.setPropertyLevel(propertyLevel);
                        rdUncollectedBuildingProjects.setOpenDate(open);
                        rdUncollectedBuildingProjects.setOpeningDate(opening);
                        rdUncollectedBuildingProjects.setProjectResponsibler(projectResponsibler);
                        rdUncollectedBuildingProjects.setContact(contact);
                        rdUncollectedBuildingProjects.setCaseCount(Integer.parseInt(caseCount));
                        rdUncollectedBuildingProjects.setGoodsSold(BigDecimal.valueOf(Double.parseDouble(goodsSold)));
                        rdUncollectedBuildingProjects.setGoodsRemaining(BigDecimal.valueOf(Double.parseDouble(goodsRemaining)));
                        rdUncollectedBuildingProjects.setManagementType(managementType);
                        BigDecimal managerAreabd=new BigDecimal(managerArea);
                        rdUncollectedBuildingProjects.setManagerArea(managerAreabd);
                        rdUncollectedBuildingProjects.setDayPassengerCount(Integer.parseInt(dayPassengerCount));
                        rdUncollectedBuildingProjects.setVillaCount(Integer.parseInt(villaCount));
                        rdUncollectedBuildingProjects.setHouseCount(Integer.parseInt(houseCount));
                        rdUncollectedBuildingProjects.setSeniorCount(Integer.parseInt(seniorCount));
                        rdUncollectedBuildingProjects.setEnable(1);
                        rdUncollectedBuildingProjects.setCreateTime(new Date());
                        rdUncollectedBuildingProjects.setCreateBy(accessToken.getUserCode());
                        rdUncollectedBuildingProjects.setCreateName(usname);
                        rdUncollectedBuildingProjectsMapper.insert(rdUncollectedBuildingProjects);
                    }else {
                        rdUncollectedBuildingProjects=new RdUncollectedBuildingProjects();
                        rdUncollectedBuildingProjects.setId(done.get(0).getId());
                        rdUncollectedBuildingProjects.setProjectName(projectName);
                        rdUncollectedBuildingProjects.setMarketingLevel(marketingLevel);
                        rdUncollectedBuildingProjects.setPropertyLevel(propertyLevel);
                        rdUncollectedBuildingProjects.setOpenDate(open);
                        rdUncollectedBuildingProjects.setOpeningDate(opening);
                        rdUncollectedBuildingProjects.setProjectResponsibler(projectResponsibler);
                        rdUncollectedBuildingProjects.setContact(contact);
                        rdUncollectedBuildingProjects.setCaseCount(Integer.parseInt(caseCount));
                        rdUncollectedBuildingProjects.setGoodsSold(BigDecimal.valueOf(Double.parseDouble(goodsSold)));
                        rdUncollectedBuildingProjects.setGoodsRemaining(BigDecimal.valueOf(Double.parseDouble(goodsRemaining)));
                        rdUncollectedBuildingProjects.setManagementType(managementType);
                        BigDecimal managerAreabd=new BigDecimal(managerArea);
                        rdUncollectedBuildingProjects.setManagerArea(managerAreabd);
                        rdUncollectedBuildingProjects.setDayPassengerCount(Integer.parseInt(dayPassengerCount));
                        rdUncollectedBuildingProjects.setVillaCount(Integer.parseInt(villaCount));
                        rdUncollectedBuildingProjects.setHouseCount(Integer.parseInt(houseCount));
                        rdUncollectedBuildingProjects.setSeniorCount(Integer.parseInt(seniorCount));
                        rdUncollectedBuildingProjects.setUpdateTime(new Date());
                        rdUncollectedBuildingProjects.setUpdateBy(usname);
                        rdUncollectedBuildingProjectsMapper.updateByPrimary(rdUncollectedBuildingProjects);
                    }
                    j+=16;
                }
            }
            return Response.response("导入成功");
        }catch (IOException e1){
            e1.printStackTrace();
            throw new ServiceException("导入失败！请稍后重试！");
        }
    }

    @Override
    public HSSFWorkbook exportAllRdUncollectedBuildingProjects(AccessToken accessToken, HttpServletResponse response) throws IOException {

        // 获取登录人的角色授权
        Map<String, Object> rolesMap = rdProjectpermissionService.findRoleInfoMap(accessToken.getUserCode());

        List<String> organCodeString=new ArrayList<>();
        List<String> commIdString=new ArrayList<>();
        List<String> principaString=new ArrayList<>();
        List<Integer> paixu=rdProjectpermissionService.roleInfoList(rolesMap);

        for (int i=0;i<paixu.size();i++) {
            if (paixu.get(i)==1||paixu.get(i)==2){
                break;
            }else if (paixu.get(i)==3){
                principaString=rdProjectpermissionService.principalList(accessToken.getUserCode());
                break;
            }else if(paixu.get(i)==4||paixu.get(i)==5){
                organCodeString=managerMapForErpMapper.organCodeString(accessToken.getUserCode(),null);
                if(organCodeString==null||organCodeString.size()==0){
                    return null;
                }
                break;
            }else if(paixu.get(i)==6){
                commIdString=managerMapForErpMapper.commIdString(accessToken.getUserCode());
                if(commIdString==null||commIdString.size()==0){
                    return null;
                }
                break;
            }
        }
        ExportExcelUtil util = new ExportExcelUtil();
        String[] columnNamesweishou = {"片区名称"  , "项目名称"  , "营销定级" , "物业定级" , "开放时间","开盘时间","项目（驻场）负责人）",
                "联系方式" ,"案场数量","年货值-已售","年货值-剩余","管理形态","接管面积（㎡）","日客流量（组）",
                "别墅样板房（间）","洋房样板房（间）","高层样板房（间）"};
        Collection<RdUncollectedBuildingProjectsVO> listweishou=rdUncollectedBuildingProjectsMapper.evaluationrdUncollectedBuildingProjects(new  RdUncollectedBuildingProjectsDTO(),organCodeString,commIdString,principaString);
        HSSFWorkbook resultwweishou = util.getWorkbook2003("未收楼项目信息", columnNamesweishou,listweishou, response.getOutputStream(), "yyyy-MM-dd HH:mm:ss", null);
        return resultwweishou;
    }

}