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

import cn.com.countrygarden.bi.main.core.Response;
import cn.com.countrygarden.bi.main.core.Result;
import cn.com.countrygarden.bi.main.dao.ShareConfigMapper;
import cn.com.countrygarden.bi.main.dao.ck.satisfaction.SatisfiedDissatisfiedProjectMapper;
import cn.com.countrygarden.bi.main.dao.sys.UserRolesMapper;
import cn.com.countrygarden.bi.main.dao.twerp.hm.TbSysUserMapper;
import cn.com.countrygarden.bi.main.dto.ck.SatisfactionDisplayDTO;
import cn.com.countrygarden.bi.main.dto.ck.SatisfiedDissatisfiedProjectDTO;
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.ShareConfig;
import cn.com.countrygarden.bi.main.model.ck.satisfaction.SatisfiedDissatisfiedProject;
import cn.com.countrygarden.bi.main.model.sys.UserRoles;
import cn.com.countrygarden.bi.main.model.twerp.hm.TbSysUser;
import cn.com.countrygarden.bi.main.service.ck.SatisfiedDissatisfiedProjectService;
import cn.com.countrygarden.bi.main.service.erp.impl.ExcelArrearageServiceImpl;
import cn.com.countrygarden.bi.main.util.MD5;
import cn.com.countrygarden.bi.main.util.erp.StringUtil;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;
import org.apache.commons.collections4.CollectionUtils;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import tk.mybatis.mapper.entity.Condition;
import tk.mybatis.mapper.entity.Example;

import javax.servlet.http.HttpServletRequest;
import java.io.BufferedReader;
import java.io.IOException;
import java.text.NumberFormat;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.stream.Collectors;

/**
 * <p>
 *   不满意因素-项目业务处理
 * </p>
 *
 * @author
 * @date 2021-08-06
 * @version V1.0
 */
@Service
@Transactional(rollbackFor = RuntimeException.class)
public class SatisfiedDissatisfiedProjectServiceImpl implements SatisfiedDissatisfiedProjectService {

    @Autowired
    private SatisfiedDissatisfiedProjectMapper satisfiedDissatisfiedProjectMapper;

    @Autowired
    private UserRolesMapper userRolesMapper;

    @Autowired
    private ShareConfigMapper shareConfigMapper;

    @Autowired
    private TbSysUserMapper tbSysUserMapper;

    private final org.slf4j.Logger logger = LoggerFactory.getLogger(ExcelArrearageServiceImpl.class);

