|
|
@@ -16,6 +16,7 @@ import common.annotation.CACHEING;
|
|
|
import common.annotation.CACHEING_CLEAN;
|
|
|
import common.data.*;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import org.apache.poi.hssf.record.DVALRecord;
|
|
|
import restcontroller.R;
|
|
|
import restcontroller.webmanage.sale.order.Order;
|
|
|
import restcontroller.webmanage.sale.order.OrderItems;
|
|
|
@@ -174,6 +175,38 @@ public class stockbill extends Controller {
|
|
|
return queryStockbillMain();
|
|
|
}
|
|
|
|
|
|
+ @API(title = "单据日期调整", apiversion = R.ID2025102215133403.v1.class)
|
|
|
+ public String billdateChange() throws YosException {
|
|
|
+ Long st_stockbillid = content.getLong("st_stockbillid");
|
|
|
+ String billdate = content.getString("billdate");
|
|
|
+ ArrayList<String> sqlList = new ArrayList<>();
|
|
|
+ Rows rows = dbConnect.runSqlQuery(
|
|
|
+ "SELECT status,period from st_stockbill WHERE st_stockbillid = "
|
|
|
+ + st_stockbillid);
|
|
|
+ if(rows.isNotEmpty()){
|
|
|
+ if (rows.get(0).getString("status").equals("审核")) {
|
|
|
+ RowsMap rowsMap =dbConnect.runSqlQuery("select CONCAT(year, '-',LPAD(month, 2, '0')) period,isclose from st_period").toRowsMap("period");
|
|
|
+ if (rowsMap.containsKey(rows.get(0).getString("period"))) {
|
|
|
+ if(rowsMap.get(rows.get(0).getString("period")).toRowsMap("isclose").containsKey("1")){
|
|
|
+ return getErrReturnObject().setErrMsg("原单据会计期间已关闭,不可调整").toString();
|
|
|
+ }
|
|
|
+ sqlList.add(DataContrlLog.createLog(this, "st_stockbill", st_stockbillid, "更新", "单据日期【"+billdate+"】调整成功").getSQL());
|
|
|
+ }else{
|
|
|
+ return getErrReturnObject().setErrMsg("原单据会计期间未生成,不可调整").toString();
|
|
|
+ }
|
|
|
+
|
|
|
+ }else{
|
|
|
+ sqlList.add(DataContrlLog.createLog(this, "st_stockbill", st_stockbillid, "更新", "单据日期【"+billdate+"】调整成功").getSQL());
|
|
|
+ }
|
|
|
+ sqlList.add("update st_stockbill set billdate='"+billdate+"' where st_stockbillid="+st_stockbillid);
|
|
|
+ } else {
|
|
|
+ return getErrReturnObject().setErrMsg("该出入库单不存在").toString();
|
|
|
+ }
|
|
|
+ dbConnect.runSqlUpdate(sqlList);
|
|
|
+ return getSucReturnObject().toString();
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
@API(title = "出入库单详情", apiversion = R.ID20230719153803.v1.class)
|
|
|
@CACHEING
|
|
|
public String queryStockbillMain() throws YosException {
|