|
|
@@ -4,6 +4,7 @@ import com.alibaba.fastjson.JSONObject;
|
|
|
import common.Controller;
|
|
|
import common.YosException;
|
|
|
import common.annotation.API;
|
|
|
+import common.data.InsertSQL;
|
|
|
import common.data.Rows;
|
|
|
import common.data.RowsMap;
|
|
|
import common.data.SQLFactory;
|
|
|
@@ -205,7 +206,14 @@ public class item extends Controller {
|
|
|
if(unitRowsMap.containsKey(funitname)){
|
|
|
sqlFactory.addParameter("unitid", unitRowsMap.get(funitname).get(0).getLong("unitid"));
|
|
|
}else {
|
|
|
- sqlFactory.addParameter("unitid", 0);
|
|
|
+ long unitid=createTableID("plm_unit");
|
|
|
+ InsertSQL insertSQL = SQLFactory.createInsertSQL(new Controller(new JSONObject()), "plm_unit");
|
|
|
+ insertSQL.setValue("siteid", "lsa");
|
|
|
+ insertSQL.setValue("unitid", unitid);
|
|
|
+ insertSQL.setValue("unitname", funitname);
|
|
|
+ dbConnect.runSqlUpdate(insertSQL.getSQL());
|
|
|
+ sqlFactory.addParameter("unitid",unitid);
|
|
|
+
|
|
|
}
|
|
|
sqlFactory.addParameter("isauxunit", 0);
|
|
|
sqlFactory.addParameter("unitgroupid","null");
|