    @Override
    public Result queryPageList(SatisfiedDissatisfiedProject satisfiedDissatisfiedProject, int page, int size, AccessToken accessToken) {
        List<String> rolesList = queryRoleCodes(null, accessToken.getUserCode());

        if (rolesList.contains("satisfaction_admin")) {

            if(StringUtil.isBlank(satisfiedDissatisfiedProject.getYearNian())){
                if(StringUtil.isNotBlank(satisfiedDissatisfiedProject.getNouchYue())){
                    String[] yuesr=satisfiedDissatisfiedProject.getNouchYue().split(",");
                    satisfiedDissatisfiedProject.setYueList(Arrays.asList(yuesr));
                    satisfiedDissatisfiedProject.setMonthStr(null);
                    List<String> niancha=satisfiedDissatisfiedProjectMapper.niancha();
                    List<String> nianxin=new ArrayList<>();
                    for (int i = 0; i <satisfiedDissatisfiedProject.getYueList().size() ; i++) {
                        for (int j = 0; j <niancha.size() ; j++) {
                            String yuehie=niancha.get(j)+"-"+satisfiedDissatisfiedProject.getYueList().get(i);
                            nianxin.add(yuehie);
                        }
                    }
                    satisfiedDissatisfiedProject.setYueList(nianxin);
                }
            }

            if(StringUtil.isNotBlank(satisfiedDissatisfiedProject.getMonthStr())){
                String[] yuesr=satisfiedDissatisfiedProject.getMonthStr().split(",");
                satisfiedDissatisfiedProject.setYueList(Arrays.asList(yuesr));
                satisfiedDissatisfiedProject.setYearNian(null);
            }

            if(StringUtil.isNotBlank(satisfiedDissatisfiedProject.getOrgCode())){
                if(satisfiedDissatisfiedProject.getOrgCode().equals("0")){
                    satisfiedDissatisfiedProject.setOrgCode("");
                }
            }

            if(StringUtil.isNotBlank(satisfiedDissatisfiedProject.getCommStr())){
                String[] comm=satisfiedDissatisfiedProject.getCommStr().split(",");
                satisfiedDissatisfiedProject.setCommCodeList(Arrays.asList(comm));
            }

            Long toble=satisfiedDissatisfiedProjectMapper.selectListDataToble(satisfiedDissatisfiedProject);

            Page<Object> pageList = PageHelper.startPage(page,size);
            List<SatisfiedDissatisfiedProject> list=satisfiedDissatisfiedProjectMapper.queryPageList(satisfiedDissatisfiedProject);

            if (CollectionUtils.isNotEmpty(list)) {
                NumberFormat df = NumberFormat.getNumberInstance();
                df.setMaximumFractionDigits(2);
                for (int i = 0; i < list.size(); i++) {
                    if(StringUtil.isNotBlank(list.get(i).getSeVpapr())){
                        list.get(i).setSeVpapr(String.valueOf(df.format(Double.valueOf(list.get(i).getSeVpapr())*100))+"%");
                    }else {
                        list.get(i).setSeVpapr("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getSeLlegal())){
                        list.get(i).setSeLlegal(String.valueOf(df.format(Double.valueOf(list.get(i).getSeLlegal())*100))+"%");
                    }else {
                        list.get(i).setSeLlegal("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getSePet())){
                        list.get(i).setSePet(String.valueOf(df.format(Double.valueOf(list.get(i).getSePet())*100))+"%");
                    }else {
                        list.get(i).setSePet("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getSeNoise())){
                        list.get(i).setSeNoise(String.valueOf(df.format(Double.valueOf(list.get(i).getSeNoise())*100))+"%");
                    }else {
                        list.get(i).setSeNoise("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getSeNonresid())){
                        list.get(i).setSeNonresid(String.valueOf(df.format(Double.valueOf(list.get(i).getSeNonresid())*100))+"%");
                    }else {
                        list.get(i).setSeNonresid("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getSeLaxcarking())){
                        list.get(i).setSeLaxcarking(String.valueOf(df.format(Double.valueOf(list.get(i).getSeLaxcarking())*100))+"%");
                    }else {
                        list.get(i).setSeLaxcarking("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getSeOtheroise())){
                        list.get(i).setSeOtheroise(String.valueOf(df.format(Double.valueOf(list.get(i).getSeOtheroise())*100))+"%");
                    }else {
                        list.get(i).setSeOtheroise("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getSeCardchecking())){
                        list.get(i).setSeCardchecking(String.valueOf(df.format(Double.valueOf(list.get(i).getSeCardchecking())*100))+"%");
                    }else {
                        list.get(i).setSeCardchecking("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getSeFireman())){
                        list.get(i).setSeFireman(String.valueOf(df.format(Double.valueOf(list.get(i).getSeFireman())*100))+"%");
                    }else {
                        list.get(i).setSeFireman("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getSeLlechaing())){
                        list.get(i).setSeLlechaing(String.valueOf(df.format(Double.valueOf(list.get(i).getSeLlechaing())*100))+"%");
                    }else {
                        list.get(i).setSeLlechaing("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getSeSense())){
                        list.get(i).setSeSense(String.valueOf(df.format(Double.valueOf(list.get(i).getSeSense())*100))+"%");
                    }else {
                        list.get(i).setSeSense("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getSePostwork())){
                        list.get(i).setSePostwork(String.valueOf(df.format(Double.valueOf(list.get(i).getSePostwork())*100))+"%");
                    }else {
                        list.get(i).setSePostwork("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getSePooratitude())){
                        list.get(i).setSePooratitude(String.valueOf(df.format(Double.valueOf(list.get(i).getSePooratitude())*100))+"%");
                    }else {
                        list.get(i).setSePooratitude("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getSeConsciousness())){
                        list.get(i).setSeConsciousness(String.valueOf(df.format(Double.valueOf(list.get(i).getSeConsciousness())*100))+"%");
                    }else {
                        list.get(i).setSeConsciousness("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getCuStafhad())){
                        list.get(i).setCuStafhad(String.valueOf(df.format(Double.valueOf(list.get(i).getCuStafhad())*100))+"%");
                    }else {
                        list.get(i).setCuStafhad("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getCuFrontdesk())){
                        list.get(i).setCuFrontdesk(String.valueOf(df.format(Double.valueOf(list.get(i).getCuFrontdesk())*100))+"%");
                    }else {
                        list.get(i).setCuFrontdesk("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getCuPoorachatide())){
                        list.get(i).setCuPoorachatide(String.valueOf(df.format(Double.valueOf(list.get(i).getCuPoorachatide())*100))+"%");
                    }else {
                        list.get(i).setCuPoorachatide("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getCuHousekeeper())){
                        list.get(i).setCuHousekeeper(String.valueOf(df.format(Double.valueOf(list.get(i).getCuHousekeeper())*100))+"%");
                    }else {
                        list.get(i).setCuHousekeeper("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getCuConhouse())){
                        list.get(i).setCuConhouse(String.valueOf(df.format(Double.valueOf(list.get(i).getCuConhouse())*100))+"%");
                    }else {
                        list.get(i).setCuConhouse("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getCuProblemfollow())){
                        list.get(i).setCuProblemfollow(String.valueOf(df.format(Double.valueOf(list.get(i).getCuProblemfollow())*100))+"%");
                    }else {
                        list.get(i).setCuProblemfollow("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getCuFrequently())){
                        list.get(i).setCuFrequently(String.valueOf(df.format(Double.valueOf(list.get(i).getCuFrequently())*100))+"%");
                    }else {
                        list.get(i).setCuFrequently("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getCuFrbujidesk())){
                        list.get(i).setCuFrbujidesk(String.valueOf(df.format(Double.valueOf(list.get(i).getCuFrbujidesk())*100))+"%");
                    }else {
                        list.get(i).setCuFrbujidesk("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getGrMaintenance())){
                        list.get(i).setGrMaintenance(String.valueOf(df.format(Double.valueOf(list.get(i).getGrMaintenance())*100))+"%");
                    }else {
                        list.get(i).setGrMaintenance("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getGrDowntrees())){
                        list.get(i).setGrDowntrees(String.valueOf(df.format(Double.valueOf(list.get(i).getGrDowntrees())*100))+"%");
                    }else {
                        list.get(i).setGrDowntrees("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getGrGreenwaste())){
                        list.get(i).setGrGreenwaste(String.valueOf(df.format(Double.valueOf(list.get(i).getGrGreenwaste())*100))+"%");
                    }else {
                        list.get(i).setGrGreenwaste("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getGrPlantruning())){
                        list.get(i).setGrPlantruning(String.valueOf(df.format(Double.valueOf(list.get(i).getGrPlantruning())*100))+"%");
                    }else {
                        list.get(i).setGrPlantruning("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getGrWitheeds())){
                        list.get(i).setGrWitheeds(String.valueOf(df.format(Double.valueOf(list.get(i).getGrWitheeds())*100))+"%");
                    }else {
                        list.get(i).setGrWitheeds("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getGrPlantdeath())){
                        list.get(i).setGrPlantdeath(String.valueOf(df.format(Double.valueOf(list.get(i).getGrPlantdeath())*100))+"%");
                    }else {
                        list.get(i).setGrPlantdeath("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getGrLoess())){
                        list.get(i).setGrLoess(String.valueOf(df.format(Double.valueOf(list.get(i).getGrLoess())*100))+"%");
                    }else {
                        list.get(i).setGrLoess("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getGrSeedlingloss())){
                        list.get(i).setGrSeedlingloss(String.valueOf(df.format(Double.valueOf(list.get(i).getGrSeedlingloss())*100))+"%");
                    }else {
                        list.get(i).setGrSeedlingloss("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getGrFewplant())){
                        list.get(i).setGrFewplant(String.valueOf(df.format(Double.valueOf(list.get(i).getGrFewplant())*100))+"%");
                    }else {
                        list.get(i).setGrFewplant("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getGrUnreasonable())){
                        list.get(i).setGrUnreasonable(String.valueOf(df.format(Double.valueOf(list.get(i).getGrUnreasonable())*100))+"%");
                    }else {
                        list.get(i).setGrUnreasonable("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getGrServiceimage())){
                        list.get(i).setGrServiceimage(String.valueOf(df.format(Double.valueOf(list.get(i).getGrServiceimage())*100))+"%");
                    }else {
                        list.get(i).setGrServiceimage("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getClUnrplagacans())){
                        list.get(i).setClUnrplagacans(String.valueOf(df.format(Double.valueOf(list.get(i).getClUnrplagacans())*100))+"%");
                    }else {
                        list.get(i).setClUnrplagacans("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getClRemovaon())){
                        list.get(i).setClRemovaon(String.valueOf(df.format(Double.valueOf(list.get(i).getClRemovaon())*100))+"%");
                    }else {
                        list.get(i).setClRemovaon("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getClOutdoorpublic())){
                        list.get(i).setClOutdoorpublic(String.valueOf(df.format(Double.valueOf(list.get(i).getClOutdoorpublic())*100))+"%");
                    }else {
                        list.get(i).setClOutdoorpublic("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getClBuilinterior())){
                        list.get(i).setClBuilinterior(String.valueOf(df.format(Double.valueOf(list.get(i).getClBuilinterior())*100))+"%");
                    }else {
                        list.get(i).setClBuilinterior("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getClGarcleang())){
                        list.get(i).setClGarcleang(String.valueOf(df.format(Double.valueOf(list.get(i).getClGarcleang())*100))+"%");
                    }else {
                        list.get(i).setClGarcleang("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getClWaterscape())){
                        list.get(i).setClWaterscape(String.valueOf(df.format(Double.valueOf(list.get(i).getClWaterscape())*100))+"%");
                    }else {
                        list.get(i).setClWaterscape("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getClFpelimination())){
                        list.get(i).setClFpelimination(String.valueOf(df.format(Double.valueOf(list.get(i).getClFpelimination())*100))+"%");
                    }else {
                        list.get(i).setClFpelimination("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getClCleanupaccu())){
                        list.get(i).setClCleanupaccu(String.valueOf(df.format(Double.valueOf(list.get(i).getClCleanupaccu())*100))+"%");
                    }else {
                        list.get(i).setClCleanupaccu("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getClServiceimage())){
                        list.get(i).setClServiceimage(String.valueOf(df.format(Double.valueOf(list.get(i).getClServiceimage())*100))+"%");
                    }else {
                        list.get(i).setClServiceimage("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getEnPuicliting())){
                        list.get(i).setEnPuicliting(String.valueOf(df.format(Double.valueOf(list.get(i).getEnPuicliting())*100))+"%");
                    }else {
                        list.get(i).setEnPuicliting("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getEnAmusement())){
                        list.get(i).setEnAmusement(String.valueOf(df.format(Double.valueOf(list.get(i).getEnAmusement())*100))+"%");
                    }else {
                        list.get(i).setEnAmusement("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getEnElevator())){
                        list.get(i).setEnElevator(String.valueOf(df.format(Double.valueOf(list.get(i).getEnElevator())*100))+"%");
                    }else {
                        list.get(i).setEnElevator("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getEnWaterupply())){
                        list.get(i).setEnWaterupply(String.valueOf(df.format(Double.valueOf(list.get(i).getEnWaterupply())*100))+"%");
                    }else {
                        list.get(i).setEnWaterupply("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getEnFireighting())){
                        list.get(i).setEnFireighting(String.valueOf(df.format(Double.valueOf(list.get(i).getEnFireighting())*100))+"%");
                    }else {
                        list.get(i).setEnFireighting("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getEnMonitoring())){
                        list.get(i).setEnMonitoring(String.valueOf(df.format(Double.valueOf(list.get(i).getEnMonitoring())*100))+"%");
                    }else {
                        list.get(i).setEnMonitoring("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getEnAccessconol())){
                        list.get(i).setEnAccessconol(String.valueOf(df.format(Double.valueOf(list.get(i).getEnAccessconol())*100))+"%");
                    }else {
                        list.get(i).setEnAccessconol("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getEnRoadgate())){
                        list.get(i).setEnRoadgate(String.valueOf(df.format(Double.valueOf(list.get(i).getEnRoadgate())*100))+"%");
                    }else {
                        list.get(i).setEnRoadgate("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getEnPublicarea())){
                        list.get(i).setEnPublicarea(String.valueOf(df.format(Double.valueOf(list.get(i).getEnPublicarea())*100))+"%");
                    }else {
                        list.get(i).setEnPublicarea("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getEnDrainage())){
                        list.get(i).setEnDrainage(String.valueOf(df.format(Double.valueOf(list.get(i).getEnDrainage())*100))+"%");
                    }else {
                        list.get(i).setEnDrainage("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getEnImageatude())){
                        list.get(i).setEnImageatude(String.valueOf(df.format(Double.valueOf(list.get(i).getEnImageatude())*100))+"%");
                    }else {
                        list.get(i).setEnImageatude("/");
                    }
                    if(StringUtil.isNotBlank(list.get(i).getEnHomemainte())){
                        list.get(i).setEnHomemainte(String.valueOf(df.format(Double.valueOf(list.get(i).getEnHomemainte())*100))+"%");
                    }else {
                        list.get(i).setEnHomemainte("/");
                    }


                    if (StringUtil.isNotBlank(list.get(i).getChAblecharge())) {
                        list.get(i).setChAblecharge(String.valueOf(df.format(Double.valueOf(list.get(i).getChAblecharge()) * 100)) + "%");
                    }else {
                        list.get(i).setChAblecharge("/");
                    }
                    if (StringUtil.isNotBlank(list.get(i).getComPublicbene())) {
                        list.get(i).setComPublicbene(String.valueOf(df.format(Double.valueOf(list.get(i).getComPublicbene()) * 100)) + "%");
                    }else {
                        list.get(i).setComPublicbene("/");
                    }
                    if (StringUtil.isNotBlank(list.get(i).getComNonstandard())) {
                        list.get(i).setComNonstandard(String.valueOf(df.format(Double.valueOf(list.get(i).getComNonstandard()) * 100)) + "%");
                    }else {
                        list.get(i).setComNonstandard("/");
                    }
                    if (StringUtil.isNotBlank(list.get(i).getComOperation())) {
                        list.get(i).setComOperation(String.valueOf(df.format(Double.valueOf(list.get(i).getComOperation()) * 100)) + "%");
                    }else {
                        list.get(i).setComOperation("/");
                    }
                    if (StringUtil.isNotBlank(list.get(i).getSoActiveffect())) {
                        list.get(i).setSoActiveffect(String.valueOf(df.format(Double.valueOf(list.get(i).getSoActiveffect()) * 100)) + "%");
                    }else {
                        list.get(i).setSoActiveffect("/");
                    }
                    if (StringUtil.isNotBlank(list.get(i).getSoNotification())) {
                        list.get(i).setSoNotification(String.valueOf(df.format(Double.valueOf(list.get(i).getSoNotification()) * 100)) + "%");
                    }else {
                        list.get(i).setSoNotification("/");
                    }
                    if (StringUtil.isNotBlank(list.get(i).getSoActivitycon())) {
                        list.get(i).setSoActivitycon(String.valueOf(df.format(Double.valueOf(list.get(i).getSoActivitycon()) * 100)) + "%");
                    }else {
                        list.get(i).setSoActivitycon("/");
                    }
                    if (StringUtil.isNotBlank(list.get(i).getHoNdoorhouse())) {
                        list.get(i).setHoNdoorhouse(String.valueOf(df.format(Double.valueOf(list.get(i).getHoNdoorhouse()) * 100)) + "%");
                    }else {
                        list.get(i).setHoNdoorhouse("/");
                    }
                    if (StringUtil.isNotBlank(list.get(i).getHoQuaproblems())) {
                        list.get(i).setHoQuaproblems(String.valueOf(df.format(Double.valueOf(list.get(i).getHoQuaproblems()) * 100)) + "%");
                    }else {
                        list.get(i).setHoQuaproblems("/");
                    }
                    if (StringUtil.isNotBlank(list.get(i).getHoSales())) {
                        list.get(i).setHoSales(String.valueOf(df.format(Double.valueOf(list.get(i).getHoSales()) * 100)) + "%");
                    }else {
                        list.get(i).setHoSales("/");
                    }
                    if (StringUtil.isNotBlank(list.get(i).getHoNotsatisf())) {
                        list.get(i).setHoNotsatisf(String.valueOf(df.format(Double.valueOf(list.get(i).getHoNotsatisf()) * 100)) + "%");
                    }else {
                        list.get(i).setHoNotsatisf("/");
                    }

                    if (StringUtil.isNotBlank(list.get(i).getHoUnplanning())) {
                        list.get(i).setHoUnplanning(String.valueOf(df.format(Double.valueOf(list.get(i).getHoUnplanning()) * 100)) + "%");
                    }else {
                        list.get(i).setHoUnplanning("/");
                    }
                    if (StringUtil.isNotBlank(list.get(i).getHoRightcertifi())) {
                        list.get(i).setHoRightcertifi(String.valueOf(df.format(Double.valueOf(list.get(i).getHoRightcertifi()) * 100)) + "%");
                    }else {
                        list.get(i).setHoRightcertifi("/");
                    }
                    if (StringUtil.isNotBlank(list.get(i).getJtIndoorand())) {
                        list.get(i).setJtIndoorand(String.valueOf(df.format(Double.valueOf(list.get(i).getJtIndoorand()) * 100)) + "%");
                    }else {
                        list.get(i).setJtIndoorand("/");
                    }
                    if (StringUtil.isNotBlank(list.get(i).getJtCesother())) {
                        list.get(i).setJtCesother(String.valueOf(df.format(Double.valueOf(list.get(i).getJtCesother()) * 100)) + "%");
                    }else {
                        list.get(i).setJtCesother("/");
                    }
                    if (StringUtil.isNotBlank(list.get(i).getYjTenanily())) {
                        list.get(i).setYjTenanily(String.valueOf(df.format(Double.valueOf(list.get(i).getYjTenanily()) * 100)) + "%");
                    }else {
                        list.get(i).setYjTenanily("/");
                    }
                    if (StringUtil.isNotBlank(list.get(i).getSzMunicipa())) {
                        list.get(i).setSzMunicipa(String.valueOf(df.format(Double.valueOf(list.get(i).getSzMunicipa()) * 100)) + "%");
                    }else {
                        list.get(i).setSzMunicipa("/");
                    }

                    if (StringUtil.isNotBlank(list.get(i).getSzSurrounding())) {
                        list.get(i).setSzSurrounding(String.valueOf(df.format(Double.valueOf(list.get(i).getSzSurrounding()) * 100)) + "%");
                    }else {
                        list.get(i).setSzSurrounding("/");
                    }
                    if (StringUtil.isNotBlank(list.get(i).getGxPersonalized())) {
                        list.get(i).setGxPersonalized(String.valueOf(df.format(Double.valueOf(list.get(i).getGxPersonalized()) * 100)) + "%");
                    }else {
                        list.get(i).setGxPersonalized("/");
                    }

                    if (StringUtil.isNotBlank(list.get(i).getGxStandard())) {
                        list.get(i).setGxStandard(String.valueOf(df.format(Double.valueOf(list.get(i).getGxStandard()) * 100)) + "%");
                    }else {
                        list.get(i).setGxStandard("/");
                    }

                    if (StringUtil.isNotBlank(list.get(i).getQtOtherfactors())) {
                        list.get(i).setQtOtherfactors(String.valueOf(df.format(Double.valueOf(list.get(i).getQtOtherfactors()) * 100)) + "%");
                    }else {
                        list.get(i).setQtOtherfactors("/");
                    }

                    if (StringUtil.isNotBlank(list.get(i).getYjDispuween())) {
                        list.get(i).setYjDispuween(String.valueOf(df.format(Double.valueOf(list.get(i).getYjDispuween()) * 100)) + "%");
                    }else {
                        list.get(i).setYjDispuween("/");
                    }

                    if (StringUtil.isNotBlank(list.get(i).getYjDiwuuyutre())) {
                        list.get(i).setYjDiwuuyutre(String.valueOf(df.format(Double.valueOf(list.get(i).getYjDiwuuyutre()) * 100)) + "%");
                    }else {
                        list.get(i).setYjDiwuuyutre("/");
                    }

                    if (StringUtil.isNotBlank(list.get(i).getEnEquipment())) {
                        list.get(i).setEnEquipment(String.valueOf(df.format(Double.valueOf(list.get(i).getEnEquipment()) * 100)) + "%");
                    }else {
                        list.get(i).setEnEquipment("/");
                    }

                }
            }

            PageData data = new PageData(pageList);
            data.setData(list);
            data.setTotal(toble);
            return Response.response(data);
        }else {
            throw new ServiceException("此账号无权限查看");
        }
    }

    @Override
    public Result getrevenue(AccessToken accessToken, HttpServletRequest request) throws IOException {
        BufferedReader bufferReader = new BufferedReader(request.getReader());
        StringBuffer sbder = new StringBuffer();
        String line = null;
        while ((line = bufferReader.readLine()) != null) {
            sbder.append(line);
        }
        if(sbder==null || sbder.length()==0){
            return Response.responseFail("请输入参数");
        }

        JSONObject json = JSONObject.fromObject(sbder.toString());
        Map<String,Object> map=new HashMap<String,Object>();
        map.put("clientId",json.getString("clientId"));
        map.put("timeString",json.getString("timeString"));
        map.put("sign",json.getString("sign"));
        Result result = checkIdentity(json.getString("clientId"), json.getString("timeString"), json.getString("sign"));
        int code = result.getResultCode();
        if(500 == code){
            logger.error("认证失败-----------");
            System.err.println("认证失败-----------");
            return result;
        }

        if(!json.containsKey("startTime") && !json.containsKey("endTime")){
            logger.error("请传入时间参数");
            System.err.println("请传入时间参数");
            return Response.responseFail("请传入时间参数");
        }

   /*     SimpleDateFormat sb=new SimpleDateFormat("yyyy-MM-dd HH:mm");
        try {
            if(json.containsKey("startTime")){
                Date parse = sb.parse(json.getString("startTime"));
            }
            if(json.containsKey("endTime")){
                Date parse = sb.parse(json.getString("endTime"));
            }
        }catch (Exception e){
            logger.error("参数错误:startTime 或者 endTime 时间格式有误");
            System.err.println("参数错误:startTime 或者 endTime 时间格式有误");
            return Response.responseFail("参数错误:startTime 或者 endTime 时间格式有误");
        }*/

        String startTime=null;
        String endTime=null;

        if(json.containsKey("startTime")){
            startTime = json.getString("startTime")+" 00:00:00";
        }
        if(json.containsKey("endTime")){
            endTime = json.getString("endTime")+" 23:59:59";
        }

        SatisfiedDissatisfiedProjectDTO satiseDTO=new SatisfiedDissatisfiedProjectDTO();
        List<Map<String,String>> lima=new ArrayList<>();

        List<SatisfiedDissatisfiedProject> listBiao=satisfiedDissatisfiedProjectMapper.listBiao();

        List<SatisfiedDissatisfiedProject> list=satisfiedDissatisfiedProjectMapper.getrevenue(startTime,endTime);
        if(CollectionUtils.isNotEmpty(list)){
            for (int i = 0; i < list.size(); i++) {
                if(StringUtil.isBlank(list.get(i).getSeVpapr())){
                    list.get(i).setSeVpapr("");
                }
                if(StringUtil.isBlank(list.get(i).getSeLlegal())){
                    list.get(i).setSeLlegal("");
                }
                if(StringUtil.isBlank(list.get(i).getSePet())){
                    list.get(i).setSePet("");
                }
                if(StringUtil.isBlank(list.get(i).getSeNoise())){
                    list.get(i).setSeNoise("");
                }
                if(StringUtil.isBlank(list.get(i).getSeNonresid())){
                    list.get(i).setSeNonresid("");
                }
                if(StringUtil.isBlank(list.get(i).getSeOtheroise())){
                    list.get(i).setSeOtheroise("");
                }
                if(StringUtil.isBlank(list.get(i).getSeCardchecking())){
                    list.get(i).setSeCardchecking("");
                }
                if(StringUtil.isBlank(list.get(i).getSeFireman())){
                    list.get(i).setSeFireman("");
                }
                if(StringUtil.isBlank(list.get(i).getSeLlechaing())){
                    list.get(i).setSeLlechaing("");
                }
                if(StringUtil.isBlank(list.get(i).getSeSense())){
                    list.get(i).setSeSense("");
                }
                if(StringUtil.isBlank(list.get(i).getSePostwork())){
                    list.get(i).setSePostwork("");
                }
                if(StringUtil.isBlank(list.get(i).getSePooratitude())){
                    list.get(i).setSePooratitude("");
                }
                if(StringUtil.isBlank(list.get(i).getSeConsciousness())){
                    list.get(i).setSeConsciousness("");
                }
                if(StringUtil.isBlank(list.get(i).getCuStafhad())){
                    list.get(i).setCuStafhad("");
                }
                if(StringUtil.isBlank(list.get(i).getCuFrontdesk())){
                    list.get(i).setCuFrontdesk("");
                }
                if(StringUtil.isBlank(list.get(i).getCuHousekeeper())){
                    list.get(i).setCuHousekeeper("");
                }
                if(StringUtil.isBlank(list.get(i).getCuConhouse())){
                    list.get(i).setCuConhouse("");
                }
                if(StringUtil.isBlank(list.get(i).getCuProblemfollow())){
                    list.get(i).setCuProblemfollow("");
                }
                if(StringUtil.isBlank(list.get(i).getCuFrequently())){
                    list.get(i).setCuFrequently("");
                }
                if(StringUtil.isBlank(list.get(i).getCuFrbujidesk())){
                    list.get(i).setCuFrbujidesk("");
                }
                if(StringUtil.isBlank(list.get(i).getGrMaintenance())){
                    list.get(i).setGrMaintenance("");
                }
                if(StringUtil.isBlank(list.get(i).getGrDowntrees())){
                    list.get(i).setGrDowntrees("");
                }
                if(StringUtil.isBlank(list.get(i).getGrPlantruning())){
                    list.get(i).setGrPlantruning("");
                }
                if(StringUtil.isBlank(list.get(i).getGrWitheeds())){
                    list.get(i).setGrWitheeds("");
                }
                if(StringUtil.isBlank(list.get(i).getGrPlantdeath())){
                    list.get(i).setGrPlantdeath("");
                }
                if(StringUtil.isBlank(list.get(i).getGrLoess())){
                    list.get(i).setGrLoess("");
                }
                if(StringUtil.isBlank(list.get(i).getGrSeedlingloss())){
                    list.get(i).setGrSeedlingloss("");
                }
                if(StringUtil.isBlank(list.get(i).getGrFewplant())){
                    list.get(i).setGrFewplant("");
                }
                if(StringUtil.isBlank(list.get(i).getGrUnreasonable())){
                    list.get(i).setGrUnreasonable("");
                }
                if(StringUtil.isBlank(list.get(i).getGrServiceimage())){
                    list.get(i).setGrServiceimage("");
                }
                if(StringUtil.isBlank(list.get(i).getClUnrplagacans())){
                    list.get(i).setClUnrplagacans("");
                }
                if(StringUtil.isBlank(list.get(i).getClRemovaon())){
                    list.get(i).setClRemovaon("");
                }
                if(StringUtil.isBlank(list.get(i).getClOutdoorpublic())){
                    list.get(i).setClOutdoorpublic("");
                }
                if(StringUtil.isBlank(list.get(i).getClBuilinterior())){
                    list.get(i).setClBuilinterior("");
                }
                if(StringUtil.isBlank(list.get(i).getClGarcleang())){
                    list.get(i).setClGarcleang("");
                }
                if(StringUtil.isBlank(list.get(i).getClWaterscape())){
                    list.get(i).setClWaterscape("");
                }
                if(StringUtil.isBlank(list.get(i).getClFpelimination())){
                    list.get(i).setClFpelimination("");
                }
                if(StringUtil.isBlank(list.get(i).getClCleanupaccu())){
                    list.get(i).setClCleanupaccu("");
                }
                if(StringUtil.isBlank(list.get(i).getClServiceimage())){
                    list.get(i).setClServiceimage("");
                }
                if(StringUtil.isBlank(list.get(i).getEnPuicliting())){
                    list.get(i).setEnPuicliting("");
                }
                if(StringUtil.isBlank(list.get(i).getEnAmusement())){
                    list.get(i).setEnAmusement("");
                }
                if(StringUtil.isBlank(list.get(i).getEnElevator())){
                    list.get(i).setEnElevator("");
                }
                if(StringUtil.isBlank(list.get(i).getEnWaterupply())){
                    list.get(i).setEnWaterupply("");
                }
                if(StringUtil.isBlank(list.get(i).getEnFireighting())){
                    list.get(i).setEnFireighting("");
                }
                if(StringUtil.isBlank(list.get(i).getEnMonitoring())){
                    list.get(i).setEnMonitoring("");
                }
                if(StringUtil.isBlank(list.get(i).getEnAccessconol())){
                    list.get(i).setEnAccessconol("");
                }
                if(StringUtil.isBlank(list.get(i).getEnRoadgate())){
                    list.get(i).setEnRoadgate("");
                }
                if(StringUtil.isBlank(list.get(i).getEnPublicarea())){
                    list.get(i).setEnPublicarea("");
                }
                if(StringUtil.isBlank(list.get(i).getEnDrainage())){
                    list.get(i).setEnDrainage("");
                }
                if(StringUtil.isBlank(list.get(i).getEnImageatude())){
                    list.get(i).setEnImageatude("");
                }
                if(StringUtil.isBlank(list.get(i).getEnHomemainte())){
                    list.get(i).setEnHomemainte("");
                }


                if (StringUtil.isBlank(list.get(i).getChAblecharge())) {
                    list.get(i).setChAblecharge("");
                }
                if (StringUtil.isBlank(list.get(i).getComPublicbene())) {
                    list.get(i).setComPublicbene("");
                }
                if (StringUtil.isBlank(list.get(i).getComNonstandard())) {
                    list.get(i).setComNonstandard("");
                }
                if (StringUtil.isBlank(list.get(i).getComOperation())) {
                    list.get(i).setComOperation("");
                }
                if (StringUtil.isBlank(list.get(i).getSoActiveffect())) {
                    list.get(i).setSoActiveffect("");
                }
                if (StringUtil.isBlank(list.get(i).getSoNotification())) {
                    list.get(i).setSoNotification("");
                }
                if (StringUtil.isBlank(list.get(i).getSoActivitycon())) {
                    list.get(i).setSoActivitycon("");
                }
                if (StringUtil.isBlank(list.get(i).getHoNdoorhouse())) {
                    list.get(i).setHoNdoorhouse("");
                }
                if (StringUtil.isBlank(list.get(i).getHoQuaproblems())) {
                    list.get(i).setHoQuaproblems("");
                }
                if (StringUtil.isBlank(list.get(i).getHoSales())) {
                    list.get(i).setHoSales("");
                }
                if (StringUtil.isBlank(list.get(i).getHoNotsatisf())) {
                    list.get(i).setHoNotsatisf("");
                }

                if (StringUtil.isBlank(list.get(i).getHoUnplanning())) {
                    list.get(i).setHoUnplanning("");
                }
                if (StringUtil.isBlank(list.get(i).getHoRightcertifi())) {
                    list.get(i).setHoRightcertifi("");
                }
                if (StringUtil.isBlank(list.get(i).getJtIndoorand())) {
                    list.get(i).setJtIndoorand("");
                }
                if (StringUtil.isBlank(list.get(i).getJtCesother())) {
                    list.get(i).setJtCesother("");
                }
                if (StringUtil.isBlank(list.get(i).getYjTenanily())) {
                    list.get(i).setYjTenanily("");
                }
                if (StringUtil.isBlank(list.get(i).getSzMunicipa())) {
                    list.get(i).setSzMunicipa("");
                }

                if (StringUtil.isBlank(list.get(i).getSzSurrounding())) {
                    list.get(i).setSzSurrounding("");
                }
                if (StringUtil.isBlank(list.get(i).getGxPersonalized())) {
                    list.get(i).setGxPersonalized("");
                }

                if (StringUtil.isBlank(list.get(i).getGxStandard())) {
                    list.get(i).setGxStandard("");
                }

                if (StringUtil.isBlank(list.get(i).getQtOtherfactors())) {
                    list.get(i).setQtOtherfactors("");
                }
            }
            /*NumberFormat df = NumberFormat.getNumberInstance();
            df.setMaximumFractionDigits(2);
            for (int i = 0; i < list.size(); i++) {
                if (StringUtil.isNotBlank(list.get(i).getSeVpapr())) {
                    list.get(i).setSeVpapr(String.valueOf(df.format(Double.valueOf(list.get(i).getSeVpapr()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getSeLlegal())) {
                    list.get(i).setSeLlegal(String.valueOf(df.format(Double.valueOf(list.get(i).getSeLlegal()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getSePet())) {
                    list.get(i).setSePet(String.valueOf(df.format(Double.valueOf(list.get(i).getSePet()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getSeNoise())) {
                    list.get(i).setSeNoise(String.valueOf(df.format(Double.valueOf(list.get(i).getSeNoise()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getSeNonresid())) {
                    list.get(i).setSeNonresid(String.valueOf(df.format(Double.valueOf(list.get(i).getSeNonresid()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getSeOtheroise())) {
                    list.get(i).setSeOtheroise(String.valueOf(df.format(Double.valueOf(list.get(i).getSeOtheroise()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getSeCardchecking())) {
                    list.get(i).setSeCardchecking(String.valueOf(df.format(Double.valueOf(list.get(i).getSeCardchecking()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getSeFireman())) {
                    list.get(i).setSeFireman(String.valueOf(df.format(Double.valueOf(list.get(i).getSeFireman()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getSeLlechaing())) {
                    list.get(i).setSeLlechaing(String.valueOf(df.format(Double.valueOf(list.get(i).getSeLlechaing()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getSeSense())) {
                    list.get(i).setSeSense(String.valueOf(df.format(Double.valueOf(list.get(i).getSeSense()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getSePostwork())) {
                    list.get(i).setSePostwork(String.valueOf(df.format(Double.valueOf(list.get(i).getSePostwork()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getSePooratitude())) {
                    list.get(i).setSePooratitude(String.valueOf(df.format(Double.valueOf(list.get(i).getSePooratitude()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getSeConsciousness())) {
                    list.get(i).setSeConsciousness(String.valueOf(df.format(Double.valueOf(list.get(i).getSeConsciousness()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getCuStafhad())) {
                    list.get(i).setCuStafhad(String.valueOf(df.format(Double.valueOf(list.get(i).getCuStafhad()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getCuFrontdesk())) {
                    list.get(i).setCuFrontdesk(String.valueOf(df.format(Double.valueOf(list.get(i).getCuFrontdesk()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getCuHousekeeper())) {
                    list.get(i).setCuHousekeeper(String.valueOf(df.format(Double.valueOf(list.get(i).getCuHousekeeper()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getCuConhouse())) {
                    list.get(i).setCuConhouse(String.valueOf(df.format(Double.valueOf(list.get(i).getCuConhouse()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getCuProblemfollow())) {
                    list.get(i).setCuProblemfollow(String.valueOf(df.format(Double.valueOf(list.get(i).getCuProblemfollow()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getCuFrequently())) {
                    list.get(i).setCuFrequently(String.valueOf(df.format(Double.valueOf(list.get(i).getCuFrequently()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getCuFrbujidesk())) {
                    list.get(i).setCuFrbujidesk(String.valueOf(df.format(Double.valueOf(list.get(i).getCuFrbujidesk()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getGrMaintenance())) {
                    list.get(i).setGrMaintenance(String.valueOf(df.format(Double.valueOf(list.get(i).getGrMaintenance()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getGrDowntrees())) {
                    list.get(i).setGrDowntrees(String.valueOf(df.format(Double.valueOf(list.get(i).getGrDowntrees()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getGrPlantruning())) {
                    list.get(i).setGrPlantruning(String.valueOf(df.format(Double.valueOf(list.get(i).getGrPlantruning()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getGrWitheeds())) {
                    list.get(i).setGrWitheeds(String.valueOf(df.format(Double.valueOf(list.get(i).getGrWitheeds()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getGrPlantdeath())) {
                    list.get(i).setGrPlantdeath(String.valueOf(df.format(Double.valueOf(list.get(i).getGrPlantdeath()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getGrLoess())) {
                    list.get(i).setGrLoess(String.valueOf(df.format(Double.valueOf(list.get(i).getGrLoess()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getGrSeedlingloss())) {
                    list.get(i).setGrSeedlingloss(String.valueOf(df.format(Double.valueOf(list.get(i).getGrSeedlingloss()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getGrFewplant())) {
                    list.get(i).setGrFewplant(String.valueOf(df.format(Double.valueOf(list.get(i).getGrFewplant()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getGrUnreasonable())) {
                    list.get(i).setGrUnreasonable(String.valueOf(df.format(Double.valueOf(list.get(i).getGrUnreasonable()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getGrServiceimage())) {
                    list.get(i).setGrServiceimage(String.valueOf(df.format(Double.valueOf(list.get(i).getGrServiceimage()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getClUnrplagacans())) {
                    list.get(i).setClUnrplagacans(String.valueOf(df.format(Double.valueOf(list.get(i).getClUnrplagacans()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getClRemovaon())) {
                    list.get(i).setClRemovaon(String.valueOf(df.format(Double.valueOf(list.get(i).getClRemovaon()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getClOutdoorpublic())) {
                    list.get(i).setClOutdoorpublic(String.valueOf(df.format(Double.valueOf(list.get(i).getClOutdoorpublic()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getClBuilinterior())) {
                    list.get(i).setClBuilinterior(String.valueOf(df.format(Double.valueOf(list.get(i).getClBuilinterior()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getClGarcleang())) {
                    list.get(i).setClGarcleang(String.valueOf(df.format(Double.valueOf(list.get(i).getClGarcleang()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getClWaterscape())) {
                    list.get(i).setClWaterscape(String.valueOf(df.format(Double.valueOf(list.get(i).getClWaterscape()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getClFpelimination())) {
                    list.get(i).setClFpelimination(String.valueOf(df.format(Double.valueOf(list.get(i).getClFpelimination()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getClCleanupaccu())) {
                    list.get(i).setClCleanupaccu(String.valueOf(df.format(Double.valueOf(list.get(i).getClCleanupaccu()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getClServiceimage())) {
                    list.get(i).setClServiceimage(String.valueOf(df.format(Double.valueOf(list.get(i).getClServiceimage()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getEnPuicliting())) {
                    list.get(i).setEnPuicliting(String.valueOf(df.format(Double.valueOf(list.get(i).getEnPuicliting()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getEnAmusement())) {
                    list.get(i).setEnAmusement(String.valueOf(df.format(Double.valueOf(list.get(i).getEnAmusement()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getEnElevator())) {
                    list.get(i).setEnElevator(String.valueOf(df.format(Double.valueOf(list.get(i).getEnElevator()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getEnWaterupply())) {
                    list.get(i).setEnWaterupply(String.valueOf(df.format(Double.valueOf(list.get(i).getEnWaterupply()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getEnFireighting())) {
                    list.get(i).setEnFireighting(String.valueOf(df.format(Double.valueOf(list.get(i).getEnFireighting()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getEnMonitoring())) {
                    list.get(i).setEnMonitoring(String.valueOf(df.format(Double.valueOf(list.get(i).getEnMonitoring()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getEnAccessconol())) {
                    list.get(i).setEnAccessconol(String.valueOf(df.format(Double.valueOf(list.get(i).getEnAccessconol()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getEnRoadgate())) {
                    list.get(i).setEnRoadgate(String.valueOf(df.format(Double.valueOf(list.get(i).getEnRoadgate()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getEnPublicarea())) {
                    list.get(i).setEnPublicarea(String.valueOf(df.format(Double.valueOf(list.get(i).getEnPublicarea()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getEnDrainage())) {
                    list.get(i).setEnDrainage(String.valueOf(df.format(Double.valueOf(list.get(i).getEnDrainage()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getEnImageatude())) {
                    list.get(i).setEnImageatude(String.valueOf(df.format(Double.valueOf(list.get(i).getEnImageatude()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getEnHomemainte())) {
                    list.get(i).setEnHomemainte(String.valueOf(df.format(Double.valueOf(list.get(i).getEnHomemainte()) * 100)));
                }


                if (StringUtil.isNotBlank(list.get(i).getChAblecharge())) {
                    list.get(i).setChAblecharge(String.valueOf(df.format(Double.valueOf(list.get(i).getChAblecharge()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getComPublicbene())) {
                    list.get(i).setComPublicbene(String.valueOf(df.format(Double.valueOf(list.get(i).getComPublicbene()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getComNonstandard())) {
                    list.get(i).setComNonstandard(String.valueOf(df.format(Double.valueOf(list.get(i).getComNonstandard()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getComOperation())) {
                    list.get(i).setComOperation(String.valueOf(df.format(Double.valueOf(list.get(i).getComOperation()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getSoActiveffect())) {
                    list.get(i).setSoActiveffect(String.valueOf(df.format(Double.valueOf(list.get(i).getSoActiveffect()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getSoNotification())) {
                    list.get(i).setSoNotification(String.valueOf(df.format(Double.valueOf(list.get(i).getSoNotification()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getSoActivitycon())) {
                    list.get(i).setSoActivitycon(String.valueOf(df.format(Double.valueOf(list.get(i).getSoActivitycon()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getHoNdoorhouse())) {
                    list.get(i).setHoNdoorhouse(String.valueOf(df.format(Double.valueOf(list.get(i).getHoNdoorhouse()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getHoQuaproblems())) {
                    list.get(i).setHoQuaproblems(String.valueOf(df.format(Double.valueOf(list.get(i).getHoQuaproblems()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getHoSales())) {
                    list.get(i).setHoSales(String.valueOf(df.format(Double.valueOf(list.get(i).getHoSales()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getHoNotsatisf())) {
                    list.get(i).setHoNotsatisf(String.valueOf(df.format(Double.valueOf(list.get(i).getHoNotsatisf()) * 100)));
                }

                if (StringUtil.isNotBlank(list.get(i).getHoUnplanning())) {
                    list.get(i).setHoUnplanning(String.valueOf(df.format(Double.valueOf(list.get(i).getHoUnplanning()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getHoRightcertifi())) {
                    list.get(i).setHoRightcertifi(String.valueOf(df.format(Double.valueOf(list.get(i).getHoRightcertifi()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getJtIndoorand())) {
                    list.get(i).setJtIndoorand(String.valueOf(df.format(Double.valueOf(list.get(i).getJtIndoorand()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getJtCesother())) {
                    list.get(i).setJtCesother(String.valueOf(df.format(Double.valueOf(list.get(i).getJtCesother()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getYjTenanily())) {
                    list.get(i).setYjTenanily(String.valueOf(df.format(Double.valueOf(list.get(i).getYjTenanily()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getSzMunicipa())) {
                    list.get(i).setSzMunicipa(String.valueOf(df.format(Double.valueOf(list.get(i).getSzMunicipa()) * 100)));
                }

                if (StringUtil.isNotBlank(list.get(i).getSzSurrounding())) {
                    list.get(i).setSzSurrounding(String.valueOf(df.format(Double.valueOf(list.get(i).getSzSurrounding()) * 100)));
                }
                if (StringUtil.isNotBlank(list.get(i).getGxPersonalized())) {
                    list.get(i).setGxPersonalized(String.valueOf(df.format(Double.valueOf(list.get(i).getGxPersonalized()) * 100)));
                }

                if (StringUtil.isNotBlank(list.get(i).getGxStandard())) {
                    list.get(i).setGxStandard(String.valueOf(df.format(Double.valueOf(list.get(i).getGxStandard()) * 100)));
                }

                if (StringUtil.isNotBlank(list.get(i).getQtOtherfactors())) {
                    list.get(i).setQtOtherfactors(String.valueOf(df.format(Double.valueOf(list.get(i).getQtOtherfactors()) * 100)));
                }

            }*/
            satiseDTO.setList(list);

            for (int i = 0; i < listBiao.size(); i++) {
                Map<String,String> mapSt=new HashMap<>();
                mapSt.put(listBiao.get(i).getKey(),listBiao.get(i).getValue());
                lima.add(mapSt);
            }
            satiseDTO.setName(lima);
        }

        return Response.response(satiseDTO);
    }

    @Override
    public Result detailed(Long id, String line, AccessToken accessToken) {
        List<SatisfiedDissatisfiedProject> list=new ArrayList<>();
        Condition condition = new Condition(SatisfiedDissatisfiedProject.class);
        Example.Criteria criteria = condition.createCriteria();
        criteria.andEqualTo("id",id);

        List<SatisfiedDissatisfiedProject> listBiao=satisfiedDissatisfiedProjectMapper.listBiao();

        List<SatisfactionDisplayDTO> liser=new ArrayList<>();
        SatisfactionDisplayDTO displayDTO=null;

        if(line.equals("全部")){
            list=satisfiedDissatisfiedProjectMapper.selectByCondition(condition);
        }else if(line.equals("安防")){
            condition.setDistinct(true);
            condition.selectProperties("seVpapr","seLlegal","sePet","seNoise","seNonresid","seOtheroise","seCardchecking","seLaxcarking","seFireman","seLlechaing",
                    "seSense","sePostwork","sePooratitude","seConsciousness","yearMonth");
            list=satisfiedDissatisfiedProjectMapper.selectByCondition(condition);
        }else if(line.equals("保洁")){
            condition.setDistinct(true);
            condition.selectProperties("clUnrplagacans","clRemovaon","clOutdoorpublic","clBuilinterior","clGarcleang","clWaterscape","clFpelimination",
                    "clCleanupaccu","clServiceimage","yearMonth");
            list=satisfiedDissatisfiedProjectMapper.selectByCondition(condition);
        }else if(line.equals("绿化")){
            condition.setDistinct(true);
            condition.selectProperties("grGreenwaste","grMaintenance","grDowntrees","grPlantruning","grWitheeds","grPlantdeath","grLoess","grSeedlingloss"
                    ,"grFewplant","grUnreasonable","grServiceimage","yearMonth");
            list=satisfiedDissatisfiedProjectMapper.selectByCondition(condition);
        }else if(line.equals("客服")){
            condition.setDistinct(true);
            condition.selectProperties("cuStafhad","cuFrontdesk","cuHousekeeper","cuConhouse","cuProblemfollow","cuPoorachatide","cuFrequently","cuFrbujidesk","yearMonth");
            list=satisfiedDissatisfiedProjectMapper.selectByCondition(condition);
        }else if(line.equals("工程")){
            condition.setDistinct(true);
            condition.selectProperties("enPuicliting","enAmusement","enElevator","enWaterupply","enFireighting","enMonitoring","enAccessconol","enRoadgate",
                    "enPublicarea","enDrainage","enEquipment","enImageatude","enHomemainte",
                    "yearMonth");
            list=satisfiedDissatisfiedProjectMapper.selectByCondition(condition);
        }else if(line.equals("其他")){
            condition.setDistinct(true);
            condition.selectProperties("chAblecharge"
                    ,"comPublicbene","comNonstandard","comOperation","soActiveffect","soNotification","soActivitycon","hoNdoorhouse","hoQuaproblems",
                    "hoSales","hoNotsatisf","hoUnplanning","hoRightcertifi","jtIndoorand","jtCesother","yjTenanily",
                    "yjDispuween","yjDiwuuyutre","szMunicipa","szSurrounding","gxPersonalized","gxStandard","qtOtherfactors",
                    "yearMonth");
            list=satisfiedDissatisfiedProjectMapper.selectByCondition(condition);
        }
        NumberFormat df = NumberFormat.getNumberInstance();
        df.setMaximumFractionDigits(2);
        JSONArray jsonArray=JSONArray.fromObject(list);
        Iterator i1 = jsonArray.iterator();
        for (int i = 0; i <listBiao.size() ; i++) {
            for (int j = 0; j < jsonArray.size(); j++) {
                JSONObject job = jsonArray.getJSONObject(j);
                Iterator keys = job.keys();
                while(keys.hasNext()){
                    String key=keys.next().toString();
                    if(listBiao.get(i).getKey().equals(key)){
                        if(listBiao.get(i).getKey().equals("id") || listBiao.get(i).getKey().equals("status") || listBiao.get(i).getKey().equals("yearMonth")){
                            continue;
                        }
                        displayDTO=new SatisfactionDisplayDTO();
                        displayDTO.setName(listBiao.get(i).getValue());
                        if(StringUtil.isNotBlank(job.getString(key))){
                            displayDTO.setRecord(df.format(Double.valueOf(job.getString(key))*100)+"%");
                        }else {
                            displayDTO.setRecord(job.getString(key));

                        }
                        if(StringUtil.isNotBlank(job.getString(key))){
                            liser.add(displayDTO);
                        }
                    }
                }
            }
        }
        return Response.response(liser);
    }

    @Override
    public Result edit(SatisfiedDissatisfiedProject satisfiedDissatisfiedProject, AccessToken accessToken) {

        String s=null;
        Double sd=null;

        NumberFormat df = NumberFormat.getNumberInstance();
        df.setMaximumFractionDigits(5);


        if(satisfiedDissatisfiedProject.getSeVpapr().equals("/")){
            satisfiedDissatisfiedProject.setSeVpapr("");
        }else if(satisfiedDissatisfiedProject.getSeVpapr().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getSeVpapr();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setSeVpapr(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getSeLlegal().equals("/")){
            satisfiedDissatisfiedProject.setSeLlegal("");
        }else if(satisfiedDissatisfiedProject.getSeLlegal().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getSeLlegal();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setSeLlegal(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getSePet().equals("/")){
            satisfiedDissatisfiedProject.setSePet("");
        }else if(satisfiedDissatisfiedProject.getSePet().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getSePet();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setSePet(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getSeNoise().equals("/")){
            satisfiedDissatisfiedProject.setSeNoise("");
        }else if(satisfiedDissatisfiedProject.getSeNoise().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getSeNoise();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setSeNoise(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getSeNonresid().equals("/")){
            satisfiedDissatisfiedProject.setSeNonresid("");
        }else if(satisfiedDissatisfiedProject.getSeNonresid().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getSeNonresid();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setSeNonresid(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getSeOtheroise().equals("/")){
            satisfiedDissatisfiedProject.setSeOtheroise("");
        }else if(satisfiedDissatisfiedProject.getSeOtheroise().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getSeOtheroise();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setSeOtheroise(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getSeCardchecking().equals("/")){
            satisfiedDissatisfiedProject.setSeCardchecking("");
        }else if(satisfiedDissatisfiedProject.getSeCardchecking().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getSeCardchecking();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setSeCardchecking(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getSeLaxcarking().equals("/")){
            satisfiedDissatisfiedProject.setSeLaxcarking("");
        }else if(satisfiedDissatisfiedProject.getSeLaxcarking().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getSeLaxcarking();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setSeLaxcarking(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getSeFireman().equals("/")){
            satisfiedDissatisfiedProject.setSeFireman("");
        }else if(satisfiedDissatisfiedProject.getSeFireman().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getSeFireman();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setSeFireman(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getSeLlechaing().equals("/")){
            satisfiedDissatisfiedProject.setSeLlechaing("");
        }else if(satisfiedDissatisfiedProject.getSeLlechaing().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getSeLlechaing();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setSeLlechaing(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getSeSense().equals("/")){
            satisfiedDissatisfiedProject.setSeSense("");
        }else if(satisfiedDissatisfiedProject.getSeSense().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getSeSense();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setSeSense(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getSePostwork().equals("/")){
            satisfiedDissatisfiedProject.setSePostwork("");
        }else if(satisfiedDissatisfiedProject.getSePostwork().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getSePostwork();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setSePostwork(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getSePooratitude().equals("/")){
            satisfiedDissatisfiedProject.setSePooratitude("");
        }else if(satisfiedDissatisfiedProject.getSePooratitude().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getSePooratitude();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setSePooratitude(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getSeConsciousness().equals("/")){
            satisfiedDissatisfiedProject.setSeConsciousness("");
        }else if(satisfiedDissatisfiedProject.getSeConsciousness().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getSeConsciousness();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setSeConsciousness(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getCuStafhad().equals("/")){
            satisfiedDissatisfiedProject.setCuStafhad("");
        }else if(satisfiedDissatisfiedProject.getCuStafhad().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getCuStafhad();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setCuStafhad(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getCuFrontdesk().equals("/")){
            satisfiedDissatisfiedProject.setCuFrontdesk("");
        }else if(satisfiedDissatisfiedProject.getCuFrontdesk().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getCuFrontdesk();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setCuFrontdesk(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getCuHousekeeper().equals("/")){
            satisfiedDissatisfiedProject.setCuHousekeeper("");
        }else if(satisfiedDissatisfiedProject.getCuHousekeeper().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getCuHousekeeper();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setCuHousekeeper(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getCuConhouse().equals("/")){
            satisfiedDissatisfiedProject.setCuConhouse("");
        }else if(satisfiedDissatisfiedProject.getCuConhouse().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getCuConhouse();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setCuConhouse(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getCuProblemfollow().equals("/")){
            satisfiedDissatisfiedProject.setCuProblemfollow("");
        }else if(satisfiedDissatisfiedProject.getCuProblemfollow().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getCuProblemfollow();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setCuProblemfollow(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getCuPoorachatide().equals("/")){
            satisfiedDissatisfiedProject.setCuPoorachatide("");
        }else if(satisfiedDissatisfiedProject.getCuPoorachatide().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getCuPoorachatide();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setCuPoorachatide(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getCuFrequently().equals("/")){
            satisfiedDissatisfiedProject.setCuFrequently("");
        }else if(satisfiedDissatisfiedProject.getCuFrequently().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getCuFrequently();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setCuFrequently(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getCuFrbujidesk().equals("/")){
            satisfiedDissatisfiedProject.setCuFrbujidesk("");
        }else if(satisfiedDissatisfiedProject.getCuFrbujidesk().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getCuFrbujidesk();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setCuFrbujidesk(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getGrGreenwaste().equals("/")){
            satisfiedDissatisfiedProject.setGrGreenwaste("");
        }else if(satisfiedDissatisfiedProject.getGrGreenwaste().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getGrGreenwaste();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setGrGreenwaste(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getGrMaintenance().equals("/")){
            satisfiedDissatisfiedProject.setGrMaintenance("");
        }else if(satisfiedDissatisfiedProject.getGrMaintenance().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getGrMaintenance();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setGrMaintenance(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getGrDowntrees().equals("/")){
            satisfiedDissatisfiedProject.setGrDowntrees("");
        }else if(satisfiedDissatisfiedProject.getGrDowntrees().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getGrDowntrees();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setGrDowntrees(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getGrPlantruning().equals("/")){
            satisfiedDissatisfiedProject.setGrPlantruning("");
        }else if(satisfiedDissatisfiedProject.getGrPlantruning().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getGrPlantruning();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setGrPlantruning(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getGrWitheeds().equals("/")){
            satisfiedDissatisfiedProject.setGrWitheeds("");
        }else if(satisfiedDissatisfiedProject.getGrWitheeds().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getGrWitheeds();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setGrWitheeds(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getGrPlantdeath().equals("/")){
            satisfiedDissatisfiedProject.setGrPlantdeath("");
        }else if(satisfiedDissatisfiedProject.getGrPlantdeath().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getGrPlantdeath();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setGrPlantdeath(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getGrLoess().equals("/")){
            satisfiedDissatisfiedProject.setGrLoess("");
        }else if(satisfiedDissatisfiedProject.getGrLoess().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getGrLoess();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setGrLoess(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getGrSeedlingloss().equals("/")){
            satisfiedDissatisfiedProject.setGrSeedlingloss("");
        }else if(satisfiedDissatisfiedProject.getGrSeedlingloss().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getGrSeedlingloss();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setGrSeedlingloss(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getGrFewplant().equals("/")){
            satisfiedDissatisfiedProject.setGrFewplant("");
        }else if(satisfiedDissatisfiedProject.getGrFewplant().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getGrFewplant();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setGrFewplant(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getGrUnreasonable().equals("/")){
            satisfiedDissatisfiedProject.setGrUnreasonable("");
        }else if(satisfiedDissatisfiedProject.getGrUnreasonable().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getGrUnreasonable();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setGrUnreasonable(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getGrServiceimage().equals("/")){
            satisfiedDissatisfiedProject.setGrServiceimage("");
        }else if(satisfiedDissatisfiedProject.getGrServiceimage().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getGrServiceimage();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setGrServiceimage(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getClUnrplagacans().equals("/")){
            satisfiedDissatisfiedProject.setClUnrplagacans("");
        }else if(satisfiedDissatisfiedProject.getClUnrplagacans().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getClUnrplagacans();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setClUnrplagacans(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getClRemovaon().equals("/")){
            satisfiedDissatisfiedProject.setClRemovaon("");
        }else if(satisfiedDissatisfiedProject.getClRemovaon().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getClRemovaon();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setClRemovaon(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getClOutdoorpublic().equals("/")){
            satisfiedDissatisfiedProject.setClOutdoorpublic("");
        }else if(satisfiedDissatisfiedProject.getClOutdoorpublic().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getClOutdoorpublic();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setClOutdoorpublic(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getClBuilinterior().equals("/")){
            satisfiedDissatisfiedProject.setClBuilinterior("");
        }else if(satisfiedDissatisfiedProject.getClBuilinterior().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getClBuilinterior();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setClBuilinterior(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getClGarcleang().equals("/")){
            satisfiedDissatisfiedProject.setClGarcleang("");
        }else if(satisfiedDissatisfiedProject.getClGarcleang().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getClGarcleang();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setClGarcleang(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getClWaterscape().equals("/")){
            satisfiedDissatisfiedProject.setClWaterscape("");
        }else if(satisfiedDissatisfiedProject.getClWaterscape().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getClWaterscape();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setClWaterscape(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getClFpelimination().equals("/")){
            satisfiedDissatisfiedProject.setClFpelimination("");
        }else if(satisfiedDissatisfiedProject.getClFpelimination().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getClFpelimination();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setClFpelimination(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getClCleanupaccu().equals("/")){
            satisfiedDissatisfiedProject.setClCleanupaccu("");
        }else if(satisfiedDissatisfiedProject.getClCleanupaccu().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getClCleanupaccu();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setClCleanupaccu(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getClServiceimage().equals("/")){
            satisfiedDissatisfiedProject.setClServiceimage("");
        }else if(satisfiedDissatisfiedProject.getClServiceimage().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getClServiceimage();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setClServiceimage(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getEnPuicliting().equals("/")){
            satisfiedDissatisfiedProject.setEnPuicliting("");
        }else if(satisfiedDissatisfiedProject.getEnPuicliting().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getEnPuicliting();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setEnPuicliting(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getEnAmusement().equals("/")){
            satisfiedDissatisfiedProject.setEnAmusement("");
        }else if(satisfiedDissatisfiedProject.getEnAmusement().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getEnAmusement();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setEnAmusement(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getEnElevator().equals("/")){
            satisfiedDissatisfiedProject.setEnElevator("");
        }else if(satisfiedDissatisfiedProject.getEnElevator().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getEnElevator();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setEnElevator(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getEnWaterupply().equals("/")){
            satisfiedDissatisfiedProject.setEnWaterupply("");
        }else if(satisfiedDissatisfiedProject.getEnWaterupply().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getEnWaterupply();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setEnWaterupply(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getEnFireighting().equals("/")){
            satisfiedDissatisfiedProject.setEnFireighting("");
        }else if(satisfiedDissatisfiedProject.getEnFireighting().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getEnFireighting();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setEnFireighting(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getEnMonitoring().equals("/")){
            satisfiedDissatisfiedProject.setEnMonitoring("");
        }else if(satisfiedDissatisfiedProject.getEnMonitoring().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getEnMonitoring();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setEnMonitoring(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getEnAccessconol().equals("/")){
            satisfiedDissatisfiedProject.setEnAccessconol("");
        }else if(satisfiedDissatisfiedProject.getEnAccessconol().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getEnAccessconol();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setEnAccessconol(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getEnRoadgate().equals("/")){
            satisfiedDissatisfiedProject.setEnRoadgate("");
        }else if(satisfiedDissatisfiedProject.getEnRoadgate().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getEnRoadgate();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setEnRoadgate(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getEnPublicarea().equals("/")){
            satisfiedDissatisfiedProject.setEnPublicarea("");
        }else if(satisfiedDissatisfiedProject.getEnPublicarea().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getEnPublicarea();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setEnPublicarea(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getEnDrainage().equals("/")){
            satisfiedDissatisfiedProject.setEnDrainage("");
        }else if(satisfiedDissatisfiedProject.getEnDrainage().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getEnDrainage();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setEnDrainage(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getEnEquipment().equals("/")){
            satisfiedDissatisfiedProject.setEnEquipment("");
        }else if(satisfiedDissatisfiedProject.getEnEquipment().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getEnEquipment();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setEnEquipment(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getEnImageatude().equals("/")){
            satisfiedDissatisfiedProject.setEnImageatude("");
        }else if(satisfiedDissatisfiedProject.getEnImageatude().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getEnImageatude();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setEnImageatude(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getEnHomemainte().equals("/")){
            satisfiedDissatisfiedProject.setEnHomemainte("");
        }else if(satisfiedDissatisfiedProject.getEnHomemainte().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getEnHomemainte();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setEnHomemainte(df.format(sd));
        }



        if(satisfiedDissatisfiedProject.getChAblecharge().equals("/")){
            satisfiedDissatisfiedProject.setChAblecharge("");
        }else if(satisfiedDissatisfiedProject.getChAblecharge().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getChAblecharge();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setChAblecharge(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getComPublicbene().equals("/")){
            satisfiedDissatisfiedProject.setComPublicbene("");
        }else if(satisfiedDissatisfiedProject.getComPublicbene().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getComPublicbene();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setComPublicbene(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getComNonstandard().equals("/")){
            satisfiedDissatisfiedProject.setComNonstandard("");
        }else if(satisfiedDissatisfiedProject.getComNonstandard().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getComNonstandard();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setComNonstandard(df.format(sd));
        }


        if(satisfiedDissatisfiedProject.getComOperation().equals("/")){
            satisfiedDissatisfiedProject.setComOperation("");
        }else if(satisfiedDissatisfiedProject.getComOperation().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getComOperation();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setComOperation(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getSoActiveffect().equals("/")){
            satisfiedDissatisfiedProject.setSoActiveffect("");
        }else if(satisfiedDissatisfiedProject.getSoActiveffect().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getSoActiveffect();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setSoActiveffect(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getSoNotification().equals("/")){
            satisfiedDissatisfiedProject.setSoNotification("");
        }else if(satisfiedDissatisfiedProject.getSoNotification().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getSoNotification();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setSoNotification(df.format(sd));
        }


        if(satisfiedDissatisfiedProject.getSoActivitycon().equals("/")){
            satisfiedDissatisfiedProject.setSoActivitycon("");
        }else if(satisfiedDissatisfiedProject.getSoActivitycon().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getSoActivitycon();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setSoActivitycon(df.format(sd));
        }


        if(satisfiedDissatisfiedProject.getHoNdoorhouse().equals("/")){
            satisfiedDissatisfiedProject.setHoNdoorhouse("");
        }else if(satisfiedDissatisfiedProject.getHoNdoorhouse().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getHoNdoorhouse();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setHoNdoorhouse(df.format(sd));
        }


        if(satisfiedDissatisfiedProject.getHoQuaproblems().equals("/")){
            satisfiedDissatisfiedProject.setHoQuaproblems("");
        }else if(satisfiedDissatisfiedProject.getHoQuaproblems().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getHoQuaproblems();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setHoQuaproblems(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getHoSales().equals("/")){
            satisfiedDissatisfiedProject.setHoSales("");
        }else if(satisfiedDissatisfiedProject.getHoSales().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getHoSales();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setHoSales(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getHoNotsatisf().equals("/")){
            satisfiedDissatisfiedProject.setHoNotsatisf("");
        }else if(satisfiedDissatisfiedProject.getHoNotsatisf().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getHoNotsatisf();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setHoNotsatisf(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getHoUnplanning().equals("/")){
            satisfiedDissatisfiedProject.setHoUnplanning("");
        }else if(satisfiedDissatisfiedProject.getHoUnplanning().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getHoUnplanning();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setHoUnplanning(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getHoRightcertifi().equals("/")){
            satisfiedDissatisfiedProject.setHoRightcertifi("");
        }else if(satisfiedDissatisfiedProject.getHoRightcertifi().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getHoRightcertifi();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setHoRightcertifi(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getJtIndoorand().equals("/")){
            satisfiedDissatisfiedProject.setJtIndoorand("");
        }else if(satisfiedDissatisfiedProject.getJtIndoorand().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getJtIndoorand();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setJtIndoorand(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getJtCesother().equals("/")){
            satisfiedDissatisfiedProject.setJtCesother("");
        }else if(satisfiedDissatisfiedProject.getJtCesother().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getJtCesother();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setJtCesother(df.format(sd));
        }


        if(satisfiedDissatisfiedProject.getYjTenanily().equals("/")){
            satisfiedDissatisfiedProject.setYjTenanily("");
        }else if(satisfiedDissatisfiedProject.getYjTenanily().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getYjTenanily();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setYjTenanily(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getYjDispuween().equals("/")){
            satisfiedDissatisfiedProject.setYjDispuween("");
        }else if(satisfiedDissatisfiedProject.getYjDispuween().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getYjDispuween();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setYjDispuween(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getYjDiwuuyutre().equals("/")){
            satisfiedDissatisfiedProject.setYjDiwuuyutre("");
        }else if(satisfiedDissatisfiedProject.getYjDiwuuyutre().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getYjDiwuuyutre();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setYjDiwuuyutre(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getSzMunicipa().equals("/")){
            satisfiedDissatisfiedProject.setSzMunicipa("");
        }else if(satisfiedDissatisfiedProject.getSzMunicipa().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getSzMunicipa();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setSzMunicipa(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getSzSurrounding().equals("/")){
            satisfiedDissatisfiedProject.setSzSurrounding("");
        }else if(satisfiedDissatisfiedProject.getSzSurrounding().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getSzSurrounding();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setSzSurrounding(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getGxPersonalized().equals("/")){
            satisfiedDissatisfiedProject.setGxPersonalized("");
        }else if(satisfiedDissatisfiedProject.getGxPersonalized().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getGxPersonalized();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setGxPersonalized(df.format(sd));
        }

        if(satisfiedDissatisfiedProject.getGxStandard().equals("/")){
            satisfiedDissatisfiedProject.setGxStandard("");
        }else if(satisfiedDissatisfiedProject.getGxStandard().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getGxStandard();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setGxStandard(df.format(sd));
        }


        if(satisfiedDissatisfiedProject.getQtOtherfactors().equals("/")){
            satisfiedDissatisfiedProject.setQtOtherfactors("");
        }else if(satisfiedDissatisfiedProject.getQtOtherfactors().indexOf("%")!=-1){
            s = satisfiedDissatisfiedProject.getQtOtherfactors();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedProject.setQtOtherfactors(df.format(sd));
        }
        TbSysUser tbSysUser = tbSysUserMapper.findByUserCodeNew(accessToken.getUserCode());
        satisfiedDissatisfiedProject.setIsEditor(1);
        satisfiedDissatisfiedProject.setUpdateTime(new Date());
        satisfiedDissatisfiedProject.setUpdateBy(tbSysUser.getUserName());
        satisfiedDissatisfiedProjectMapper.updateByPrimaryKeySelective(satisfiedDissatisfiedProject);

        return Response.response();
    }

    @Override
    public Result del(String id, AccessToken accessToken) {
        TbSysUser tbSysUser = tbSysUserMapper.findByUserCodeNew(accessToken.getUserCode());
        SatisfiedDissatisfiedProject satisfiedDissatisfiedProject=new SatisfiedDissatisfiedProject();
        satisfiedDissatisfiedProject.setId(Long.valueOf(id));
        satisfiedDissatisfiedProject.setStatus(0);
        satisfiedDissatisfiedProject.setUpdateTime(new Date());
        satisfiedDissatisfiedProject.setUpdateBy(tbSysUser.getUserName());
        satisfiedDissatisfiedProjectMapper.updateByPrimaryKeySelective(satisfiedDissatisfiedProject);
        return Response.response();
    }

    //身份认证
    public Result checkIdentity(String clientId, String timeString, String sign){
        ShareConfig share=new ShareConfig();
        share.setClientId(clientId);
        ShareConfig shareConfig = shareConfigMapper.selectOne(share);
        if(shareConfig ==null){
            return Response.responseFail("认证失败:客户端编码有误");
        }
        String clientSecret = shareConfig.getClientSecret();
        SimpleDateFormat sb=new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        try {
            String sd = sb.format(new Date(Long.valueOf(timeString+"000")));
            Date parse = sb.parse(sd);
            Date date=new Date();
            long l = date.getTime() - parse.getTime();
            if(l>5*60*1000){
                return Response.responseFail("参数错误:调用时间与参数时间不能超过5分钟");
            }
        }catch (Exception e){
            return Response.responseFail("参数错误:timeString格式有误");
        }

        String md5String =clientId+clientSecret+timeString;
        String s = MD5.GetMD5Code(md5String);
        if(!s.equals(sign)){
            return Response.responseFail("认证失败:签名错误");
        }
        return Response.response("认证成功");
    }


    public List<String> queryRoleCodes(String[] roles, String userCode) {
        //保洁模块的权限问题：admin=ck_admin>区域>项目>其他
        Condition condition = new Condition(UserRoles.class);
        condition.selectProperties("roleCode");
        Example.Criteria criteria = condition.createCriteria();
        criteria.andEqualTo("userCode", userCode);
        if (roles != null && roles.length > 0) {
            criteria.andIn("roleCode", Arrays.asList(roles));
        }

        List<UserRoles> rolesList = userRolesMapper.selectByCondition(condition);
        if (CollectionUtils.isNotEmpty(rolesList)) {
            return rolesList.stream().map(e -> e.getRoleCode()).collect(Collectors.toList());
        }
        // 权限不足
        throw new ServiceException("权限不足");
    }

}
