hu 2 miesięcy temu
rodzic
commit
ca709c6583

+ 40 - 0
src/custom/restcontroller/R.java

@@ -6047,6 +6047,46 @@ public class R {
         public static class v1 {
         }
     }
+
+    public static class ID2025071010100903 {
+        public static class v1 {
+        }
+    }
+
+    public static class ID2025071010102203 {
+        public static class v1 {
+        }
+    }
+
+    public static class ID2025071010103303 {
+        public static class v1 {
+        }
+    }
+
+    public static class ID2025071010104503 {
+        public static class v1 {
+        }
+    }
+
+    public static class ID2025071010105503 {
+        public static class v1 {
+        }
+    }
+
+    public static class ID2025071010502203 {
+        public static class v1 {
+        }
+    }
+
+    public static class ID2025071010510003 {
+        public static class v1 {
+        }
+    }
+
+    public static class ID2025071010510903 {
+        public static class v1 {
+        }
+    }
 }
 
 

+ 107 - 0
src/custom/restcontroller/webmanage/sale/ItemSaleBom/ItemSaleBom.java

@@ -0,0 +1,107 @@
+package restcontroller.webmanage.sale.ItemSaleBom;
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import common.Controller;
+import common.YosException;
+import common.annotation.API;
+import common.annotation.CACHEING;
+import common.annotation.CACHEING_CLEAN;
+import common.data.InsertSQL;
+import common.data.QuerySQL;
+import common.data.Rows;
+import common.data.SQLFactory;
+import restcontroller.R;
+
+import java.util.ArrayList;
+@API(title = "设置商品的bom")
+public class ItemSaleBom extends Controller {
+    public ItemSaleBom(JSONObject content) throws YosException {
+        super(content);
+    }
+
+
+    @API(title = "新增", apiversion = R.ID2025071010502203.v1.class)
+    @CACHEING_CLEAN(apiClass = {ItemSaleBom.class})
+    public String insertOrUpdate() throws YosException {
+
+        JSONArray plm_bomids = content.getJSONArray("plm_bomids");
+        Long itemid = content.getLong("itemid");
+        String itemno = content.getString("itemno");
+
+        Rows itemRows = dbConnect.runSqlQuery("SELECT isused from plm_item WHERE itemid=" + itemid + " and siteid='" + siteid + "'");
+        if (itemRows.isEmpty()) {
+            return getErrReturnObject().setErrMsg("数据不存在").toString();
+        }
+        if (!itemRows.get(0).getBoolean("isused")) {
+            return getErrReturnObject().setErrMsg("非启用状态,无法编辑商品bom").toString();
+        }
+
+        ArrayList<String> sqlList = new ArrayList<>();
+        if (!plm_bomids.isEmpty()) {
+//            if (itemclassids.size() > 1) {
+//                return getErrReturnObject().setErrMsg("商品只能维护一个营销类别").toString();
+//            }
+            sqlList.add("delete from sa_itemsalebom where itemid =" + itemid + " and siteid='" + siteid + "'");
+            for (Object obj : plm_bomids) {
+                int plm_bomid = (int) obj;
+                InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "sa_itemsalebom");
+                insertSQL.setUniqueid(createTableID("sa_itemsalebom"));
+                insertSQL.setSiteid(siteid);
+                insertSQL.setValue("plm_bomid", plm_bomid);
+                insertSQL.setValue("itemid", itemid);
+                sqlList.add(insertSQL.getSQL());
+            }
+        }
+        dbConnect.runSqlUpdate(sqlList);
+
+
+        return getSucReturnObject().toString();
+    }
+
+
+
+    @API(title = "列表", apiversion = R.ID2025071010510003.v1.class)
+    @CACHEING
+    public String queryList() throws YosException {
+        /*
+          过滤条件设置
+         */
+        StringBuffer where = new StringBuffer(" 1=1 ");
+        if (content.containsKey("where")) {
+            JSONObject whereObject = content.getJSONObject("where");
+            if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
+                where.append(" and(");
+                where.append("t1.bomname like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append("or t1.bomfullname like'%").append(whereObject.getString("condition")).append("%' ");
+                where.append(")");
+            }
+
+
+        }
+        Long itemid = content.getLong("itemid");
+        QuerySQL querySQL = SQLFactory.createQuerySQL(this, "plm_bom", "plm_bomid", "bomname",
+                "bomfullname");
+        querySQL.setTableAlias("t1");
+        querySQL.addJoinTable(JOINTYPE.left, "plm_itemclass", "t3", "t1.parentid = t3.itemclassid and t1.siteid = t3.siteid");
+        querySQL.addJoinTable(JOINTYPE.inner, "sa_itemsalebom", "t4", "t4.plm_bomid = t1.plm_bomid and t1.siteid = t4.siteid","sa_itemsalebomid");
+        querySQL.addQueryFields("parentitemclassname","t3.itemclassname");
+        querySQL.setSiteid(siteid);
+        querySQL.setWhere("t4.itemid",itemid);
+        querySQL.setWhere(where.toString());
+        querySQL.setPage(pageSize, pageNumber);
+        querySQL.setOrderBy(pageSorting);
+        Rows rows = querySQL.query();
+        return getSucReturnObject().setData(rows).toString();
+    }
+
+    @API(title = "删除", apiversion = R.ID2025071010510903.v1.class)
+    @CACHEING_CLEAN(apiClass = {ItemSaleBom.class})
+    public String delete() throws YosException {
+        JSONArray sa_itemsalebomids = content.getJSONArray("sa_itemsalebomids");
+        String sql = "DELETE FROM sa_itemsalebom WHERE sa_itemsalebomid in " + sa_itemsalebomids + " and siteid = '" + siteid + "'";
+        sql = sql.replace("[", "(").replace("]", ")");
+        dbConnect.runSqlUpdate(sql);
+        return getSucReturnObject().toString();
+    }
+}

+ 3 - 0
src/custom/restcontroller/webmanage/sale/bom/SQL/bom末级列表查询.sql

@@ -0,0 +1,3 @@
+select t2.bomname upitemclassname,t1.plm_bomid,t1.bomname,t1.bomfullname,ifnull(t1.parentid,0) as parentid,t1.num,t1.isdeep,t1.createby,t1.createdate,t1.changeby,t1.changedate from plm_bom t1
+left join plm_bom t2 on t1.parentid=t2.plm_bomid and t1.siteid=t2.siteid
+where $where$ and  ifnull(t1.isdeep,0)=1  and t1.siteid=$siteid$ order by t1.parentid,ifnull(ISNULL(t1.num)=0 and LENGTH(trim(t1.num))=0,99) asc

+ 13 - 0
src/custom/restcontroller/webmanage/sale/bom/SQL/下级bom获取.sql

@@ -0,0 +1,13 @@
+with recursive bom as (
+    select plm_bomid,bomfullname
+    from plm_bom
+    where siteid =$siteid$
+      and plm_bomid =$plm_bomid$
+    union all
+    select t2.plm_bomid,t2.bomfullname
+    from bom t1
+             inner join plm_bom t2 on t1.plm_bomid = t2.parentid and t2.siteid = $siteid$
+)
+select plm_bomid,bomfullname
+from bom
+where plm_bomid !=$plm_bomid$

+ 21 - 0
src/custom/restcontroller/webmanage/sale/bom/SQL/查询所有分类.sql

@@ -0,0 +1,21 @@
+with recursive saleclass as (select t1.plm_bomid,
+                                    t1.bomname,
+                                    t1.bomfullname,
+                                    ifnull(t1.parentid, 0) as parentid,
+                                    t1.num,
+                                    t1.isdeep
+                             from plm_bom t1
+                             where t1.siteid = $siteid$
+                             union
+                             select t2.plm_bomid,
+                                    t2.bomname,
+                                    t2.bomfullname,
+                                    ifnull(t2.parentid, 0) as parentid,
+                                    t2.num,
+                                    t2.isdeep
+                             from plm_bom t2,
+                                  saleclass t3
+                             where t2.siteid = $siteid$
+                               and t2.plm_bomid = t3.parentid)
+select *
+from saleclass

+ 30 - 0
src/custom/restcontroller/webmanage/sale/bom/SortByNum.java

