触发器设置条件:单件符合("danJianRuCangHao!=null&&danJianRuCangHao.contains('U00')&&danJianRuCangHao.contains('FBA')")
执行任务:
var yds = $jsService.getBean('yunDanService');
var waybill = $yunDanEntity;
var ext = waybill.getWaybillExtraEntity();
var djs = waybill.getYunDanDanJianEntityList();
if (djs != null) {
var str = '';
for (var i = 0; i < djs.size(); i++) {
var danj = djs.get(i);
if (danj.danJianRuCangHao != null && danj.danJianRuCangHao.contains('U00') && danj.danJianRuCangHao.contains('FBA')) {
var danJianRuCangHao = danj.danJianRuCangHao;
if (str == '') {
str = danJianRuCangHao.substring(0, danJianRuCangHao.indexOf('U00'));
}else if(!str.contains(danJianRuCangHao.substring(0, danJianRuCangHao.indexOf('U00')))){
str = str + '/' + danJianRuCangHao.substring(0, danJianRuCangHao.indexOf('U00'));
}
}
}
if(str != ''){
ext.setFbaWarehouseNo(str);
yds.saveWaybillExtraEntity(ext);
}
}
设置触发器后的识别效果: