|
@@ -131,7 +131,7 @@ public class agents extends Controller {
|
|
|
ArrayList<Long> userids = DataTeam.queryTeamRow(this, "sa_customers", id).toArrayList("userid", new ArrayList<>());
|
|
|
Executor.sendEml(this, "customers_agent_add", id, siteid, userids);
|
|
|
}
|
|
|
- sqllist.add(DataContrlLog.createLog(this,"sa_agents",sa_agentsid,"新增","新增经销商").getSQL());
|
|
|
+ sqllist.add(DataContrlLog.createLog(this, "sa_agents", sa_agentsid, "新增", "新增经销商").getSQL());
|
|
|
} else {
|
|
|
if (rows.isNotEmpty()) {
|
|
|
if (rows.get(0).getLong("sa_agentsid") != sa_agentsid || rows.get(0).getLong("sys_enterpriseid") != sys_enterpriseid) {
|
|
@@ -139,7 +139,7 @@ public class agents extends Controller {
|
|
|
}
|
|
|
}
|
|
|
sqlFactory = new SQLFactory(this, "经销商修改");
|
|
|
- sqllist.add(DataContrlLog.createLog(this,"sa_agents",sa_agentsid,"编辑","编辑经销商").getSQL());
|
|
|
+ sqllist.add(DataContrlLog.createLog(this, "sa_agents", sa_agentsid, "编辑", "编辑经销商").getSQL());
|
|
|
}
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("sa_agentsid", sa_agentsid);
|
|
@@ -277,10 +277,10 @@ public class agents extends Controller {
|
|
|
Long sa_customersid = customersRows.get(0).getLong("sa_customersid");
|
|
|
if (status.equals("启用")) {
|
|
|
DataTag.createTag(this, "sa_customers", sa_customersid, "经销商");
|
|
|
- sqllist.add(DataContrlLog.createLog(this,"sa_agents",sa_agentsid,"启用","启用经销商").getSQL());
|
|
|
+ sqllist.add(DataContrlLog.createLog(this, "sa_agents", sa_agentsid, "启用", "启用经销商").getSQL());
|
|
|
} else {
|
|
|
DataTag.deleteTag(this, "sa_customers", sa_customersid, "经销商");
|
|
|
- sqllist.add(DataContrlLog.createLog(this,"sa_agents",sa_agentsid,"禁用","禁用经销商").getSQL());
|
|
|
+ sqllist.add(DataContrlLog.createLog(this, "sa_agents", sa_agentsid, "禁用", "禁用经销商").getSQL());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
@@ -511,6 +511,7 @@ public class agents extends Controller {
|
|
|
@CACHEING
|
|
|
public String query_agentaccountbalance() throws YosException {
|
|
|
long sys_enterpriseid = content.getLongValue("sys_enterpriseid");
|
|
|
+ long isorder = content.getLongValue("isorder");
|
|
|
// SQLFactory sqlFactory = new SQLFactory(this, "经销商账户余额查询");
|
|
|
// sqlFactory.addParameter("sys_enterpriseid", sys_enterpriseid);
|
|
|
// sqlFactory.addParameter("siteid", siteid);
|
|
@@ -524,7 +525,12 @@ public class agents extends Controller {
|
|
|
|
|
|
BigDecimal rebateBalance = Accountbalance.getRebateBalance(this, sys_enterpriseid);
|
|
|
|
|
|
- Rows rows = dbConnect.runSqlQuery("SELECT sa_accountclassid from sa_accountclass WHERE siteid = '" + siteid + "' and isrebate = 1");
|
|
|
+ String sql = "SELECT sa_accountclassid from sa_accountclass WHERE siteid = '" + siteid + "' and isrebate = 1";
|
|
|
+ if (isorder == 1) {
|
|
|
+ sql = sql + " and isorder=1";
|
|
|
+ }
|
|
|
+
|
|
|
+ Rows rows = dbConnect.runSqlQuery(sql);
|
|
|
if (rows.isNotEmpty()) {
|
|
|
Long sa_accountclassid = rows.get(0).getLong("sa_accountclassid");
|
|
|
rows = dbConnect.runSqlQuery("SELECT * from sa_accountbalance WHERE sys_enterpriseid = " + sys_enterpriseid + " and siteid='" + siteid + "' and sa_accountclassid=" + sa_accountclassid);
|