@@ -0,0 +1,30 @@
+package restcontroller.webmanage.sale.bom;
+
+import common.data.Row;
+import org.apache.commons.lang.StringUtils;
+
+import java.util.Comparator;
+
+public class SortByNum implements Comparator {
+    public int compare(Object o1, Object o2) {
+        Row s1 = (Row) o1;
+        Row s2 = (Row) o2;
+        double s1int = 0;
+        double s2int = 0;
+        //System.out.println("测试");
+        if (StringUtils.isBlank(s1.getString("num"))) {
+            s1int = 999;
+        } else {
+            s1int = Double.parseDouble(s1.getString("num"));
+        }
+        if (StringUtils.isBlank(s2.getString("num"))) {
+            s2int = 9999;
+        } else {
+            s2int = Double.parseDouble(s2.getString("num"));
+        }
+        // System.out.println(s1int + "," + s2int);
+        if (s1int > s2int)
+            return 1;
+        return -1;
+    }
+}

+ 308 - 0
src/custom/restcontroller/webmanage/sale/bom/bom.java

@@ -0,0 +1,308 @@
+package restcontroller.webmanage.sale.bom;
+
+
+import com.alibaba.fastjson.JSONArray;
+import com.alibaba.fastjson.JSONObject;
+import common.Controller;
+import common.YosException;
+import common.annotation.API;
+import common.annotation.CACHEING;
+import common.annotation.CACHEING_CLEAN;
+import common.data.*;
+import restcontroller.R;
+
+
+
+import java.util.ArrayList;
+import java.util.Collections;
+
+@API(title = "bom结构")
+public class bom extends Controller {
+
+    public bom(JSONObject content) throws YosException {
+        super(content);
+    }
+
+    /**
+     * 新增修改bom
+     *
+     * @return
+     */
+    @API(title = "bom新增修改", apiversion = R.ID2025071010100903.v1.class)
+    @CACHEING_CLEAN(apiClass = {bom.class})
+    public String insertormodify_bom() throws YosException {
+        long plm_bomid = content.getLong("plm_bomid");
+        long parentid = content.getLong("parentid");
+        String bomname = content.getString("bomname");
+        String num = content.getStringValue("num");
+        ArrayList<String> sqllist = new ArrayList<>();
+        if (plm_bomid <= 0 || dbConnect
+                .runSqlQuery("select plm_bomid from plm_bom where plm_bomid=" + plm_bomid).isEmpty()) {
+
+            Rows rows = dbConnect.runSqlQuery("SELECT COUNT(*) count FROM plm_bom WHERE bomname = '" + bomname + "' and siteid='" + siteid + "'");
+            if (!rows.isEmpty() && rows.get(0).getLong("count") > 0) {
+                return getErrReturnObject().setErrMsg("bom名称已存在").toString();
+            }
+            InsertSQL insertSQL = SQLFactory.createInsertSQL(this, "plm_bom");
+            plm_bomid = createTableID("plm_bom");
+            insertSQL.setUniqueid(plm_bomid);
+            insertSQL.setSiteid(siteid);
+            insertSQL.setValue("bomname", bomname);
+            insertSQL.setValue("parentid", parentid);
+            insertSQL.setValue("bomfullname",
+                    getUppebomfullname(bomname, parentid, plm_bomid));
+            insertSQL.setValue("num", num);
+            insertSQL.setValue("isdeep", 1);
+            insertSQL.setValue("level", 1);
+            if (parentid > 0) {
+                sqllist = getbomlevel(1, parentid, plm_bomid, sqllist);
+                sqllist.add("update plm_bom set isdeep=0 where plm_bomid=" + parentid);
+            }
+            insertSQL.setValue("createby", username);
+            insertSQL.setDateValue("createdate");
+            sqllist.add(insertSQL.getSQL());
+        } else {
+            Rows rows = dbConnect.runSqlQuery("SELECT COUNT(*) count FROM plm_bom WHERE plm_bomid!=" + content.getLong("plm_bomid") + " and bomname = '" + bomname
+                    + "' and siteid='" + siteid + "'");
+            Rows bomnameOldRows = dbConnect.runSqlQuery(
+                    "SELECT bomname,bomfullname FROM plm_bom WHERE  plm_bomid=" + content.getLong("plm_bomid") + " and siteid='"
+                            + siteid + "'");
+            if (!rows.isEmpty() && rows.get(0).getLong("count") > 0) {
+                return getErrReturnObject().setErrMsg("bom已存在").toString();
+            }
+//            if (!rowsname.isEmpty() && rowsname.get(0).getLong("count") > 0) {
+//                return getErrReturnObject().setErrMsg("bom已存在").toString();
+//            }
+            String bomnameOld = "";
+            if (!bomnameOldRows.isEmpty()) {
+                bomnameOld = bomnameOldRows.get(0).getString("bomname");
+            }
+            UpdateSQL updateSQL = SQLFactory.createUpdateSQL(this, "plm_bom");
+            updateSQL.setUniqueid(plm_bomid);
+            updateSQL.setSiteid(siteid);
+            updateSQL.setValue("bomname", bomname);
+            updateSQL.setValue("changeby", username);
+            updateSQL.setDateValue("changedate");
+            if (!bomnameOldRows.get(0).getString("bomfullname").contains("/")) {
+                updateSQL.setValue("bomfullname", bomname);
+            } else {
+                updateSQL.setValue("bomfullname",
+                        bomnameOldRows.get(0).getString("bomfullname").substring(0,
+                                bomnameOldRows.get(0).getString("bomfullname").lastIndexOf("/")) + "/"
+                                + bomname);
+            }
+            updateSQL.setValue("num", num);
+            if (!bomnameOld.equals("")) {
+                sqllist.addAll(getLowerbomUpdateSql(plm_bomid, bomnameOld, bomname));
+            }
+            sqllist.add(updateSQL.getSQL());
+        }
+        dbConnect.runSqlUpdate(sqllist);
+
+        return getSucReturnObject().toString();
+    }
+
+    @API(title = "bomNum新增修改", apiversion = R.ID2025071010102203.v1.class)
+    @CACHEING_CLEAN(apiClass = {bom.class})
+    public String modify_bomNum() throws YosException {
+        JSONArray bominfos = content.getJSONArray("bominfos");
+        ArrayList<String> sqlList = new ArrayList<>();
+        for (Object obj : bominfos) {
+            JSONObject bominfo = (JSONObject) obj;
+            sqlList.add("update plm_bom set num='"+bominfo.getString("num")+"' where plm_bomid="+bominfo.getLong("plm_bomid"));
+        }
+        dbConnect.runSqlUpdate(sqlList);
+        return getSucReturnObject().toString();
+    }
+
+
+
+    /**
+     * 查询bom
+     *
+     * @return
+     */
+    @API(title = "查询", apiversion = R.ID2025071010103303.v1.class)
+    @CACHEING
+    public String querybom() throws YosException {
+
+        /*
+         * 查询所有分类
+         */
+        SQLFactory sqlFactory = new SQLFactory(this, "查询所有分类");
+        sqlFactory.addParameter("siteid", siteid);
+
+
+        String sql = sqlFactory.getSQL();
+        Rows allrows = dbConnect.runSqlQuery(sql);
+        /*
+         * 获取所有一级分类
+         */
+        Rows rows2 =new Rows();
+        Row row =new Row();
+        Rows toprows = allrows.toRowsMap("parentid").get("0");
+        Collections.sort(toprows, new SortByNum());
+        /*
+         * 递归查询
+         */
+        for (Row row1 : toprows) {
+            Rows rows1 = getSubbom(row1, allrows);
+            //Collections.sort(rows1, new SortByNum());
+            row1.put("subdep", rows1);
+        }
+        row.put("bom", toprows);
+        rows2.add(row);
+        if (rows2.isNotEmpty()) {
+            if (((Rows) rows2.get(0).get("bom")).isNotEmpty()) {
+                Collections.sort((Rows) rows2.get(0).get("bom"), new SortByNum());
+            }
+        }
+        return getSucReturnObject().setData(rows2).toString();
+
+    }
+
+
+    /**
+     * 查询末级bom
+     *
+     * @return
+     */
+    @API(title = "查询", apiversion = R.ID2025071010104503.v1.class)
+    @CACHEING
+    public String querybomLaststage() throws YosException {
+        // long sa_brandid = content.getLong("sa_brandid");
+        /*
+         * 过滤条件设置
+         */
+        String where = " 1=1 ";
+        if (content.containsKey("where")) {
+            JSONObject whereObject = content.getJSONObject("where");
+
+            if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
+                where = where + " and (t1.bomname like'%" + whereObject.getString("condition") + "%') ";
+            }
+        }
+        SQLFactory factory = new SQLFactory(this, "bom末级列表查询");
+        factory.addParameter("siteid", siteid);
+        factory.addParameter_SQL("where", where);
+        Rows rows = dbConnect.runSqlQuery(factory.getSQL());
+
+        return getSucReturnObject().setData(rows).toString();
+    }
+
+
+    @API(title = "删除", apiversion = R.ID2025071010105503.v1.class)
+    @CACHEING_CLEAN(apiClass = {bom.class})
+    public String delete() throws YosException {
+        Long plm_bomid = content.getLong("plm_bomid");
+
+        Rows rowscount = dbConnect.runSqlQuery(
+                "select isdeep,ifnull(parentid,0) parentid from plm_bom where plm_bomid=" + plm_bomid);
+        if (rowscount.isEmpty()) {
+            return getErrReturnObject().setErrMsg("此bom不存在,无法删除").toString();
+        } else {
+            if (!rowscount.get(0).getBoolean("isdeep")) {
+                return getErrReturnObject().setErrMsg("此bom非末级,无法删除").toString();
+            }
+        }
+        Rows row = dbConnect.runSqlQuery("select itemid from sa_itemsalebom where plm_bomid=" + plm_bomid);
+        if (!row.isEmpty()) {
+            return getErrReturnObject().setErrMsg("此bom下存在数据,无法删除").toString();
+        }
+
+        ArrayList<String> sqllist = new ArrayList<>();
+        sqllist.add("update plm_bom set isdeep=1 where plm_bomid=" + rowscount.get(0).getLong("parentid"));
+        String deletesql = "DELETE FROM plm_bom WHERE plm_bomid = '" + plm_bomid + "'";
+        sqllist.add(deletesql);
+
+        dbConnect.runSqlUpdate(sqllist);
+        return getSucReturnObject().toString();
+
+    }
+
+    /**
+     * 递归查询下级产品类别
+     *
+     * @param root
+     * @param allboms
+     * @return
+     */
+    private Rows getSubbom(Row root, Rows allboms) {
+        Rows childrenRows = allboms.toRowsMap("parentid").get(root.getString("plm_bomid"));
+        Collections.sort(childrenRows, new SortByNum());
+        for (Row row : childrenRows) {
+            row.put("subdep", getSubbom(row, allboms));
+        }
+        return childrenRows;
+    }
+
+    private ArrayList<String> getbomlevel(int level, long parentid, long plm_bomid, ArrayList<String> sqllist)
+            throws YosException {
+        if (parentid > 0) {
+            Rows rows = dbConnect.runSqlQuery(
+                    "select ifnull(parentid,0) as parentid from plm_bom where plm_bomid= '"
+                            + parentid + "'");
+            if (!rows.isEmpty()) {
+                level++;
+                sqllist.add("update plm_bom set level='" + level + "' where plm_bomid= '" + parentid + "'");
+                getbomlevel(level, rows.get(0).getLong("parentid"), rows.get(0).getLong("plm_bomid"), sqllist);
+            }
+
+        }
+        return sqllist;
+    }
+
+    private String getUppebomfullname(String fullname, long parentid, long plm_bomid) throws YosException {
+        String fullnum = "";
+        if (parentid > 0) {
+            Rows rows = dbConnect.runSqlQuery(
+                    "select ifnull(parentid,0) as parentid,bomfullname from plm_bom where plm_bomid= '"
+                            + parentid + "'");
+            if (!rows.isEmpty()) {
+                fullnum = rows.get(0).getString("bomfullname") + "/" + fullname;
+            }
+
+        } else {
+            fullnum = fullname;
+
+        }
+
+        return fullnum;
+
+    }
+
+    /**
+     * 根据指定的bomid获取下级bomid及营销路径名
+     *
+     * @param controller
+     * @param plm_bomid
+     * @throws YosException
+     */
+    public static Rows getSubbom(Controller controller, long plm_bomid) throws YosException {
+        SQLFactory sqlFactory = new SQLFactory(controller, "下级bom获取");
+        sqlFactory.addParameter("siteid", controller.siteid);
+        sqlFactory.addParameter("plm_bomid", plm_bomid);
+        Rows rows = controller.dbConnect.runSqlQuery(sqlFactory.getSQL());
+
+        return rows;
+    }
+
+    private ArrayList<String> getLowerbomUpdateSql(long plm_bomid, String bomnameOld,
+                                                         String bomnameNew) throws YosException {
+        ArrayList<String> sqlList = new ArrayList<String>();
+        Rows rows = getSubbom(this, plm_bomid);
+        if (!rows.isEmpty()) {
+            for (Row row : rows) {
+                if (row.getString("bomfullname").contains(bomnameOld)) {
+                    String bomfullname = row.getString("bomfullname").replace(bomnameOld,
+                            bomnameNew);
+                    String sql = "update plm_bom set bomfullname='" + bomfullname
+                            + "' where plm_bomid=" + row.getLong("plm_bomid");
+                    sqlList.add(sql);
+                }
+            }
+        }
+        return sqlList;
+
+    }
+}

