|
|
@@ -49,8 +49,8 @@ public class cashbill extends Controller {
|
|
|
// 经销商编号
|
|
|
String agentnum = content.getString("fagentnum");
|
|
|
long sys_enterpriseid=0;
|
|
|
- if(dbConnect.runSqlQuery("select sys_enterpriseid from sa_agents where siteid='lsa' and agentnum='"+agentnum+"'").isNotEmpty()){
|
|
|
- sys_enterpriseid=dbConnect.runSqlQuery("select sys_enterpriseid from sa_agents where siteid='lsa' and agentnum='"+agentnum+"'").get(0).getLong("sys_enterpriseid");
|
|
|
+ if(dbConnect.runSqlQuery("select sys_enterpriseid from sa_agents where siteid='lsa1986' and agentnum='"+agentnum+"'").isNotEmpty()){
|
|
|
+ sys_enterpriseid=dbConnect.runSqlQuery("select sys_enterpriseid from sa_agents where siteid='lsa1986' and agentnum='"+agentnum+"'").get(0).getLong("sys_enterpriseid");
|
|
|
}else{
|
|
|
msg ="yos中不存在【"+agentnum+"】经销商";
|
|
|
return getErrReturnObject().setErrMsg(msg).toString();
|
|
|
@@ -62,8 +62,8 @@ public class cashbill extends Controller {
|
|
|
// 账户编号
|
|
|
long sa_accountclassid=0;
|
|
|
String faccclsnum = content.getString("faccclsnum");
|
|
|
- if(dbConnect.runSqlQuery("select sa_accountclassid from sa_accountclass where siteid='lsa' and accountno='"+faccclsnum+"'").isNotEmpty()){
|
|
|
- sa_accountclassid=dbConnect.runSqlQuery("select sa_accountclassid from sa_accountclass where siteid='lsa' and accountno='"+faccclsnum+"'").get(0).getLong("sa_accountclassid");
|
|
|
+ if(dbConnect.runSqlQuery("select sa_accountclassid from sa_accountclass where siteid='lsa1986' and accountno='"+faccclsnum+"'").isNotEmpty()){
|
|
|
+ sa_accountclassid=dbConnect.runSqlQuery("select sa_accountclassid from sa_accountclass where siteid='lsa1986' and accountno='"+faccclsnum+"'").get(0).getLong("sa_accountclassid");
|
|
|
}else{
|
|
|
msg ="yos中不存在【"+faccclsnum+"】的账户";
|
|
|
return getErrReturnObject().setErrMsg(msg).toString();
|
|
|
@@ -127,7 +127,7 @@ public class cashbill extends Controller {
|
|
|
BigDecimal balance = BigDecimal.ZERO; //当前账户余额
|
|
|
Rows rowsaccountbalance = dbConnect.runSqlQuery(
|
|
|
"select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='"
|
|
|
- + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
|
|
|
+ + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
|
|
|
|
|
|
if (rowsaccountbalance.isEmpty()) {
|
|
|
SQLFactory accountbalanceaddSqlFactory = new SQLFactory(new Accountbalance(), "营销账户余额新增");
|
|
|
@@ -144,7 +144,7 @@ public class cashbill extends Controller {
|
|
|
BigDecimal newbalance = amount.add(rowsaccountbalance.get(0).getBigDecimal("balance"));
|
|
|
sqlList.add("update sa_accountbalance set balance='" + newbalance
|
|
|
+ "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid
|
|
|
- + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
|
|
|
+ + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
|
|
|
balance = newbalance;
|
|
|
}
|
|
|
sqlFactory.addParameter("balance", balance);
|
|
|
@@ -156,16 +156,16 @@ public class cashbill extends Controller {
|
|
|
* DRP存在收入凭证,且中间表状态为审核且不在删除状态时,DRP中需将当前收入凭证先反审核,修改内容后再进行审核
|
|
|
*/
|
|
|
long sa_cashbillid= cashbillRows.get(0).getLong("sa_cashbillid");
|
|
|
- Rows rows = dbConnect.runSqlQuery("select sa_cashbillid,sys_enterpriseid,sa_accountclassid,status,billno,amount,type,ownerid from sa_cashbill where sa_cashbillid ='" + sa_cashbillid + "' and siteid='lsa'");
|
|
|
+ Rows rows = dbConnect.runSqlQuery("select sa_cashbillid,sys_enterpriseid,sa_accountclassid,status,billno,amount,type,ownerid from sa_cashbill where sa_cashbillid ='" + sa_cashbillid + "' and siteid='lsa1986'");
|
|
|
|
|
|
BigDecimal balance = BigDecimal.ZERO; //当前账户余额
|
|
|
if (!rows.isEmpty()) {
|
|
|
sys_enterpriseid = rows.get(0).getLong("sys_enterpriseid");
|
|
|
sa_accountclassid = rows.get(0).getLong("sa_accountclassid");
|
|
|
- Rows rowsaccountbalance = dbConnect.runSqlQuery("select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
|
|
|
+ Rows rowsaccountbalance = dbConnect.runSqlQuery("select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
|
|
|
BigDecimal newbalance = rowsaccountbalance.get(0).getBigDecimal("balance").subtract(rows.get(0).getBigDecimal("amount"));
|
|
|
balance = newbalance;
|
|
|
- sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
|
|
|
+ sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
|
|
|
sqlList.add(DataContrlLog.createLog(this, "sa_cashbill", sa_cashbillid, "反审核", "收入凭证反审核成功").getSQL());
|
|
|
}
|
|
|
|
|
|
@@ -185,16 +185,16 @@ public class cashbill extends Controller {
|
|
|
* DRP存在收入凭证,且中间表状态为新建或在删除状态时,DRP中需将当前收入凭证先反审核
|
|
|
*/
|
|
|
long sa_cashbillid= cashbillRows.get(0).getLong("sa_cashbillid");
|
|
|
- Rows rows = dbConnect.runSqlQuery("select sa_cashbillid,sys_enterpriseid,sa_accountclassid,status,billno,amount,type,ownerid from sa_cashbill where sa_cashbillid ='" + sa_cashbillid + "' and siteid='lsa'");
|
|
|
+ Rows rows = dbConnect.runSqlQuery("select sa_cashbillid,sys_enterpriseid,sa_accountclassid,status,billno,amount,type,ownerid from sa_cashbill where sa_cashbillid ='" + sa_cashbillid + "' and siteid='lsa1986'");
|
|
|
|
|
|
BigDecimal balance = BigDecimal.ZERO; //当前账户余额
|
|
|
if (!rows.isEmpty()) {
|
|
|
sys_enterpriseid = rows.get(0).getLong("sys_enterpriseid");
|
|
|
sa_accountclassid = rows.get(0).getLong("sa_accountclassid");
|
|
|
- Rows rowsaccountbalance = dbConnect.runSqlQuery("select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
|
|
|
+ Rows rowsaccountbalance = dbConnect.runSqlQuery("select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
|
|
|
BigDecimal newbalance = rowsaccountbalance.get(0).getBigDecimal("balance").subtract(rows.get(0).getBigDecimal("amount"));
|
|
|
balance = newbalance;
|
|
|
- sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
|
|
|
+ sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
|
|
|
sqlList.add(DataContrlLog.createLog(this, "sa_cashbill", sa_cashbillid, "反审核", "收入凭证反审核成功").getSQL());
|
|
|
}
|
|
|
|
|
|
@@ -246,7 +246,7 @@ public class cashbill extends Controller {
|
|
|
BigDecimal balance = BigDecimal.ZERO; //当前账户余额
|
|
|
Rows rowsaccountbalance = dbConnect.runSqlQuery(
|
|
|
"select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='"
|
|
|
- + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
|
|
|
+ + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
|
|
|
if(rowsaccountbalance.isEmpty()){
|
|
|
JSONObject returnObject=new JSONObject();
|
|
|
returnObject.put("msg", "账户不存在,支出凭证无法审核");
|
|
|
@@ -254,7 +254,7 @@ public class cashbill extends Controller {
|
|
|
return returnObject.toString();
|
|
|
}
|
|
|
BigDecimal newbalance = rowsaccountbalance.get(0).getBigDecimal("balance").subtract(amount);
|
|
|
- sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
|
|
|
+ sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
|
|
|
balance = newbalance;
|
|
|
sqlFactory.addParameter("balance", balance);
|
|
|
sqlFactory.addParameter("updatek3flag", "");
|
|
|
@@ -265,16 +265,16 @@ public class cashbill extends Controller {
|
|
|
* DRP存在收入凭证,且中间表状态为审核且不在删除状态时,DRP中需将当前收入凭证先反审核,修改内容后再进行审核
|
|
|
*/
|
|
|
long sa_cashbillid= cashbillRows.get(0).getLong("sa_cashbillid");
|
|
|
- Rows rows = dbConnect.runSqlQuery("select sa_cashbillid,sys_enterpriseid,sa_accountclassid,status,billno,amount,type,ownerid from sa_cashbill where sa_cashbillid ='" + sa_cashbillid + "' and siteid='lsa'");
|
|
|
+ Rows rows = dbConnect.runSqlQuery("select sa_cashbillid,sys_enterpriseid,sa_accountclassid,status,billno,amount,type,ownerid from sa_cashbill where sa_cashbillid ='" + sa_cashbillid + "' and siteid='lsa1986'");
|
|
|
|
|
|
BigDecimal balance = BigDecimal.ZERO; //当前账户余额
|
|
|
if (!rows.isEmpty()) {
|
|
|
sys_enterpriseid = rows.get(0).getLong("sys_enterpriseid");
|
|
|
sa_accountclassid = rows.get(0).getLong("sa_accountclassid");
|
|
|
- Rows rowsaccountbalance = dbConnect.runSqlQuery("select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
|
|
|
+ Rows rowsaccountbalance = dbConnect.runSqlQuery("select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
|
|
|
BigDecimal newbalance = rowsaccountbalance.get(0).getBigDecimal("balance").add(rows.get(0).getBigDecimal("amount"));
|
|
|
balance = newbalance;
|
|
|
- sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
|
|
|
+ sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
|
|
|
sqlList.add(DataContrlLog.createLog(this, "sa_cashbill", sa_cashbillid, "反审核", "支出凭证反审核成功").getSQL());
|
|
|
}
|
|
|
|
|
|
@@ -293,16 +293,16 @@ public class cashbill extends Controller {
|
|
|
* DRP存在收入凭证,且中间表状态为新建或在删除状态时,DRP中需将当前收入凭证先反审核
|
|
|
*/
|
|
|
long sa_cashbillid= cashbillRows.get(0).getLong("sa_cashbillid");
|
|
|
- Rows rows = dbConnect.runSqlQuery("select sa_cashbillid,sys_enterpriseid,sa_accountclassid,status,billno,amount,type,ownerid from sa_cashbill where sa_cashbillid ='" + sa_cashbillid + "' and siteid='lsa'");
|
|
|
+ Rows rows = dbConnect.runSqlQuery("select sa_cashbillid,sys_enterpriseid,sa_accountclassid,status,billno,amount,type,ownerid from sa_cashbill where sa_cashbillid ='" + sa_cashbillid + "' and siteid='lsa1986'");
|
|
|
|
|
|
BigDecimal balance = BigDecimal.ZERO; //当前账户余额
|
|
|
if (!rows.isEmpty()) {
|
|
|
sys_enterpriseid = rows.get(0).getLong("sys_enterpriseid");
|
|
|
sa_accountclassid = rows.get(0).getLong("sa_accountclassid");
|
|
|
- Rows rowsaccountbalance = dbConnect.runSqlQuery("select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
|
|
|
+ Rows rowsaccountbalance = dbConnect.runSqlQuery("select sa_accountbalanceid,balance,creditquota from sa_accountbalance where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
|
|
|
BigDecimal newbalance = rowsaccountbalance.get(0).getBigDecimal("balance").add(rows.get(0).getBigDecimal("amount"));
|
|
|
balance = newbalance;
|
|
|
- sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa'");
|
|
|
+ sqlList.add("update sa_accountbalance set balance='" + newbalance + "',changedate=CURRENT_TIME,changeby ='" + checkby + "',changeuserid='1' where sys_enterpriseid ='" + sys_enterpriseid + "' and sa_accountclassid='" + sa_accountclassid + "' and siteid='lsa1986'");
|
|
|
sqlList.add(DataContrlLog.createLog(this, "sa_cashbill", sa_cashbillid, "反审核", "支出凭证反审核成功").getSQL());
|
|
|
}
|
|
|
|