Commit 39a6f8ad authored by 张永's avatar 张永

需求 #14557

parent 6a17fb4c
......@@ -149,27 +149,29 @@ public class OrderServiceImpl implements OrderService {
if(status == null) {
status = 0;
}
//订单状态 0.全部 1. 待付款 2.待审核 3.待发货 4.已发货 5.已完成 6.已取消
String sql = "select * from tSalesOrder where sShopNO = '" + shopNo + "' and sOrgNO = '" + orgNo + "'";
//订单状态 0.全部 1. 待付款 2.待审核 3.待发货 4.已发货 5.已完成 6.已取消 7待补款
String sql = "select distinct a.* from tSalesOrder a, tSalesOrderSub b where a.sSalesOrderID = b.sSalesOrderID and a.sShopNO = '" + shopNo + "' and a.sOrgNO = '" + orgNo + "'";
if(status == 0) {
sql += "";
} else if(status == 1) {
sql += " and sSalesOrderPayTypeID = '4' and nOrderStatus = 0";
sql += " and a.sSalesOrderPayTypeID = '4' and a.nOrderStatus = 0";
} else if(status == 2) {
sql += " and ((sSalesOrderPayTypeID = '2' and nOrderStatus = 0) or (sSalesOrderPayTypeID = '4' and nOrderStatus&37 = 32))";
sql += " and ((a.sSalesOrderPayTypeID = '2' and a.nOrderStatus = 0) or (a.sSalesOrderPayTypeID = '4' and a.nOrderStatus&37 = 32))";
} else if(status == 3) {
sql += " and nOrderStatus&29 = 4 and nOrderStatus&128=0 ";
sql += " and a.nOrderStatus&29 = 4 and a.nOrderStatus&128=0 ";
} else if(status == 4) {
sql += " and nOrderStatus&129 = 128 and nOrderStatus&16=0 ";
sql += " and a.nOrderStatus&129 = 128 and a.nOrderStatus&16=0 ";
} else if(status == 5) {
sql += " and nOrderStatus&17 = 16";
sql += " and a.nOrderStatus&17 = 16";
} else if(status == 6) {
sql += " and nOrderStatus&1 = 1";
} else {
sql += " and a.nOrderStatus&1 = 1";
} else if(status == 7) {
sql += " and b.sSalesOrderTypeID = '0'and b.nDebtAmount > 0 ";
}else {
throw new XException("订单状态不存在");
}
if(orderType != null && orderType.length > 0) {
sql += " and sB2BOrderTypeID in (" + StringUtil.join("', '", "'", "'", "", orderType) + ")";
sql += " and a.sB2BOrderTypeID in (" + StringUtil.join("', '", "'", "'", "", orderType) + ")";
}
List<Map<String, Object>> orderList = jdbcTemplate.limit(sql, page);
if(orderList.size() > 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment