订单受理存盘校验拦截

function srv_check(dbtype,billnoList,ywtype) {
var checkSql = "";
var whError = "";
//库房与区域不匹配拦截
checkSql = "";
if(dbtype.equals("Oracle")) {
checkSql += " select ''||chr(10)||('单号【'||e.billcode||'】 行['||a.billsn||']'||"
checkSql += " case when x.whid is null "
checkSql += " then '库房为空,或者库房与所分配地区信息不匹配! '"
checkSql += " else '' end ||"
checkSql += " case when f.ecgoodsid is null "
checkSql += " then '线上商品信息为空,请维护! '"
checkSql += " else '' end ||"
checkSql += " case when h.goodsid is null "
checkSql += " then '系统商品信息匹配不成功,请维护! '"
checkSql += " else '' end ||"
checkSql += " case when e.logisticsid is null or e.logisticsid = '' "
checkSql += " then '快递公司为空,请检查! '"
checkSql += " else '' end)||chr(10) as whError"
} else {
checkSql += " select ''+char(10)+('单号【'+e.billcode+'】 行['+convert(varchar(10),a.billsn)+']'+"
checkSql += " case when x.whid is null "
checkSql += " then '库房为空,或者库房与所分配地区信息不匹配! '"
checkSql += " else '' end +"
checkSql += " case when f.ecgoodsid is null "
checkSql += " then '线上商品信息为空,请维护! '"
checkSql += " else '' end +"
checkSql += " case when h.goodsid is null "
checkSql += " then '系统商品信息匹配不成功,请维护! '"
checkSql += " else '' end +"
checkSql += " case when e.logisticsid is null or e.logisticsid = '' "
checkSql += " then '快递公司为空,请检查! '"
checkSql += " else '' end)+char(10) as whError"
}
checkSql += " from ecorderDt a"
checkSql += " join ecordermt e on a.billno = e.billno and a.entid = e.entid"
checkSql += " join ecorderBuyer b on a.billno = b.billno and a.entid = b.entid"
checkSql += " left join("
checkSql += " select WHId,EntId,CityCodes from ECWHZone"
checkSql += " ) x on a.whid = x.whid and a.entid = x.entid"
checkSql += " and (x.CityCodes = b.canton or x.CityCodes = b.city or x.CityCodes = b.county)"
checkSql += " left join ECGoodsDoc f on a.ecgoodsid = f.ecgoodsid and e.ecshopid = f.ecshopid and a.entid = f.entid"
checkSql += " left join ECGoodsRf g on e.ecshopid = g.ecshopid and a.skuid = g.skuid"
checkSql += " and a.ecgoodsid = g.ecgoodsid and a.entid = g.entid"
checkSql += " left join goodsdoc h on g.goodsid = h.goodsid and g.entid = h.entid "
checkSql += " where a.billno in(" +billnoList+") and a.isdeal ='N' "
checkSql += " and (x.whid is null or f.ecgoodsid is null or h.goodsid is null or e.logisticsid is null or e.logisticsid = '')";
var dsError = DBUtil.openDataSet(checkSql, {});
if (dsError.recordCount != 0) {
for (var i = 0; i < dsError.recordCount;i++) {
whError += dsError.getValueAt(i, "whError");
}
if(ywtype.equals("1")) {
Utility.throwError("\n" + whError + "  \n" + " ");
}else if(ywtype.equals("2")) {
FormUtil.setWriteBackDataSetValue("dsMain",0, "whError",whError);
}
}
}
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值