itemclass.java 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541
  1. package restcontroller.webmanage.sale.itemclass;
  2. import beans.enterprise.Enterprise;
  3. import beans.itemclass.ItemClass;
  4. import com.alibaba.fastjson.JSONObject;
  5. import common.Controller;
  6. import common.YosException;
  7. import common.annotation.API;
  8. import common.annotation.CACHEING;
  9. import common.annotation.CACHEING_CLEAN;
  10. import common.annotation.cm;
  11. import common.data.Row;
  12. import common.data.Rows;
  13. import common.data.SQLFactory;
  14. import restcontroller.R;
  15. import java.util.ArrayList;
  16. import java.util.Collections;
  17. @API(title = "营销类别")
  18. public class itemclass extends Controller {
  19. public itemclass(JSONObject arg0) throws YosException {
  20. super(arg0);
  21. // TODO Auto-generated constructor stub
  22. }
  23. /**
  24. * 新增修改营销类别
  25. *
  26. * @return
  27. */
  28. @API(title = "营销类别新增修改", apiversion = R.ID20220922110303.v1.class,intervaltime = 200)
  29. @CACHEING_CLEAN(cms = { @cm(clazz = itemclass.class, method = { "queryItemclass", "queryItemclassLaststage" }) })
  30. public String insertormodify_itemclass() throws YosException {
  31. long itemclassid = content.getLong("itemclassid");
  32. long sa_brandid = content.getLong("sa_brandid");
  33. long parentid = content.getLong("parentid");
  34. // String itemclassfullname = content.getString("itemclassfullname");
  35. String itemclassnum = content.getString("itemclassnum");
  36. String itemclassname = content.getString("itemclassname");
  37. String classtype = content.getString("classtype");
  38. String num = content.getStringValue("num");
  39. boolean ishide = content.getBooleanValue("ishide");
  40. boolean istool = content.getBooleanValue("istool");
  41. ArrayList<String> sqllist = new ArrayList<>();
  42. if (itemclassid <= 0 || dbConnect
  43. .runSqlQuery("select itemclassid from plm_itemclass where itemclassid=" + itemclassid).isEmpty()) {
  44. Rows rows = dbConnect.runSqlQuery("SELECT COUNT(*) count FROM plm_itemclass WHERE sa_brandid='" + sa_brandid
  45. + "' and itemclassnum = '" + itemclassnum + "' and siteid='" + siteid + "'");
  46. Rows rowsname = dbConnect.runSqlQuery("SELECT COUNT(*) count FROM plm_itemclass WHERE sa_brandid='"
  47. + sa_brandid + "' and itemclassname = '" + itemclassname + "' and siteid='" + siteid + "'");
  48. if (!rows.isEmpty() && rows.get(0).getLong("count") > 0) {
  49. return getErrReturnObject().setErrMsg("营销类别已存在").toString();
  50. }
  51. // if (!rowsname.isEmpty() && rowsname.get(0).getLong("count") > 0) {
  52. // return getErrReturnObject().setErrMsg("营销类别已存在").toString();
  53. // }
  54. SQLFactory sqlAddFactory = new SQLFactory(this, "营销类别新增");
  55. itemclassid = createTableID("plm_itemclass");
  56. sqlAddFactory.addParameter("itemclassid", itemclassid);
  57. sqlAddFactory.addParameter("siteid", siteid);
  58. sqlAddFactory.addParameter("itemclassnum", itemclassnum);
  59. sqlAddFactory.addParameter("itemclassname", itemclassname);
  60. sqlAddFactory.addParameter("username", username);
  61. sqlAddFactory.addParameter("userid", userid);
  62. if (parentid == 0) {
  63. sqlAddFactory.addParameter("istool", istool);
  64. } else {
  65. Rows toolRows = dbConnect.runSqlQuery("select itemclassid,istool from plm_itemclass where itemclassid="
  66. + parentid + " and siteid='" + siteid + "'");
  67. if (!toolRows.isEmpty()) {
  68. sqlAddFactory.addParameter("istool", toolRows.get(0).getLong("istool"));
  69. } else {
  70. return getErrReturnObject().setErrMsg("上级类别不存在").toString();
  71. }
  72. }
  73. sqlAddFactory.addParameter("parentid", parentid);
  74. sqlAddFactory.addParameter("itemclassfullname",
  75. getUppeItemclassfullname(itemclassname, parentid, itemclassid));
  76. sqlAddFactory.addParameter("itemclassfullnum",
  77. getUppeItemclassfullnum(itemclassnum, parentid, itemclassid));
  78. sqlAddFactory.addParameter("classtype", classtype);
  79. sqlAddFactory.addParameter("num", num);
  80. sqlAddFactory.addParameter("ishide", ishide);
  81. sqlAddFactory.addParameter("sa_brandid", sa_brandid);
  82. sqlAddFactory.addParameter("isdeep", 1);
  83. sqlAddFactory.addParameter("level", 1);
  84. if (parentid > 0) {
  85. sqllist = getItemclasslevel(1, parentid, itemclassid, sqllist);
  86. sqllist.add("update plm_itemclass set isdeep=0 where itemclassid=" + parentid);
  87. }
  88. sqllist.add(sqlAddFactory.getSQL());
  89. } else {
  90. Rows rows = dbConnect.runSqlQuery("SELECT COUNT(*) count FROM plm_itemclass WHERE sa_brandid='" + sa_brandid
  91. + "' and itemclassid!=" + content.getLong("itemclassid") + " and itemclassnum = '" + itemclassnum
  92. + "' and siteid='" + siteid + "'");
  93. Rows rowsname = dbConnect.runSqlQuery("SELECT COUNT(*) count FROM plm_itemclass WHERE sa_brandid='"
  94. + sa_brandid + "' and itemclassid!=" + content.getLong("itemclassid") + " and itemclassname = '"
  95. + itemclassname + "' and siteid='" + siteid + "'");
  96. Rows itemclassnameOldRows = dbConnect.runSqlQuery(
  97. "SELECT itemclassname,itemclassfullname,itemclassfullnum FROM plm_itemclass WHERE sa_brandid='"
  98. + sa_brandid + "' and itemclassid=" + content.getLong("itemclassid") + " and siteid='"
  99. + siteid + "'");
  100. if (!rows.isEmpty() && rows.get(0).getLong("count") > 0) {
  101. return getErrReturnObject().setErrMsg("营销类别已存在").toString();
  102. }
  103. // if (!rowsname.isEmpty() && rowsname.get(0).getLong("count") > 0) {
  104. // return getErrReturnObject().setErrMsg("营销类别已存在").toString();
  105. // }
  106. String itemclassnameOld = "";
  107. if (!itemclassnameOldRows.isEmpty()) {
  108. itemclassnameOld = itemclassnameOldRows.get(0).getString("itemclassname");
  109. }
  110. SQLFactory sqlUpdateFactory = new SQLFactory(this, "营销类别更新");
  111. sqlUpdateFactory.addParameter("itemclassid", itemclassid);
  112. sqlUpdateFactory.addParameter("siteid", siteid);
  113. sqlUpdateFactory.addParameter("itemclassname", itemclassname);
  114. sqlUpdateFactory.addParameter("username", username);
  115. sqlUpdateFactory.addParameter("userid", userid);
  116. // sqlUpdateFactory.addParameter("itemclassfullname",
  117. // getUppeItemclassfullname(itemclassname, parentid, itemclassid));
  118. // sqlUpdateFactory.addParameter("itemclassfullnum",
  119. // getUppeItemclassfullnum(itemclassnum, parentid, itemclassid));
  120. if (!itemclassnameOldRows.get(0).getString("itemclassfullname").contains("/")) {
  121. sqlUpdateFactory.addParameter("itemclassfullname", itemclassname);
  122. } else {
  123. sqlUpdateFactory.addParameter("itemclassfullname",
  124. itemclassnameOldRows.get(0).getString("itemclassfullname").substring(0,
  125. itemclassnameOldRows.get(0).getString("itemclassfullname").lastIndexOf("/")) + "/"
  126. + itemclassname);
  127. }
  128. sqlUpdateFactory.addParameter("itemclassfullnum",
  129. itemclassnameOldRows.get(0).getString("itemclassfullnum"));
  130. sqlUpdateFactory.addParameter("classtype", classtype);
  131. sqlUpdateFactory.addParameter("num", num);
  132. sqlUpdateFactory.addParameter("ishide", ishide);
  133. if (parentid == 0) {
  134. sqlUpdateFactory.addParameter("istool", istool);
  135. ArrayList<Long> list = new ArrayList<Long>();
  136. list.add(itemclassid);
  137. ArrayList<Long> Sublist = ItemClass.getSubItemClassIds(this, list);
  138. Sublist.add((long) 0);
  139. String sqlString = "update plm_itemclass set istool=" + istool + " where itemclassid in" + Sublist;
  140. sqlString = sqlString.replace("[", "(").replace("]", ")");
  141. sqllist.add(sqlString);
  142. } else {
  143. Rows toolRows = dbConnect.runSqlQuery("select itemclassid,istool from plm_itemclass where itemclassid="
  144. + parentid + " and siteid='" + siteid + "'");
  145. if (!toolRows.isEmpty()) {
  146. sqlUpdateFactory.addParameter("istool", toolRows.get(0).getLong("istool"));
  147. } else {
  148. return getErrReturnObject().setErrMsg("上级类别不存在").toString();
  149. }
  150. }
  151. if (!itemclassnameOld.equals("")) {
  152. sqllist.addAll(getLowerItemclassUpdateSql(itemclassid, itemclassnameOld, itemclassname));
  153. }
  154. sqllist.add(sqlUpdateFactory.getSQL());
  155. }
  156. dbConnect.runSqlUpdate(sqllist);
  157. return getSucReturnObject().toString();
  158. }
  159. /**
  160. * 查询营销类别
  161. *
  162. * @return
  163. */
  164. @API(title = "查询", apiversion = R.ID20220922110403.v1.class)
  165. @CACHEING
  166. public String queryItemclass() throws YosException {
  167. long sa_brandid = content.getLongValue("sa_brandid");
  168. // long istool = content.getLongValue("istool");
  169. if (content.containsKey("sys_enterpriseid")) {
  170. sys_enterpriseid = content.getLongValue("sys_enterpriseid");
  171. }
  172. /*
  173. * 过滤条件设置
  174. */
  175. // String where = " 1=1 ";
  176. // if (content.containsKey("where")) {
  177. // JSONObject whereObject = content.getJSONObject("where");
  178. //
  179. // if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
  180. // where = where + " and (brandname like'%" + whereObject.getString("condition") + "%') ";
  181. // }
  182. // }
  183. String where = " 1=1 ";
  184. String where2 = " 1=1 ";
  185. if (content.containsKey("where")) {
  186. JSONObject whereObject = content.getJSONObject("where");
  187. if (whereObject.containsKey("istool") && !"".equals(whereObject.getString("istool"))) {
  188. where = where + " and (ifnull(t1.istool,0) ='" + whereObject.getString("istool") + "') ";
  189. where2=where2+ " and (ifnull(t2.istool,0) ='" + whereObject.getString("istool") + "') ";
  190. }
  191. if (whereObject.containsKey("ishide") && !"".equals(whereObject.getString("ishide"))) {
  192. where = where + " and (ifnull(t1.ishide,0) ='" + whereObject.getString("ishide") + "') ";
  193. where2=where2+ " and (ifnull(t2.ishide,0) ='" + whereObject.getString("ishide") + "') ";
  194. }
  195. }
  196. /*
  197. * SQL通告板块查询参数设置并查询
  198. */
  199. Rows rows = Enterprise.getBrands(this, sys_enterpriseid);
  200. if (!rows.isEmpty()) {
  201. for (Row row : rows) {
  202. /*
  203. * 查询所有分类
  204. */
  205. if (sys_enterpriseid > 0) {
  206. Row enterpriseRow = Enterprise.getEnterprise(this, sys_enterpriseid);
  207. if (!enterpriseRow.isEmpty()) {
  208. boolean saleclassauth = enterpriseRow.getBoolean("saleclassauth");
  209. if (saleclassauth) {
  210. where = where
  211. + " and t1.itemclassid in ( SELECT itemclassid from sys_enterprise_saleclass WHERE sys_enterpriseid = "
  212. + sys_enterpriseid + " and siteid='" + siteid + "')";
  213. }
  214. }
  215. }
  216. SQLFactory sqlFactory = new SQLFactory(this, "查询所有分类");
  217. sqlFactory.addParameter("siteid", siteid);
  218. sqlFactory.addParameter("sa_brandid", row.getString("sa_brandid"));
  219. sqlFactory.addParameter_SQL("where", where);
  220. sqlFactory.addParameter_SQL("where2", where2);
  221. String sql = sqlFactory.getSQL();
  222. Rows allrows = dbConnect.runSqlQuery(sql);
  223. /*
  224. * 获取所有一级分类
  225. */
  226. Rows toprows = allrows.toRowsMap("parentid").get("0");
  227. /*
  228. * 递归查询
  229. */
  230. for (Row row1 : toprows) {
  231. Rows rows1 = getSubItemclass(row1, allrows);
  232. Collections.sort(rows1, new SortByNum());
  233. row1.put("subdep", rows1);
  234. }
  235. row.put("ttemclass", toprows);
  236. }
  237. }
  238. if (sa_brandid > 0) {
  239. Rows rows2 = new Rows();
  240. if(!rows.isEmpty()) {
  241. for (Row row : rows) {
  242. if (row.getLong("sa_brandid") == sa_brandid) {
  243. rows2.add(row);
  244. }
  245. }
  246. }
  247. if (rows2.isNotEmpty()) {
  248. if (((Rows) rows2.get(0).get("ttemclass")).isNotEmpty()) {
  249. Collections.sort((Rows) rows2.get(0).get("ttemclass"), new SortByNum());
  250. }
  251. }
  252. return getSucReturnObject().setData(rows2).toString();
  253. }
  254. return getSucReturnObject().setData(rows).toString();
  255. }
  256. /**
  257. * 查询单据可添加营销类别
  258. *
  259. * @return
  260. */
  261. @API(title = "查询单据可添加营销类别", apiversion = R.ID20230818135003.v1.class)
  262. @CACHEING
  263. public String queryItemclassAccordingtoId() throws YosException {
  264. long sa_brandid = content.getLongValue("sa_brandid");
  265. // long istool = content.getLongValue("istool");
  266. String where = " 1=1 ";
  267. if (content.containsKey("where")) {
  268. JSONObject whereObject = content.getJSONObject("where");
  269. if (whereObject.containsKey("istool") && !"".equals(whereObject.getString("istool"))) {
  270. where = where + " and (ifnull(t1.istool,0) ='" + whereObject.getString("istool") + "') ";
  271. }
  272. }
  273. if (content.containsKey("sys_enterpriseid")) {
  274. if(content.getLong("sys_enterpriseid")>0){
  275. where = where + " and t1.itemclassid not in (SELECT itemclassid from sys_enterprise_saleclass WHERE sys_enterpriseid = " +
  276. content.getLong("sys_enterpriseid") + " and siteid='" + siteid + "' )";
  277. }
  278. }
  279. if (content.containsKey("sa_rebateschemeid")) {
  280. if(content.getLong("sa_rebateschemeid")>0){
  281. where = where + " and not exists (SELECT 1 from sa_rebatecategory WHERE sa_rebateschemeid = " +
  282. content.getLong("sa_rebateschemeid") + " and itemclassid=t1.itemclassid and siteid='" + siteid + "' )";
  283. }
  284. }
  285. /*
  286. * SQL通告板块查询参数设置并查询
  287. */
  288. Rows rows = Enterprise.getBrands(this, sys_enterpriseid);
  289. if (!rows.isEmpty()) {
  290. for (Row row : rows) {
  291. /*
  292. * 查询所有分类
  293. */
  294. SQLFactory sqlFactory = new SQLFactory(this, "查询所有分类");
  295. sqlFactory.addParameter("siteid", siteid);
  296. sqlFactory.addParameter("sa_brandid", row.getString("sa_brandid"));
  297. sqlFactory.addParameter_SQL("where", where);
  298. sqlFactory.addParameter_SQL("where2", " 1=1 ");
  299. String sql = sqlFactory.getSQL();
  300. Rows allrows = dbConnect.runSqlQuery(sql);
  301. /*
  302. * 获取所有一级分类
  303. */
  304. Rows toprows = allrows.toRowsMap("parentid").get("0");
  305. /*
  306. * 递归查询
  307. */
  308. for (Row row1 : toprows) {
  309. Rows rows1 = getSubItemclass(row1, allrows);
  310. Collections.sort(rows1, new SortByNum());
  311. row1.put("subdep", rows1);
  312. }
  313. row.put("ttemclass", toprows);
  314. }
  315. }
  316. if (sa_brandid > 0) {
  317. Rows rows2 = new Rows();
  318. if(!rows.isEmpty()) {
  319. for (Row row : rows) {
  320. if (row.getLong("sa_brandid") == sa_brandid) {
  321. rows2.add(row);
  322. }
  323. }
  324. }
  325. if (rows2.isNotEmpty()) {
  326. if (((Rows) rows2.get(0).get("ttemclass")).isNotEmpty()) {
  327. Collections.sort((Rows) rows2.get(0).get("ttemclass"), new SortByNum());
  328. }
  329. }
  330. return getSucReturnObject().setData(rows2).toString();
  331. }
  332. return getSucReturnObject().setData(rows).toString();
  333. }
  334. /**
  335. * 查询末级营销类别
  336. *
  337. * @return
  338. */
  339. @API(title = "查询", apiversion = R.ID20220927102603.v1.class)
  340. @CACHEING
  341. public String queryItemclassLaststage() throws YosException {
  342. // long sa_brandid = content.getLong("sa_brandid");
  343. /*
  344. * 过滤条件设置
  345. */
  346. String where = " 1=1 ";
  347. if (content.containsKey("where")) {
  348. JSONObject whereObject = content.getJSONObject("where");
  349. if (whereObject.containsKey("condition") && !"".equals(whereObject.getString("condition"))) {
  350. where = where + " and (t1.itemclassname like'%" + whereObject.getString("condition") + "%') ";
  351. }
  352. if (whereObject.containsKey("istool") && !"".equals(whereObject.getString("istool"))) {
  353. where = where + " and t1.istool=" + whereObject.getLongValue("istool");
  354. }
  355. }
  356. SQLFactory factory = new SQLFactory(this, "营销类别末级列表查询");
  357. factory.addParameter("siteid", siteid);
  358. factory.addParameter_SQL("where", where);
  359. Rows rows = dbConnect.runSqlQuery(factory.getSQL());
  360. return getSucReturnObject().setData(rows).toString();
  361. }
  362. @API(title = "删除", apiversion = R.ID20220922110503.v1.class)
  363. @CACHEING_CLEAN(cms = { @cm(clazz = itemclass.class, method = { "queryItemclass" }) })
  364. public String delete() throws YosException {
  365. Long itemclassid = content.getLong("itemclassid");
  366. Rows rowscount = dbConnect.runSqlQuery(
  367. "select isdeep,ifnull(parentid,0) parentid from plm_itemclass where itemclassid=" + itemclassid);
  368. if (rowscount.isEmpty()) {
  369. return getErrReturnObject().setErrMsg("此营销类别不存在,无法删除").toString();
  370. } else {
  371. if (!rowscount.get(0).getBoolean("isdeep")) {
  372. return getErrReturnObject().setErrMsg("此营销类别非末级,无法删除").toString();
  373. }
  374. }
  375. Rows row = dbConnect.runSqlQuery("select itemid from sa_itemsaleclass where itemclassid=" + itemclassid);
  376. if (!row.isEmpty()) {
  377. return getErrReturnObject().setErrMsg("此营销类别下存在商品,无法删除").toString();
  378. }
  379. ArrayList<String> sqllist = new ArrayList<>();
  380. sqllist.add("update plm_itemclass set isdeep=1 where itemclassid=" + rowscount.get(0).getLong("parentid"));
  381. String deletesql = "DELETE FROM plm_itemclass WHERE itemclassid = '" + itemclassid + "'";
  382. sqllist.add(deletesql);
  383. dbConnect.runSqlUpdate(sqllist);
  384. return getSucReturnObject().toString();
  385. }
  386. /**
  387. * 递归查询下级产品类别
  388. *
  389. * @param root
  390. * @param allItemclasss
  391. * @return
  392. */
  393. private Rows getSubItemclass(Row root, Rows allItemclasss) {
  394. Rows childrenRows = allItemclasss.toRowsMap("parentid").get(root.getString("itemclassid"));
  395. for (Row row : childrenRows) {
  396. row.put("subdep", getSubItemclass(row, allItemclasss));
  397. }
  398. return childrenRows;
  399. }
  400. private ArrayList<String> getItemclasslevel(int level, long parentid, long itemclassid, ArrayList<String> sqllist)
  401. throws YosException {
  402. if (parentid > 0) {
  403. Rows rows = dbConnect.runSqlQuery(
  404. "select ifnull(parentid,0) as parentid from plm_itemclass where classtype='营销' and itemclassid= '"
  405. + parentid + "'");
  406. if (!rows.isEmpty()) {
  407. level++;
  408. sqllist.add("update plm_itemclass set level='" + level + "' where itemclassid= '" + parentid + "'");
  409. getItemclasslevel(level, rows.get(0).getLong("parentid"), rows.get(0).getLong("itemclassid"), sqllist);
  410. }
  411. }
  412. return sqllist;
  413. }
  414. private String getUppeItemclassfullnum(String fullname, long parentid, long itemclassid) throws YosException {
  415. String fullnum = "";
  416. if (parentid > 0) {
  417. Rows rows = dbConnect.runSqlQuery(
  418. "select ifnull(parentid,0) as parentid,itemclassfullnum from plm_itemclass where classtype='营销' and itemclassid= '"
  419. + parentid + "'");
  420. if (!rows.isEmpty()) {
  421. fullnum = rows.get(0).getString("itemclassfullnum") + "/" + fullname;
  422. }
  423. } else {
  424. fullnum = fullname;
  425. }
  426. return fullnum;
  427. }
  428. private String getUppeItemclassfullname(String fullname, long parentid, long itemclassid) throws YosException {
  429. String fullnum = "";
  430. if (parentid > 0) {
  431. Rows rows = dbConnect.runSqlQuery(
  432. "select ifnull(parentid,0) as parentid,itemclassfullname from plm_itemclass where classtype='营销' and itemclassid= '"
  433. + parentid + "'");
  434. if (!rows.isEmpty()) {
  435. fullnum = rows.get(0).getString("itemclassfullname") + "/" + fullname;
  436. }
  437. } else {
  438. fullnum = fullname;
  439. }
  440. return fullnum;
  441. }
  442. /**
  443. * 根据指定的营销类别id获取下级营销类别id及营销路径名
  444. *
  445. * @param controller
  446. * @param itemclassid
  447. * @throws YosException
  448. */
  449. public static Rows getSubItemclass(Controller controller, long itemclassid) throws YosException {
  450. SQLFactory sqlFactory = new SQLFactory(controller, "下级营销类别获取");
  451. sqlFactory.addParameter("siteid", controller.siteid);
  452. sqlFactory.addParameter("itemclassid", itemclassid);
  453. Rows rows = controller.dbConnect.runSqlQuery(sqlFactory.getSQL());
  454. return rows;
  455. }
  456. private ArrayList<String> getLowerItemclassUpdateSql(long itemclassid, String itemclassnameOld,
  457. String itemclassnameNew) throws YosException {
  458. ArrayList<String> sqlList = new ArrayList<String>();
  459. Rows rows = getSubItemclass(this, itemclassid);
  460. if (!rows.isEmpty()) {
  461. for (Row row : rows) {
  462. if (row.getString("itemclassfullname").contains(itemclassnameOld)) {
  463. String itemclassfullname = row.getString("itemclassfullname").replace(itemclassnameOld,
  464. itemclassnameNew);
  465. String sql = "update plm_itemclass set itemclassfullname='" + itemclassfullname
  466. + "' where itemclassid=" + row.getLong("itemclassid");
  467. sqlList.add(sql);
  468. }
  469. }
  470. }
  471. return sqlList;
  472. }
  473. }