/**
 * Created by victor vieira on 22/06/2018
 */
var map = mapperFactory.createMapper("EstProdReqTransfSld");
var obj = message.get('obj');

try {

    for (let i = 0; i < obj.size(); i++) {
        map.update("EstProdReqTransfSld.atualizarQtdAtendidaControlePontoEncomenda", {
            'cdUsu': obj.get(i).get('cdUsu'),
            'cdFilial': obj.get(i).get('cdFilial'),
            'cdProd': obj.get(i).get('cdProd'),
            'qtAtend': obj.get(i).get('qtAtend'),
            'qtDemanda': obj.get(i).get('qtDemanda'),
            'flagZerarRessuprimento': obj.get(i).get('flagZerarRessuprimento')
        });
    }

    map.commit();
} catch (err) {
    map.rollback();
    throw " Ocorreu um erro: " + err;
}