主数据数据:
{
"0": {
"dept": "广西",
"clearAmount": "770040.00",
"contractno": "WK-2022-00001",
"projno": "414ESM2205",
"contractSaleAmount": "111.00",
"customerProviderno": "10001044"
},
"1": {
"dept": "安徽",
"clearAmount": "212313.00",
"contractno": "WK-2022-00001",
"projno": "414ESM2205",
"contractSaleAmount": "55.00",
"customerProviderno": "10001046"
},
"2": {
"dept": "上海",
"clearAmount": "5445.00",
"contractno": "WK-2022-00031",
"projno": "414ESM2205",
"contractSaleAmount": "423.00",
"customerProviderno": "10001044"
}
}
辅数据:
[{"mainProjno":"413ESM2211,413GSM2209,413ESI2201","yearMonth":"2023-08"},{"mainProjno":"1111","4444","yearMonth":"2023-06"}]
现在需求是根据辅数据中的项目编号字段集合mainProjno,去找出主数据中对应项目编号并且customerProviderno和contractno相同的数据,把clearAmount数值累加,dept拼接在一起,麻烦各位道友用javaScript es5的方法帮我想想,或者提供思路也可以。谢谢各位!