|
@@ -10,7 +10,9 @@ import common.data.*;
|
|
|
import restcontroller.R;
|
|
import restcontroller.R;
|
|
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
import java.math.BigDecimal;
|
|
|
|
|
+import java.text.SimpleDateFormat;
|
|
|
import java.util.ArrayList;
|
|
import java.util.ArrayList;
|
|
|
|
|
+import java.util.Date;
|
|
|
|
|
|
|
|
public class dbstockbillreceive extends Controller {
|
|
public class dbstockbillreceive extends Controller {
|
|
|
public dbstockbillreceive(JSONObject content) throws YosException {
|
|
public dbstockbillreceive(JSONObject content) throws YosException {
|
|
@@ -123,7 +125,8 @@ public class dbstockbillreceive extends Controller {
|
|
|
insertSQL.setDateValue("createdate");
|
|
insertSQL.setDateValue("createdate");
|
|
|
insertSQL.setValue("checkby", username);
|
|
insertSQL.setValue("checkby", username);
|
|
|
insertSQL.setDateValue("checkdate");
|
|
insertSQL.setDateValue("checkdate");
|
|
|
- insertSQL.setValue("billdate", rows.get(0).getLong("billdate"));
|
|
|
|
|
|
|
+ insertSQL.setValue("billdate", rows.get(0).getString("billdate"));
|
|
|
|
|
+ insertSQL.setValue("period", getPeriod(rows.get(0).getDate("billdate")));
|
|
|
sqllist.add(insertSQL.getSQL());
|
|
sqllist.add(insertSQL.getSQL());
|
|
|
int j = 1;
|
|
int j = 1;
|
|
|
for (Row row : dbstockbilldetail) {
|
|
for (Row row : dbstockbilldetail) {
|
|
@@ -165,6 +168,16 @@ public class dbstockbillreceive extends Controller {
|
|
|
return getSucReturnObject().toString();
|
|
return getSucReturnObject().toString();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public String getPeriod(Date date) throws YosException {
|
|
|
|
|
+ String preioddate = new SimpleDateFormat("yyyy-MM-dd").format(date);
|
|
|
|
|
+ Rows rows = dbConnect.runSqlQuery("select CONCAT_WS('-', year, LPAD(month, 2, '0')) period from st_period where begdate<='" + preioddate + "' and enddate>='" + preioddate + "'");
|
|
|
|
|
+ if (rows.size() != 1) {
|
|
|
|
|
+ throw new YosException("单据日期所属会计期间未生成");
|
|
|
|
|
+ } else {
|
|
|
|
|
+ return rows.get(0).getString("period");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
public ArrayList<String> updateIcinvbal(boolean ischeck, boolean isinstock, Rows dbstockbilldetail) throws YosException {
|
|
public ArrayList<String> updateIcinvbal(boolean ischeck, boolean isinstock, Rows dbstockbilldetail) throws YosException {
|
|
|
ArrayList<String> sqlList = new ArrayList();
|
|
ArrayList<String> sqlList = new ArrayList();
|
|
|
ArrayList<Long> itemids = new ArrayList<Long>();
|
|
ArrayList<Long> itemids = new ArrayList<Long>();
|