package com.unis.intelligentManagement.modular.rgb.controller;

import com.github.xiaoymin.knife4j.annotations.ApiSupport;
import com.unis.common.pojo.CommonResult;
import com.unis.intelligentManagement.modular.rgb.entity.RequestGRB;
import com.unis.intelligentManagement.modular.rgb.entity.ResultTempMap;
import com.unis.intelligentManagement.modular.rgb.service.RGBTransformerService;
import io.swagger.annotations.Api;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.math.BigDecimal;
import java.util.*;

/*@Api(tags = "测温图")
@Slf4j
@RestController
@RequestMapping("/rgb")*/

@Api(tags = "测温图------------")
@RestController
public class RGBTransformerController {

    @Resource
    private RGBTransformerService rgbTransformerService;

    /**
     * 这个接口只提供查看测温数据结构
     *
     * @param z 获取哪层
     * @return ResultTempMap
     */
    @GetMapping("/getHot")
    public ResultTempMap hotPaint(int z,String lqData) {
        return rgbTransformerService.tempOrderly(z,lqData);
    }


    @PostMapping("/rgb/getRgb")
    public CommonResult<Map<String,Object>> getRgb(@RequestBody RequestGRB requestGRB) {
        // 接收请求参数 Integer canvasLength, Integer canvasWidth, double highest, double lowest
        Integer canvasLength = requestGRB.getCanvasLength();//画布的长
        Integer canvasWidth = requestGRB.getCanvasWidth();//画布的宽
        Double highest = requestGRB.getHighest();//最高温
        Double lowest = requestGRB.getLowest();//最低温

        Map<String, String> canvasMap = new LinkedHashMap<>();//  x-y
        Map<String, Object> resultMap = new LinkedHashMap<>();//  x-y
        Map<String, Object> wdMap = new HashMap<String,Object>();

        //获取数据
        ResultTempMap resultTempMap= rgbTransformerService.tempOrderly(requestGRB.getZ(),requestGRB.getLqData());
        int pointNumW = resultTempMap.getXSize(); //x 的测温点数
        int pointNumL = resultTempMap.getYSize();//y 的测温点数
        Map<String, Double> map = resultTempMap.getXOrderlyTemp();

        /*int pointNumW = 12;
        int pointNumL = 6;*/


        BigDecimal pointNumLBig = new BigDecimal(pointNumL);
        BigDecimal pointNumWBig = new BigDecimal(pointNumW);
        BigDecimal canvasLengthBig = new BigDecimal(canvasLength);
        BigDecimal canvasWidthBig = new BigDecimal(canvasWidth);
        BigDecimal oneBig = new BigDecimal(1);
        /*BigDecimal lengthRatioBig = canvasLengthBig.divide(pointNumLBig.add(oneBig), 0, BigDecimal.ROUND_DOWN);// 长 每个测温点之间的距离
        BigDecimal wideOne = pointNumWBig.add(oneBig);
        BigDecimal widthRatioBig = canvasWidthBig.divide(wideOne, 0, BigDecimal.ROUND_DOWN); //宽 每个测温点之间的距离
        int lengthRatio = Integer.parseInt(lengthRatioBig.toString()); //长 每个测温点之间的距离 四舍五入保留整数
        int widthRatio = Integer.parseInt(widthRatioBig.toString()); //宽 每个测温点之间的距离*/

        BigDecimal lengthRatioBig = canvasLengthBig.divide(pointNumWBig.add(oneBig), 0, BigDecimal.ROUND_DOWN);// 长 每个测温点之间的距离
        BigDecimal wideOne = pointNumLBig.add(oneBig);
        BigDecimal widthRatioBig = canvasWidthBig.divide(wideOne, 0, BigDecimal.ROUND_DOWN); //宽 每个测温点之间的距离
        int lengthRatio = Integer.parseInt(lengthRatioBig.toString()); //长 每个测温点之间的距离 四舍五入保留整数
        int widthRatio = Integer.parseInt(widthRatioBig.toString()); //宽 每个测温点之间的距离
        //System.out.println(lengthRatio+"***********"+widthRatio);




        /*Random rand = new Random();

        Map<String, Double> map = new LinkedHashMap<>();//  x-y
        for (int bb = 1; bb <= pointNumW; bb++) {
            for (int cc = 1; cc <= pointNumL; cc++) {
            	//(int)(10+Math.random()*(20-10+1))
                //map.put(bb + "-" + cc, (double) Math.round(((rand.nextDouble() * 40) * 100)) / 100);
            	map.put(bb + "-" + cc, (double) Math.round((-30+(Math.random()*(70)))));
            }
        }*/


        /**
         * 计算四个边的温度
         * avg1---最上面
         * avg2---最左面
         * avg3---最右面
         * avg4---最下面
         *
         * 取对应边测温点的平均值
         */
        double sum1 = 0;
        double sum2 = 0;
        double sum3 = 0;
        double sum4 = 0;
        double avg1 = 0;
        double avg2 = 0;
        double avg3 = 0;
        double avg4 = 0;
        int m = 0;
        int n = 0;
        int p = 0;
        int q = 0;
        for (String key : map.keySet()) {
            //最上面一行的平均值
            if (key.split("-")[0].equals("1")) {
                m++;
                sum1 += map.get(key);
            }
            //最左面一列的平均值
            if (key.split("-")[1].equals("1")) {
                n++;
                sum2 += map.get(key);
            }
        }

        for (String key : map.keySet()) {
            //最右面一列的平均值
            if (key.split("-")[1].equals(m + "")) {
                p++;
                sum3 += map.get(key);
            }
            //最下面一行的平均值
            if (key.split("-")[0].equals(n + "")) {
                q++;
                sum4 += map.get(key);
            }
        }

        avg1 = sum1 / m;
        avg1 = (double) Math.round(avg1 * 10) / 10;
        avg2 = sum2 / n;
        avg2 = (double) Math.round(avg2 * 10) / 10;
        avg3 = sum3 / p;
        avg3 = (double) Math.round(avg3 * 10) / 10;
        avg4 = sum4 / q;
        avg4 = (double) Math.round(avg4 * 10) / 10;


        double apex_angle_temp = 0;
        int a = 0;
        int kk = 0;
        int j, i, k;
        for (i = 0; i < canvasWidth; i++) {//宽
            for (j = 0; j < canvasLength; j++) {//长
                canvasMap.put(i + "-" + j, "255,255,255");
            }
        }

        /**
         * 给画布上的点赋值 线条
         */
        for (i = 0; i < canvasWidth; i += widthRatio) {//宽
            int b = 1;

            if (kk == pointNumW + 1) {
                break;
            }
            for (j = 0; j < canvasLength; j += lengthRatio) {//长

                if ((canvasLength - j) < lengthRatio) {
                    continue;
                }
                if (i == 0) {//最上面的边
                    if (j == 0) { //左上角的点
                        apex_angle_temp = (avg1 + avg2) / 2;//取所在行和列的平均值
                        apex_angle_temp = (double) Math.round(apex_angle_temp * 10) / 10;
                        canvasMap.put("0-0", rgbTransformerService.Temperature_RGB(apex_angle_temp, highest, lowest));
                    } else {//执行第一行除了起始点的
                        canvasMap.put(0 + "-" + j, rgbTransformerService.Temperature_RGB(avg1, highest, lowest));
                    }
                    continue;
                } else if (j == 0 && i != 0) { //最左面的边
                    if (i == canvasWidth - 1) {//左下角的点
                        apex_angle_temp = (avg2 + avg4) / 2;//取所在行和列的平均值
                        apex_angle_temp = (double) Math.round(apex_angle_temp * 10) / 10;
                        canvasMap.put(i + "-" + 0, rgbTransformerService.Temperature_RGB(apex_angle_temp, highest, lowest));
                    } else {
                        canvasMap.put(i + "-" + j, rgbTransformerService.Temperature_RGB(avg2, highest, lowest));
                    }
                    continue;
                }
                if (i != canvasWidth - 1) {
                    if (a > pointNumW || b > pointNumL) {
                        canvasMap.put(i + "-" + j, "255,255,255");//白色
                    } else {
                        canvasMap.put(i + "-" + j, rgbTransformerService.Temperature_RGB(map.get(a + "-" + b), highest, lowest));
                        wdMap.put(i + "-" + j,map.get(a + "-" + b));
                    }
                    b++;
                }

            }

            /**
             * 判断是否为右上角的点 和 右面的边
             */

            if (i == 0) {//右上角的点
                apex_angle_temp = (avg1 + avg3) / 2;//取所在行和列的平均值
                apex_angle_temp = (double) Math.round(apex_angle_temp * 10) / 10;
                canvasMap.put(0 + "-" + (canvasLength - 1), rgbTransformerService.Temperature_RGB(apex_angle_temp, highest, lowest));
            } else {//右面的边
                canvasMap.put(i + "-" + (canvasLength - 1), rgbTransformerService.Temperature_RGB(avg3, highest, lowest));
            }
            a++;
            kk++;
        }

        /**
         * 判断是否为右下角的点 和 下面的边
         */
        for (j = 0; j < canvasLength; j += lengthRatio) //最下面墙边
        {
            if ((canvasLength - j) < lengthRatio) {  //把多出的倒数第二个点跳过
                apex_angle_temp = (avg3 + avg4) / 2;//取所在行和列的平均值
                apex_angle_temp = (double) Math.round(apex_angle_temp * 10) / 10;
                canvasMap.put((canvasWidth - 1) + "-" + (canvasLength - 1), rgbTransformerService.Temperature_RGB(apex_angle_temp, highest, lowest));
                break;
            } else {
                canvasMap.put((canvasWidth - 1) + "-" + j, rgbTransformerService.Temperature_RGB(avg3, highest, lowest));

            }
        }


        /**
         * 网格赋值  横网格
         */
        double temp1 = 0; //代表每个横线上点的温度
        double temp2 = 0;
        double differenceValue = 0;//两个相邻点的温度差
        double pxDifferenceVale = 0; //画布上 两个相邻点之间好多个点之间的温度差值
        int ccc = lengthRatio;
        BigDecimal pxDifferenceValeBig = new BigDecimal(0);
        kk = 0;
        for (i = 0; i < canvasWidth; i += widthRatio) {//宽
            if (kk == pointNumW + 1) {//最后一行的
                for (j = 0; j < canvasLength; j += lengthRatio) {
                    if ((canvasLength - j) < lengthRatio)        //把多出的倒数第二个点跳过
                        continue;
                    temp1 = rgbTransformerService.RGB_Temperature(canvasMap.get((canvasWidth - 1) + "-" + j), highest, lowest, i, j);//temp1 是起始点温度
                    temp1 = (double) Math.round(temp1 * 10) / 10;
                    if ((canvasMap.get((canvasWidth - 1) + "-" + (j + lengthRatio)).equals("255,255,255"))) {
                        temp2 = rgbTransformerService.RGB_Temperature(canvasMap.get((canvasWidth - 1) + "-" + (canvasWidth - 1)), highest, lowest, i, j);
                        ccc = canvasLength - j - 2;
                    } else {
                        temp2 = rgbTransformerService.RGB_Temperature(canvasMap.get((canvasWidth - 1) + "-" + (j + lengthRatio)), highest, lowest, i, j);
                        ccc = lengthRatio - 1;
                    }
                    temp2 = (double) Math.round(temp2 * 10) / 10;
                    //System.out.println(i+"-------"+(j+lengthRatio)+"----------"+temp2+"---"+j);
                    differenceValue = temp1 - temp2;
                    differenceValue = (double) Math.round(differenceValue * 10) / 10;
                    pxDifferenceVale = differenceValue / (ccc + 1);
                    pxDifferenceValeBig = new BigDecimal(pxDifferenceVale);
                    pxDifferenceVale = pxDifferenceValeBig.setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue(); //保留1位小数四舍五入

                    for (k = 1; k <= ccc; k++) {
                        temp1 -= pxDifferenceVale;                            //每次递加差值，求出该像素点温度
                        temp1 = (double) Math.round(temp1 * 10) / 10;
                        canvasMap.put((canvasWidth - 1) + "-" + (j + k), rgbTransformerService.Temperature_RGB(temp1, highest, lowest));//转换rgb值
                        //System.out.println("i的值是:"+i+"//j的值是:"+j+"j+k的值是"+(j+k)+"温度是:"+temp1);


                    }
                }

            } else {

                for (j = 0; j < canvasLength; j += lengthRatio) {
                    if ((canvasLength - j) < lengthRatio)        //把多出的倒数第二个点跳过
                        continue;
                    temp1 = rgbTransformerService.RGB_Temperature(canvasMap.get(i + "-" + j), highest, lowest, i, j);//temp1 是起始点温度

                    temp1 = (double) Math.round(temp1 * 10) / 10;

                    //if ((canvasMap.get(i + "-" + (j))).equals("255,255,255")) {//*********************
                    if ((canvasMap.get(i + "-" + (j + lengthRatio))).equals("255,255,255")) {
                        temp2 = rgbTransformerService.RGB_Temperature(canvasMap.get(i + "-" + (canvasLength - 1)), highest, lowest, i, j);
                        ccc = canvasLength - j - 2;
                    } else {
                        temp2 = rgbTransformerService.RGB_Temperature(canvasMap.get(i + "-" + (j + lengthRatio)), highest, lowest, i, j);
                        ccc = lengthRatio - 1;
                    }
                    temp2 = (double) Math.round(temp2 * 10) / 10;
                    //System.out.println(i+"-------"+(j+lengthRatio)+"----------"+temp2+"---"+j);
                    differenceValue = temp1 - temp2;
                    differenceValue = (double) Math.round(differenceValue * 10) / 10;
                    pxDifferenceVale = differenceValue / (ccc + 1);
                    pxDifferenceValeBig = new BigDecimal(pxDifferenceVale);
                    pxDifferenceVale = pxDifferenceValeBig.setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue(); //保留1位小数四舍五入

                    for (k = 1; k <= ccc; k++) {
                        temp1 -= pxDifferenceVale;                            //每次递加差值，求出该像素点温度
                        temp1 = (double) Math.round(temp1 * 10) / 10;
                        canvasMap.put(i + "-" + (j + k), rgbTransformerService.Temperature_RGB(temp1, highest, lowest));//转换rgb值
                        //System.out.println("i的值是:"+i+"j是:"+j+"----(j+k是)"+(j+k)+"温度是:"+temp1);
                    }
                }
                kk++;
            }

        }

        /**
         * 网格赋值 竖网格
         */
        kk = 0;
        for (j = 0; j < canvasLength; j += lengthRatio) {//长 0246810
            if (kk == pointNumL + 1) {
                for (i = 0; i < canvasWidth; i += widthRatio) {//宽 0246

                    if ((canvasWidth - i) <= widthRatio)        //把多出的倒数第二个点跳过
                        continue;

                    temp1 = rgbTransformerService.RGB_Temperature(canvasMap.get(i + "-" + (canvasLength - 1)), highest, lowest, i, j);//temp1 是起始点温度
                    if ((canvasMap.get((i + widthRatio) + "-" + (canvasLength - 1)).equals("255,255,255"))) {
                        temp2 = rgbTransformerService.RGB_Temperature(canvasMap.get((canvasWidth - 1) + "-" + (canvasLength - 1)), highest, lowest, i, j);
                        ccc = canvasWidth - i - 2;
                    } else {
                        temp2 = rgbTransformerService.RGB_Temperature(canvasMap.get((i + widthRatio) + "-" + (canvasLength - 1)), highest, lowest, i, j);
                        ccc = widthRatio - 1;
                    }
                    temp1 = (double) Math.round(temp1 * 10) / 10;
                    temp2 = (double) Math.round(temp2 * 10) / 10;

                    differenceValue = temp1 - temp2;
                    differenceValue = (double) Math.round(differenceValue * 10) / 10;
                    pxDifferenceVale = differenceValue / (ccc + 1);
                    pxDifferenceValeBig = new BigDecimal(pxDifferenceVale);
                    pxDifferenceVale = pxDifferenceValeBig.setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue(); //保留1位小数四舍五入

                    for (k = 1; k <= ccc; k++) {
                        temp1 -= pxDifferenceVale;                            //每次递加差值，求出该像素点温度
                        temp1 = (double) Math.round(temp1 * 10) / 10;
                        canvasMap.put((i + k) + "-" + (canvasLength - 1), rgbTransformerService.Temperature_RGB(temp1, highest, lowest));//转换rgb值
                        //System.out.println((i+k)+"///"+(j)+"temp1是"+temp1+"---1颜色是"+rgbTransformerService.Temperature_RGB(temp1,highest,lowest));
                        //System.out.println("i是"+i+"****"+"i+k是"+(i+k)+"*****"+"j是:"+j);

                    }
                }
            } else {
                for (i = 0; i < canvasWidth; i += widthRatio) {//宽 0246

                    if ((canvasWidth - i) <= widthRatio)        //把多出的倒数第二个点跳过
                        continue;

                    temp1 = rgbTransformerService.RGB_Temperature(canvasMap.get(i + "-" + j), highest, lowest, i, j);//temp1 是起始点温度

                    if ((canvasMap.get((i + widthRatio) + "-" + j)).equals("255,255,255")) {
                        temp2 = rgbTransformerService.RGB_Temperature(canvasMap.get((canvasWidth - 1) + "-" + j), highest, lowest, i, j);
                        ccc = canvasWidth - i - 2;
                    } else {
                        temp2 = rgbTransformerService.RGB_Temperature(canvasMap.get((i + widthRatio) + "-" + j), highest, lowest, i, j);
                        ccc = widthRatio - 1;
                    }
                    temp1 = (double) Math.round(temp1 * 10) / 10;
                    temp2 = (double) Math.round(temp2 * 10) / 10;
                    differenceValue = temp1 - temp2;
                    differenceValue = (double) Math.round(differenceValue * 10) / 10;
                    pxDifferenceVale = differenceValue / (ccc + 1);
                    pxDifferenceValeBig = new BigDecimal(pxDifferenceVale);
                    pxDifferenceVale = pxDifferenceValeBig.setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue(); //保留1位小数四舍五入

                    for (k = 1; k <= ccc; k++) {
                        temp1 -= pxDifferenceVale;                            //每次递加差值，求出该像素点温度
                        temp1 = (double) Math.round(temp1 * 10) / 10;
                        canvasMap.put((i + k) + "-" + j, rgbTransformerService.Temperature_RGB(temp1, highest, lowest));//转换rgb值
                        //System.out.println("i是:" + i + "---i+k是:" + (i + k) + "----j是:" + (j) + "temp1是" + temp1 + "-----后一个是:");
                    }
                }
                kk++;
            }

        }

    	/**
    	 * 全部网格赋值
    	 */
    	for (i = 0; i < canvasWidth; i += widthRatio) {//宽
    		if((canvasWidth-i) <=widthRatio*2)	//最下面那两横行中间的点
    		{
    			//System.out.println(123);
    			
               
                for (j = 0; j < canvasLength; j += lengthRatio) {
                	
                	for(m=0;m<canvasWidth-i;m++) 	//掐头去尾
        			{
        				for(n=1;n<lengthRatio;n++)		//掐头去尾
        				{
        					if ((canvasLength - j) < lengthRatio) {
        						//把多出的倒数第二个点跳过
        						continue;
        						
        					}
                                
                            temp1 = rgbTransformerService.RGB_Temperature(canvasMap.get((i+m) + "-" + j), highest, lowest, i, j);//temp1 是起始点温度
                            if ((canvasMap.get((i+m) + "-" + (j + lengthRatio))).equals("255,255,255")) {
                                temp2 = rgbTransformerService.RGB_Temperature(canvasMap.get((i+m) + "-" + (canvasLength - 1)), highest, lowest, i, j);
                                ccc = canvasLength - j - 2;
                            } else {
                                temp2 = rgbTransformerService.RGB_Temperature(canvasMap.get((i+m) + "-" + (j + lengthRatio)), highest, lowest, i, j);
                                ccc = lengthRatio - 1;
                            }
                            //System.out.println(i+"-------"+(j+lengthRatio)+"----------"+temp2+"---"+j);
                            differenceValue = temp1 - temp2;
                            differenceValue = (double) Math.round(differenceValue * 10) / 10;
                            pxDifferenceVale = differenceValue / (ccc + 1);
                            pxDifferenceValeBig = new BigDecimal(pxDifferenceVale);
                            pxDifferenceVale = pxDifferenceValeBig.setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue(); //保留1位小数四舍五入

                            for (k = 1; k <= ccc; k++) {
                                temp1 -= pxDifferenceVale;                            //每次递加差值，求出该像素点温度
                                temp1 = (double) Math.round(temp1 * 10) / 10;
                                canvasMap.put((i+m) + "-" + (j + k), rgbTransformerService.Temperature_RGB(temp1, highest, lowest));//转换rgb值
                                //System.out.println("i的值是:"+i+"j是:"+j+"----(j+k是)"+(j+k)+"温度是:"+temp1);
                            }
        					
        				}
        			}
                    
                }
                break;
            } else {

                for (j = 0; j < canvasLength; j += lengthRatio) {
                	
                	for(m=1;m<widthRatio;m++) 	//掐头去尾
        			{
        				for(n=1;n<lengthRatio;n++)		//掐头去尾
        				{
        					if ((canvasLength - j) < lengthRatio)        //把多出的倒数第二个点跳过
                                continue;
                            temp1 = rgbTransformerService.RGB_Temperature(canvasMap.get((i+m) + "-" + j), highest, lowest, i, j);//temp1 是起始点温度
                            if ((canvasMap.get((i+m) + "-" + (j + lengthRatio))).equals("255,255,255")) {
                                temp2 = rgbTransformerService.RGB_Temperature(canvasMap.get((i+m) + "-" + (canvasLength - 1)), highest, lowest, i, j);
                                ccc = canvasLength - j - 2;
                            } else {
                                temp2 = rgbTransformerService.RGB_Temperature(canvasMap.get((i+m) + "-" + (j + lengthRatio)), highest, lowest, i, j);
                                ccc = lengthRatio - 1;
                            }
                            //System.out.println(i+"-------"+(j+lengthRatio)+"----------"+temp2+"---"+j);
                            differenceValue = temp1 - temp2;
                            differenceValue = (double) Math.round(differenceValue * 10) / 10;
                            pxDifferenceVale = differenceValue / (ccc + 1);
                            pxDifferenceValeBig = new BigDecimal(pxDifferenceVale);
                            pxDifferenceVale = pxDifferenceValeBig.setScale(1, BigDecimal.ROUND_HALF_UP).doubleValue(); //保留1位小数四舍五入

                            for (k = 1; k <= ccc; k++) {
                                temp1 -= pxDifferenceVale;                            //每次递加差值，求出该像素点温度
                                temp1 = (double) Math.round(temp1 * 10) / 10;
                                canvasMap.put((i+m) + "-" + (j + k), rgbTransformerService.Temperature_RGB(temp1, highest, lowest));//转换rgb值
                                //System.out.println("i的值是:"+i+"j是:"+j+"----(j+k是)"+(j+k)+"温度是:"+temp1);
                            }
        					
        				}
        			}
                    
                }
            }

        }
    	

        String key;
        String value;
        StringBuffer sb = new StringBuffer();
        List list = new ArrayList<>();
        for (i = 0; i < canvasWidth; i++) {//宽
            for (j = 0; j < canvasLength; j++) {//长
                key = i + "-" + j;
                value = canvasMap.get(key);
                if (value == null) {
                    value = "255,255,255";
                }
                //resultMap.put(i+"-"+j, value);
                //list.add("["+value+"]");
                list.add(value);
                //sb.append(value+",");
                //list.add(sb);
            }
        }

        //System.out.println(list.size());
        //System.out.println("key : "+s+" value : "+resultMap.get(s));
        	/*for (int l = 0; l < 120; l++) {
         		 //System.out.println(resultMap.get(1+"-"+l));
         		System.out.println("key : "+79+"-"+l+" value : "+resultMap.get(79+"-"+l));

			}
*/

        resultMap.put("rgb",list);
        /*Map wdMap = new HashMap<String,Object>();
        Set set = map.entrySet();
        Iterator w = set.iterator();
        while(w.hasNext()){
            Map.Entry<String, Double> entry1=(Map.Entry<String, Double>)w.next();
            String[] keysz = entry1.getKey().split("-");
            System.out.println("key-----"+keysz[0]+"***********"+keysz[1]+"-------"+lengthRatio+"*****"+widthRatio);
            int newx = Integer.valueOf(keysz[0])+lengthRatio;
            int newy = Integer.valueOf(keysz[1])+widthRatio;
            String  newKey = newx + "-"+newy;
            System.out.println("newKey-----"+newKey+"-------"+entry1.getValue());
            wdMap.put(newKey,entry1.getValue()+"");
        }*/
        resultMap.put("wd",wdMap);
        return CommonResult.data(resultMap);

    }


}
