浏览代码

错误修复

shenjingwei 1 周之前
父节点
当前提交
40f40df809
共有 1 个文件被更改,包括 4 次插入3 次删除
  1. 4 3
      src/custom/restcontroller/crm/agent/stock/stockbill.java

+ 4 - 3
src/custom/restcontroller/crm/agent/stock/stockbill.java

@@ -58,9 +58,6 @@ public class stockbill extends Controller {
         long sys_enterprise_stockid = content.getLongValue("sys_enterprise_stockid");// 企业仓库ID
         long sys_enterprise_stockid = content.getLongValue("sys_enterprise_stockid");// 企业仓库ID
         String billdate = content.getStringValue("billdate");// 单据日期
         String billdate = content.getStringValue("billdate");// 单据日期
 
 
-        if (!getBillStatus(sys_enterprise_stockbillid).equals("新建")) {
-            return getErrReturnObject().setErrMsg("当前单据不是新建状态,不能修改").toString();
-        }
         SQLDump sqldump = new SQLDump();
         SQLDump sqldump = new SQLDump();
         if (sys_enterprise_stockbillid <= 0 || SQLFactory.createQuerySQL(this, "sys_enterprise_stockbill", "sys_enterprise_stockbillid").setSiteid(siteid).setUniqueid(sys_enterprise_stockbillid).query().isEmpty()) {
         if (sys_enterprise_stockbillid <= 0 || SQLFactory.createQuerySQL(this, "sys_enterprise_stockbill", "sys_enterprise_stockbillid").setSiteid(siteid).setUniqueid(sys_enterprise_stockbillid).query().isEmpty()) {
             sys_enterprise_stockbillid = createTableID("sys_enterprise_stockbill");
             sys_enterprise_stockbillid = createTableID("sys_enterprise_stockbill");
@@ -80,6 +77,10 @@ public class stockbill extends Controller {
             insertSQL.setUniqueid(sys_enterprise_stockbillid);
             insertSQL.setUniqueid(sys_enterprise_stockbillid);
             sqldump.add(insertSQL);
             sqldump.add(insertSQL);
         } else {
         } else {
+
+            if (!getBillStatus(sys_enterprise_stockbillid).equals("新建")) {
+                return getErrReturnObject().setErrMsg("当前单据不是新建状态,不能修改").toString();
+            }
             UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sys_enterprise_stockbill");
             UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sys_enterprise_stockbill");
             updateSQL.setValue("sa_custorderid", sa_custorderid);// C端订单ID
             updateSQL.setValue("sa_custorderid", sa_custorderid);// C端订单ID
             updateSQL.setValue("sa_customersid", getCustomerid(sa_custorderid));// 客户ID
             updateSQL.setValue("sa_customersid", getCustomerid(sa_custorderid));// 客户ID