AcedDCF 2019-05-27 11:19
浏览 135

想实现再加一层分级,效果如下

{
"errcode": 10000,
"errmsg": "汇总成功",
"data": {
"GroupList": [
{
"ErpDepartmentId": "",
"ErpDepartment": "其他",
"ErpSalesmanId": "",
"ErpSalesman": "其他",
"Count": 63
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "A8测试",
"ErpSalesmanId": "0000001",
"ErpSalesman": "其他",
"Count": 11
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "A8测试",
"ErpSalesmanId": "888",
"ErpSalesman": "其他",
"Count": 3
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "金水仓库",
"ErpSalesmanId": "0",
"ErpSalesman": "无",
"Count": 6
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "金水仓库",
"ErpSalesmanId": "0000001",
"ErpSalesman": "0000001",
"Count": 6
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "金水仓库",
"ErpSalesmanId": "888",
"ErpSalesman": "888",
"Count": 8
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "金水仓库",
"ErpSalesmanId": "888",
"ErpSalesman": "金莉",
"Count": 3
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "金水仓库",
"ErpSalesmanId": "ERP0001",
"ErpSalesman": "管成",
"Count": 2
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "金水仓库",
"ErpSalesmanId": "YG000003",
"ErpSalesman": "君莫笑",
"Count": 2
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "金水仓库",
"ErpSalesmanId": "YG000005",
"ErpSalesman": "张涛",
"Count": 2
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "金水仓库",
"ErpSalesmanId": "YG000025",
"ErpSalesman": "孙悦",
"Count": 1
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "金水仓库",
"ErpSalesmanId": "YG000061",
"ErpSalesman": "阿尔巴尼亚",
"Count": 1
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "金水仓库",
"ErpSalesmanId": "YG000076",
"ErpSalesman": "邓超",
"Count": 1
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "金水仓库",
"ErpSalesmanId": "YG000077",
"ErpSalesman": "可以",
"Count": 1
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "金水仓库",
"ErpSalesmanId": "YG000079",
"ErpSalesman": "周一",
"Count": 7
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "金水仓库",
"ErpSalesmanId": "YG000080",
"ErpSalesman": "王旗",
"Count": 1
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "金水仓库",
"ErpSalesmanId": "YG000081",
"ErpSalesman": "朱记光",
"Count": 1
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "金水仓库",
"ErpSalesmanId": "YG000126",
"ErpSalesman": "测试718002",
"Count": 2
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "金水仓库",
"ErpSalesmanId": "YG000126",
"ErpSalesman": "辛小芬",
"Count": 4
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "总仓库",
"ErpSalesmanId": "",
"ErpSalesman": "其他",
"Count": 635
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "总仓库",
"ErpSalesmanId": "0",
"ErpSalesman": "无",
"Count": 3
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "总仓库",
"ErpSalesmanId": "0000001",
"ErpSalesman": "0000001",
"Count": 2
},
{
"ErpDepartmentId": "B010001",
"ErpDepartment": "总仓库",
"ErpSalesmanId": "ERP0001",
"ErpSalesman": "管成",
"Count": 1
},
{
"ErpDepartmentId": "B010002",
"ErpDepartment": "中原仓库",
"ErpSalesmanId": "YG000133",
"ErpSalesman": "贾克斯",
"Count": 1
},
{
"ErpDepartmentId": "B010002",
"ErpDepartment": "中原仓库",
"ErpSalesmanId": "YG000134",
"ErpSalesman": "阿木木",
"Count": 4
}
]
}
}

得到结果如下

{
"errcode": 10000,
"errmsg": "汇总成功",
"data": {
"GroupList": [
{
"ErpDepartmentId": "",
"ErpDepartment": "其他",
"ErpSalesman_HZ":[
{
"ErpSalesmanId": "",
"ErpSalesman": "其他",
"Count": 63
},
{
"ErpSalesmanId": "0000001",
"ErpSalesman": "其他",
"Count": 11
},
{
"ErpSalesmanId": "888",
"ErpSalesman": "其他",
"Count": 3
}
]

        },
        {
            "ErpDepartmentId": "B010002",
            "ErpDepartment": "金水仓库",
                            "ErpSalesman_HZ":[
                            {
                                "ErpSalesmanId": "0",
                                "ErpSalesman": "无",
                                "Count": 6
                            },{
                                "ErpSalesmanId": "0000001",
                                "ErpSalesman": "0000001",
                                "Count": 6
                            }
                        ]
        }
    ]
}

}

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 TI的insta-spin例程
    • ¥15 完成下列问题完成下列问题
    • ¥15 C#算法问题, 不知道怎么处理这个数据的转换
    • ¥15 YoloV5 第三方库的版本对照问题
    • ¥15 请完成下列相关问题!
    • ¥15 drone 推送镜像时候 purge: true 推送完毕后没有删除对应的镜像,手动拷贝到服务器执行结果正确在样才能让指令自动执行成功删除对应镜像,如何解决?
    • ¥15 求daily translation(DT)偏差订正方法的代码
    • ¥15 js调用html页面需要隐藏某个按钮
    • ¥15 ads仿真结果在圆图上是怎么读数的
    • ¥20 Cotex M3的调试和程序执行方式是什么样的?