hu hace 2 meses
padre
commit
d5671bf864

+ 4 - 4
src/custom/restcontroller/sale/itemgroup/itemgroup.java

@@ -53,8 +53,7 @@ public class itemgroup extends Controller {
     @API(title = "查询", apiversion = R.ID20220926142203.v1.class)
     @CACHEING
     public String queryItemgroup() throws YosException {
-        Long istool = content.getLongValue("istool");
-        //Rows itemclassRows = Enterprise.getItemSaleClasses(this, sys_enterpriseid, true, istool);
+        long ismodule = content.getLongValue("ismodule");
         if (content.containsKey("sys_enterpriseid")) {
             sys_enterpriseid = content.getLongValue("sys_enterpriseid");
         }
@@ -209,6 +208,7 @@ public class itemgroup extends Controller {
         querySQL.addJoinTable(JOINTYPE.left, "plm_unit", "t6", "t6.unitid = t2.unitid AND t6.siteid = t2.siteid","unitname");
         querySQL.setSiteid(siteid);
         querySQL.setWhere("t1.isonsale=1");
+        querySQL.setWhere("t2.ismodule="+ismodule);
         querySQL.setWhere("t1.sa_itemgroupid",rowsgroupids.toArrayList("sa_itemgroupid", new ArrayList<Long>()));
         querySQL.setWhere("t1.sa_brandid",brandids.toArray());
         querySQL.setWhere(where);
@@ -1417,8 +1417,8 @@ public class itemgroup extends Controller {
                 QuerySQL querySQL1 = SQLFactory.createQuerySQL(this, "sa_promotion", "sa_promotionid", "promname");
                 querySQL1.setTableAlias("t1");
                 querySQL1.addQueryFields("balance", "ifnull(t1.balance,0)");
-                querySQL1.addJoinTable(JOINTYPE.inner, "sa_promotion_items", "t2", "t1.sa_promotionid=t2.sa_promotionid and t1.siteid=t2.siteid","accountname");
-                querySQL1.addJoinTable(JOINTYPE.inner, "plm_item", "t3", "t2.itemid=t3.itemid and t2.siteid=t3.siteid","accountname");
+                querySQL1.addJoinTable(JOINTYPE.inner, "sa_promotion_items", "t2", "t1.sa_promotionid=t2.sa_promotionid and t1.siteid=t2.siteid");
+                querySQL1.addJoinTable(JOINTYPE.inner, "plm_item", "t3", "t2.itemid=t3.itemid and t2.siteid=t3.siteid");
                 querySQL1.setSiteid(siteid);
                 querySQL1.setWhere("t2.isonsale=1");
                 querySQL1.setWhere("t3.itemno",itemno);

+ 8 - 0
src/custom/restcontroller/webmanage/sale/workorder/workorderTemplate.java

@@ -171,6 +171,14 @@ public class workorderTemplate extends Controller {
                     continue;
                 }
             }
+            Rows workorderRows = dbConnect
+                    .runSqlQuery("select sa_workorderid from sa_workorder where siteid='" + siteid
+                            + "' and sa_workorder_templateid='" + sa_workorder_templateid + "'");
+            if (!workorderRows.isEmpty()) {
+                //return getErrReturnObject().setErrMsg("该服务工单模板已被使用,无法停用").toString();
+                batchDeleteErr.addErr(sa_workorder_templateid, "该服务工单模板已被使用,无法删除");
+                continue;
+            }
             sqlList.add("delete from sa_workorder_template where siteid='" + siteid + "' and sa_workorder_templateid=" + sa_workorder_templateid);
             sqlList.add("delete from sa_workorder_template_works where siteid='" + siteid + "' and sa_workorder_templateid=" + sa_workorder_templateid);
             dbConnect.runSqlUpdate(sqlList);