|
@@ -18,6 +18,7 @@ import common.data.Row;
|
|
|
import common.data.Rows;
|
|
import common.data.Rows;
|
|
|
import common.data.SQLFactory;
|
|
import common.data.SQLFactory;
|
|
|
import restcontroller.R;
|
|
import restcontroller.R;
|
|
|
|
|
+import restcontroller.webmanage.executorService.Executor;
|
|
|
|
|
|
|
|
import java.io.IOException;
|
|
import java.io.IOException;
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
@@ -241,7 +242,7 @@ public class Paybill extends Controller {
|
|
|
ArrayList<String> sqlList = new ArrayList<>();
|
|
ArrayList<String> sqlList = new ArrayList<>();
|
|
|
Long sa_paybillid = content.getLong("sa_paybillid");
|
|
Long sa_paybillid = content.getLong("sa_paybillid");
|
|
|
Rows rows = dbConnect.runSqlQuery("select sys_enterpriseid,status,billno,remarks from sa_paybill where siteid='" + siteid + "' and sa_paybillid=" + sa_paybillid);
|
|
Rows rows = dbConnect.runSqlQuery("select sys_enterpriseid,status,billno,remarks from sa_paybill where siteid='" + siteid + "' and sa_paybillid=" + sa_paybillid);
|
|
|
- Rows accountclassRows = dbConnect.runSqlQuery("select sa_accountclassid,amount from sa_paybilldetail where siteid='" + siteid + "' and amount>0 and sa_paybillid=" + sa_paybillid);
|
|
|
|
|
|
|
+ Rows accountclassRows = dbConnect.runSqlQuery("select t1.sa_accountclassid,t1.amount,t2.accountname from sa_paybilldetail t1 left join sa_accountclass t2 on t1.sa_accountclassid=t2.sa_accountclassid and t1.siteid=t2.siteid where t1.siteid='" + siteid + "' and t1.amount>0 and t1.sa_paybillid=" + sa_paybillid);
|
|
|
if (rows.isEmpty()) {
|
|
if (rows.isEmpty()) {
|
|
|
return getErrReturnObject().setErrMsg("未选择打款凭证").toString();
|
|
return getErrReturnObject().setErrMsg("未选择打款凭证").toString();
|
|
|
}
|
|
}
|
|
@@ -266,23 +267,27 @@ public class Paybill extends Controller {
|
|
|
BigDecimal amount = row.getBigDecimal("amount");
|
|
BigDecimal amount = row.getBigDecimal("amount");
|
|
|
CashbillEntity cashbillEntity = new CashbillEntity(amount, remarks, "打款凭证", billno, "sa_paybill", sa_paybillid, "货款", "");
|
|
CashbillEntity cashbillEntity = new CashbillEntity(amount, remarks, "打款凭证", billno, "sa_paybill", sa_paybillid, "货款", "");
|
|
|
sqlList.addAll(Accountbalance.createCashbillIncome(this, sys_enterpriseid, row.getLong("sa_accountclassid"), cashbillEntity, false));
|
|
sqlList.addAll(Accountbalance.createCashbillIncome(this, sys_enterpriseid, row.getLong("sa_accountclassid"), cashbillEntity, false));
|
|
|
|
|
+ dbConnect.runSqlUpdate(sqlList);
|
|
|
|
|
+
|
|
|
|
|
+ String message = "您的打款凭证已审核通过,【"+row.getString("accountname")+"】账户已成功充值【"+amount+"】元";
|
|
|
|
|
+ sendMsg(message, sa_paybillid, sys_enterpriseid);
|
|
|
}
|
|
}
|
|
|
dbConnect.runSqlUpdate(sqlList);
|
|
dbConnect.runSqlUpdate(sqlList);
|
|
|
return getSucReturnObject().toString();
|
|
return getSucReturnObject().toString();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
-// public void sendMsg(String content, Long sa_paybillid, Long sys_enterpriseid) throws YosException {
|
|
|
|
|
-//
|
|
|
|
|
-// ArrayList<Long> userList = getEnterpriseHrs(sys_enterpriseid).toArrayList("userid", new ArrayList<>());
|
|
|
|
|
-// Remind remind = new Remind(this);
|
|
|
|
|
-// remind.setTitle("打款消息");
|
|
|
|
|
-// remind.setContent(content);
|
|
|
|
|
-// remind.setType("应用");
|
|
|
|
|
-// remind.setObjectid(sa_paybillid);
|
|
|
|
|
-// remind.setObjectname("sa_paybill");
|
|
|
|
|
-// remind.setTouserid(userList);
|
|
|
|
|
-// remind.sendByDialogMsg().createSys_message();
|
|
|
|
|
-// }
|
|
|
|
|
|
|
+ public void sendMsg(String content, Long sa_paybillid, Long sys_enterpriseid) throws YosException {
|
|
|
|
|
+
|
|
|
|
|
+ ArrayList<Long> userList = getEnterpriseHrs(sys_enterpriseid).toArrayList("userid", new ArrayList<>());
|
|
|
|
|
+ Remind remind = new Remind(this);
|
|
|
|
|
+ remind.setTitle("打款消息");
|
|
|
|
|
+ remind.setContent(content);
|
|
|
|
|
+ remind.setType("应用");
|
|
|
|
|
+ remind.setObjectid(sa_paybillid);
|
|
|
|
|
+ remind.setObjectname("sa_paybill");
|
|
|
|
|
+ remind.setTouserid(userList);
|
|
|
|
|
+ remind.sendByDialogMsg().createSys_message();
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
@API(title = "详情", apiversion = R.ID20221226153404.v1.class)
|
|
@API(title = "详情", apiversion = R.ID20221226153404.v1.class)
|
|
|
public String queryById() throws YosException {
|
|
public String queryById() throws YosException {
|
|
@@ -305,6 +310,12 @@ public class Paybill extends Controller {
|
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
sqlFactory.addParameter("siteid", siteid);
|
|
|
sqlFactory.addParameter("sa_paybillid", sa_paybillid);
|
|
sqlFactory.addParameter("sa_paybillid", sa_paybillid);
|
|
|
dbConnect.runSqlUpdate(sqlFactory.getSQL());
|
|
dbConnect.runSqlUpdate(sqlFactory.getSQL());
|
|
|
|
|
+ Rows rows =dbConnect.runSqlQuery("select * from sa_paybill where siteid='"+siteid+"' and sa_paybillid="+sa_paybillid);
|
|
|
|
|
+ if(!rows.isEmpty()){
|
|
|
|
|
+ String message = "您的打款凭证【"+rows.get(0).getString("billno")+"】已退回!";
|
|
|
|
|
+ sendMsg(message, sa_paybillid, sys_enterpriseid);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
return getSucReturnObject().toString();
|
|
return getSucReturnObject().toString();
|
|
|
}
|
|
}
|
|
|
|
|
|