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.SatisfiedDissatisfiedRegionMapper;
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.SatisfiedDissatisfiedRegionDTO;
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.SatisfiedDissatisfiedRegion;
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.SatisfiedDissatisfiedRegionService;
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 SatisfiedDissatisfiedRegionServiceImpl implements SatisfiedDissatisfiedRegionService {

    @Autowired
    private SatisfiedDissatisfiedRegionMapper satisfiedDissatisfiedRegionMapper;

    @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(SatisfiedDissatisfiedRegion satisfiedDissatisfiedRegion, int page, int size, AccessToken accessToken) {
        List<String> rolesList = queryRoleCodes(null, accessToken.getUserCode());

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

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

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

            if(StringUtil.isNotBlank(satisfiedDissatisfiedRegion.getOrgCodeStr())){
                if(satisfiedDissatisfiedRegion.getOrgCodeStr().equals("0")){
                    satisfiedDissatisfiedRegion.setOrgCodeList(null);
                }else {
                    String[] org=satisfiedDissatisfiedRegion.getOrgCodeStr().split(",");
                    satisfiedDissatisfiedRegion.setOrgCodeList(Arrays.asList(org));
                }

            }

            Long toble=satisfiedDissatisfiedRegionMapper.selectListDataToble(satisfiedDissatisfiedRegion);

            Page<Object> pageList = PageHelper.startPage(page,size);
            List<SatisfiedDissatisfiedRegion> list=satisfiedDissatisfiedRegionMapper.queryPageList(satisfiedDissatisfiedRegion);

            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).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).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).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).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).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).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).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).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).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).getEnEquipment())){
                        list.get(i).setEnEquipment(String.valueOf(df.format(Double.valueOf(list.get(i).getEnEquipment())*100))+"%");
                    }else {
                        list.get(i).setEnEquipment("/");
                    }
                    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("/");
                    }



                }
            }


            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";
        }

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

        List<SatisfiedDissatisfiedRegion> listBiao=satisfiedDissatisfiedRegionMapper.listBiao();

        List<SatisfiedDissatisfiedRegion> list=satisfiedDissatisfiedRegionMapper.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("");
                }
            }
            /*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)));
                }
            }*/

            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<SatisfiedDissatisfiedRegion> list=new ArrayList<>();
        Condition condition = new Condition(SatisfiedDissatisfiedRegion.class);
        Example.Criteria criteria = condition.createCriteria();
        criteria.andEqualTo("id",id);


        List<SatisfiedDissatisfiedRegion> listBiao=satisfiedDissatisfiedRegionMapper.listBiao();

        List<SatisfactionDisplayDTO> liser=new ArrayList<>();
        SatisfactionDisplayDTO displayDTO=null;
        if(line.equals("全部")){
            list=satisfiedDissatisfiedRegionMapper.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=satisfiedDissatisfiedRegionMapper.selectByCondition(condition);
        }else if(line.equals("保洁")){
            condition.setDistinct(true);
            condition.selectProperties("clUnrplagacans","clRemovaon","clOutdoorpublic","clBuilinterior","clGarcleang","clWaterscape","clFpelimination",
                    "clCleanupaccu","clServiceimage","yearMonth");
            list=satisfiedDissatisfiedRegionMapper.selectByCondition(condition);
        }else if(line.equals("绿化")){
            condition.setDistinct(true);
            condition.selectProperties("grGreenwaste","grMaintenance","grDowntrees","grPlantruning","grWitheeds","grPlantdeath","grLoess","grSeedlingloss"
                    ,"grFewplant","grUnreasonable","grServiceimage","yearMonth");
            list=satisfiedDissatisfiedRegionMapper.selectByCondition(condition);
        }else if(line.equals("客服")){
            condition.setDistinct(true);
            condition.selectProperties("cuStafhad","cuFrontdesk","cuHousekeeper","cuConhouse","cuProblemfollow","cuPoorachatide","cuFrequently","cuFrbujidesk","yearMonth");
            list=satisfiedDissatisfiedRegionMapper.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=satisfiedDissatisfiedRegionMapper.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(SatisfiedDissatisfiedRegion satisfiedDissatisfiedRegion, AccessToken accessToken) {

        String s=null;
        Double sd=null;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if(satisfiedDissatisfiedRegion.getEnHomemainte().equals("/")){
            satisfiedDissatisfiedRegion.setEnHomemainte("");
        }else if(satisfiedDissatisfiedRegion.getEnHomemainte().indexOf("%")!=-1){
            s = satisfiedDissatisfiedRegion.getEnHomemainte();
            s = s.substring(0, s.length() - 1);
            sd=Double.valueOf(s);
            sd=sd/100;
            satisfiedDissatisfiedRegion.setEnHomemainte(df.format(sd));
        }
        TbSysUser tbSysUser = tbSysUserMapper.findByUserCodeNew(accessToken.getUserCode());
        satisfiedDissatisfiedRegion.setIsEditor(1);
        satisfiedDissatisfiedRegion.setUpdateTime(new Date());
        satisfiedDissatisfiedRegion.setUpdateBy(tbSysUser.getUserName());
        satisfiedDissatisfiedRegionMapper.updateByPrimaryKeySelective(satisfiedDissatisfiedRegion);
        return Response.response();
    }

    @Override
    public Result del(String id, AccessToken accessToken) {
        TbSysUser tbSysUser = tbSysUserMapper.findByUserCodeNew(accessToken.getUserCode());
        SatisfiedDissatisfiedRegion satisfiedDissatisfiedRegion=new SatisfiedDissatisfiedRegion();
        satisfiedDissatisfiedRegion.setId(Long.valueOf(id));
        satisfiedDissatisfiedRegion.setStatus(0);
        satisfiedDissatisfiedRegion.setUpdateTime(new Date());
        satisfiedDissatisfiedRegion.setUpdateBy(tbSysUser.getUserName());
        satisfiedDissatisfiedRegionMapper.updateByPrimaryKeySelective(satisfiedDissatisfiedRegion);
        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("权限不足");
    }
}