+ 2 - 0
src/custom/restcontroller/webmanage/sale/item/Item.java

@@ -220,6 +220,8 @@ public class Item extends Controller {
         sqlFactory.addParameter("executionstandards", content.getStringValue("executionstandards"));
         sqlFactory.addParameter("itemclsnum", content.getStringValue("itemclsnum"));
         sqlFactory.addParameter("outplace", content.getStringValue("outplace"));
+        sqlFactory.addParameter("repairattribute", content.getStringValue("repairattribute"));
+
 
         sqlList.add(sqlFactory.getSQL());
         // 货品档案扩展属性字段表

+ 2 - 2
src/custom/restcontroller/webmanage/sale/item/SQL/货品档案新增.sql

@@ -6,7 +6,7 @@ insert into plm_item (siteid, itemid, createby, createdate, changeuserid, change
                       sa_customschemeid, cheek, delistingstatus, financeclasstype, stockno, volume, marketingcategory,
                       pricingmetod,cheekschemeid,colorschemeid,materialschemeid,cost,grossprofit,grossprofitmargin,saleprice,
                       rate,grade,custamount,safeqty,icaddqty,icminqty,iswriteoff,isnegative,ispartorderautocheck,islimitemparts,itemname_print,
-                      applicablegassource,hygienelicensenum,departmentid,executionstandards,itemclsnum,outplace)
+                      applicablegassource,hygienelicensenum,departmentid,executionstandards,itemclsnum,outplace,repairattribute)
 values ($siteid$, $itemid$, $username$, CURRENT_TIME, $userid$, $username$, CURRENT_TIME, $itemno$, $unitid$,
         $isauxunit$, $unitgroupid$, $itemname$, $isonsale$, '新建', $model$, $spec$, $orderminqty$, $orderaddqty$,
         $orderminqty_auxunit$, $orderaddqty_auxunit$, $remarks$, $barcode$, $skucontrol$, $batchcontrol$, $grossweight$,
@@ -15,4 +15,4 @@ values ($siteid$, $itemid$, $username$, CURRENT_TIME, $userid$, $username$, CURR
         $iswoodproducts$, $sa_customschemeid$, $cheek$, $delistingstatus$, $financeclasstype$, $stockno$, $volume$,
         $marketingcategory$, $pricingmetod$,$cheekschemeid$,$colorschemeid$,$materialschemeid$,$cost$,$grossprofit$,$grossprofitmargin$,$saleprice$,
         $rate$,$grade$,$custamount$,$safeqty$,$icaddqty$,$icminqty$,$iswriteoff$,$isnegative$,$ispartorderautocheck$,$islimitemparts$,$itemname_print$,
-        $applicablegassource$,$hygienelicensenum$,$departmentid$,$executionstandards$,$itemclsnum$,$outplace$)
+        $applicablegassource$,$hygienelicensenum$,$departmentid$,$executionstandards$,$itemclsnum$,$outplace$,$repairattribute$)

+ 2 - 1
src/custom/restcontroller/webmanage/sale/item/SQL/货品档案更新.sql

@@ -70,7 +70,8 @@ SET changeuserid=$userid$,
     departmentid=$departmentid$,
     executionstandards=$executionstandards$,
     itemclsnum=$itemclsnum$,
-    outplace=$outplace$
+    outplace=$outplace$,
+    repairattribute=$repairattribute$
 WHERE itemid = $itemid$
   and siteid = $siteid$