소스 검색

错误修复

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
         String billdate = content.getStringValue("billdate");// 单据日期
 
-        if (!getBillStatus(sys_enterprise_stockbillid).equals("新建")) {
-            return getErrReturnObject().setErrMsg("当前单据不是新建状态,不能修改").toString();
-        }
         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()) {
             sys_enterprise_stockbillid = createTableID("sys_enterprise_stockbill");
@@ -80,6 +77,10 @@ public class stockbill extends Controller {
             insertSQL.setUniqueid(sys_enterprise_stockbillid);
             sqldump.add(insertSQL);
         } else {
+
+            if (!getBillStatus(sys_enterprise_stockbillid).equals("新建")) {
+                return getErrReturnObject().setErrMsg("当前单据不是新建状态,不能修改").toString();
+            }
             UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "sys_enterprise_stockbill");
             updateSQL.setValue("sa_custorderid", sa_custorderid);// C端订单ID
             updateSQL.setValue("sa_customersid", getCustomerid(sa_custorderid));// 客户ID