您好,登錄后才能下訂單哦!
這篇文章將為大家詳細(xì)講解有關(guān)Java如何實現(xiàn)女裝商城系統(tǒng),小編覺得挺實用的,因此分享給大家做個參考,希望大家閱讀完這篇文章后可以有所收獲。
javaweb 網(wǎng)上商城系統(tǒng),前臺+后臺管理,用戶注冊,登錄,上哦展示,分組展示,搜索,收貨地址管理,購物車管理,添加,購買,個人信息修改。訂單查詢等等,后臺商品管理,分類管理,庫存管理,訂單管理,用戶管理,信息修改等等.
環(huán)境配置: Jdk1.8 + Tomcats . 5 + mysql + Eclispe ( IntelliJ IDEA ,Eclispe , MyEclispe , sts 都支持)
項目技術(shù): JSP + Spring + SpringMVC + MyBatis + html + cSS + Javascript + JQuery + Ajax + layui + maven 等等。
/** * 后臺管理-主頁 */ @Controller public class AdminHomeController extends BaseController { @Resource(name = "adminService") private AdminService adminService; @Resource(name = "productOrderService") private ProductOrderService productOrderService; @Resource(name = "productService") private ProductService productService; @Resource(name = "userService") private UserService userService; /** * 轉(zhuǎn)到后臺管理-主頁 * @param session session對象 * @param map 前臺傳入的Map * @return 響應(yīng)數(shù)據(jù) * @throws ParseException 轉(zhuǎn)換異常 */ @RequestMapping(value = "admin", method = RequestMethod.GET) public String goToPage(HttpSession session, Map<String, Object> map) throws ParseException { logger.info("獲取管理員信息"); Object adminId = checkAdmin(session); if (adminId == null) { return "redirect:/admin/login"; } Admin admin = adminService.get(null, Integer.parseInt(adminId.toString())); map.put("admin", admin); logger.info("獲取統(tǒng)計信息"); //產(chǎn)品總數(shù) Integer productTotal = productService.getTotal(null, new Byte[]{0, 2}); //用戶總數(shù) Integer userTotal = userService.getTotal(null); //訂單總數(shù) Integer orderTotal = productOrderService.getTotal(null, new Byte[]{3}); logger.info("獲取圖表信息"); map.put("jsonObject", getChartData(null,null,7)); map.put("productTotal", productTotal); map.put("userTotal", userTotal); map.put("orderTotal", orderTotal); logger.info("轉(zhuǎn)到后臺管理-主頁"); return "admin/homePage"; } /** * 轉(zhuǎn)到后臺管理-主頁(ajax方式) * @param session session對象 * @param map 前臺傳入的Map * @return 響應(yīng)數(shù)據(jù) * @throws ParseException 轉(zhuǎn)換異常 */ @RequestMapping(value = "admin/home", method = RequestMethod.GET) public String goToPageByAjax(HttpSession session, Map<String, Object> map) throws ParseException { logger.info("獲取管理員信息"); Object adminId = checkAdmin(session); if (adminId == null) { return "admin/include/loginMessage"; } Admin admin = adminService.get(null, Integer.parseInt(adminId.toString())); map.put("admin", admin); logger.info("獲取統(tǒng)計信息"); Integer productTotal = productService.getTotal(null, new Byte[]{0, 2}); Integer userTotal = userService.getTotal(null); Integer orderTotal = productOrderService.getTotal(null, new Byte[]{3}); logger.info("獲取圖表信息"); map.put("jsonObject", getChartData(null, null,7)); logger.info("獲取圖表信息"); map.put("jsonObject", getChartData(null,null,7)); map.put("productTotal", productTotal); map.put("userTotal", userTotal); map.put("orderTotal", orderTotal); logger.info("轉(zhuǎn)到后臺管理-主頁-ajax方式"); return "admin/homeManagePage"; } /** * 按日期查詢圖表數(shù)據(jù)(ajax方式) * @param beginDate 開始日期 * @param endDate 結(jié)束日期 * @return 響應(yīng)數(shù)據(jù) * @throws ParseException 轉(zhuǎn)換異常 */ @ResponseBody @RequestMapping(value = "admin/home/charts", method = RequestMethod.GET, produces = "application/json;charset=utf-8") public String getChartDataByDate(@RequestParam(required = false) String beginDate, @RequestParam(required = false) String endDate) throws ParseException { if (beginDate != null && endDate != null) { //轉(zhuǎn)換日期格式 SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd"); return getChartData(simpleDateFormat.parse(beginDate), simpleDateFormat.parse(endDate),7).toJSONString(); } else { return getChartData(null, null,7).toJSONString(); } } /** * 按日期獲取圖表數(shù)據(jù) * @param beginDate 開始日期 * @param endDate 結(jié)束日期 * @param days 天數(shù) * @return 圖表數(shù)據(jù)的JSON對象 * @throws ParseException 轉(zhuǎn)換異常 */ private JSONObject getChartData(Date beginDate,Date endDate,int days) throws ParseException { JSONObject jsonObject = new JSONObject(); SimpleDateFormat time = new SimpleDateFormat("yyyy-MM-dd", Locale.UK); SimpleDateFormat time2 = new SimpleDateFormat("MM/dd", Locale.UK); SimpleDateFormat timeSpecial = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss", Locale.UK); //如果沒有指定開始和結(jié)束日期 if (beginDate == null || endDate == null) { //指定一周前的日期為開始日期 Calendar cal = Calendar.getInstance(); cal.add(Calendar.DATE, 1-days); beginDate = time.parse(time.format(cal.getTime())); //指定當(dāng)前日期為結(jié)束日期 cal = Calendar.getInstance(); endDate = cal.getTime(); } else { beginDate = time.parse(time.format(beginDate)); endDate = timeSpecial.parse(time.format(endDate) + " 23:59:59"); } logger.info("根據(jù)訂單狀態(tài)分類"); //未付款訂單數(shù)統(tǒng)計數(shù)組 int[] orderUnpaidArray = new int[7]; //未發(fā)貨訂單數(shù)統(tǒng)計叔祖 int[] orderNotShippedArray = new int[7]; //未確認(rèn)訂單數(shù)統(tǒng)計數(shù)組 int[] orderUnconfirmedArray = new int[7]; //交易成功訂單數(shù)統(tǒng)計數(shù)組 int[] orderSuccessArray = new int[7]; //總交易訂單數(shù)統(tǒng)計數(shù)組 int[] orderTotalArray = new int[7]; logger.info("從數(shù)據(jù)庫中獲取統(tǒng)計的訂單集合數(shù)據(jù)"); List<OrderGroup> orderGroupList = productOrderService.getTotalByDate(beginDate, endDate); //初始化日期數(shù)組 JSONArray dateStr = new JSONArray(days); //按指定的天數(shù)進行循環(huán) for (int i = 0; i < days; i++) { //格式化日期串(MM/dd)并放入日期數(shù)組中 Calendar cal = Calendar.getInstance(); cal.setTime(beginDate); cal.add(Calendar.DATE, i); String formatDate = time2.format(cal.getTime()); dateStr.add(formatDate); //該天的訂單總數(shù) int orderCount = 0; //循環(huán)訂單集合數(shù)據(jù)的結(jié)果集 for(int j = 0; j < orderGroupList.size(); j++){ OrderGroup orderGroup = orderGroupList.get(j); //如果該訂單日期與當(dāng)前日期一致 if(orderGroup.getProductOrder_pay_date().equals(formatDate)){ //從結(jié)果集中移除數(shù)據(jù) orderGroupList.remove(j); //根據(jù)訂單狀態(tài)將統(tǒng)計結(jié)果存入對應(yīng)的訂單狀態(tài)數(shù)組中 switch (orderGroup.getProductOrder_status()) { case 0: //未付款訂單 orderUnpaidArray[i] = orderGroup.getProductOrder_count(); break; case 1: //未發(fā)貨訂單 orderNotShippedArray[i] = orderGroup.getProductOrder_count(); break; case 2: //未確認(rèn)訂單 orderUnconfirmedArray[i] = orderGroup.getProductOrder_count(); break; case 3: //交易成功訂單 orderSuccessArray[i] = orderGroup.getProductOrder_count(); break; } //累加當(dāng)前日期的訂單總數(shù) orderCount += orderGroup.getProductOrder_count(); } } //將統(tǒng)計的訂單總數(shù)存入總交易訂單數(shù)統(tǒng)計數(shù)組 orderTotalArray[i] = orderCount; } logger.info("返回結(jié)果集map"); jsonObject.put("orderTotalArray", orderTotalArray); jsonObject.put("orderUnpaidArray", orderUnpaidArray); jsonObject.put("orderNotShippedArray", orderNotShippedArray); jsonObject.put("orderUnconfirmedArray", orderUnconfirmedArray); jsonObject.put("orderSuccessArray", orderSuccessArray); jsonObject.put("dateStr",dateStr); return jsonObject; } }
/** * @author yy */ @Controller @RequestMapping("/admin") public class NewBeeMallGoodsController { @Resource private NewBeeMallGoodsService newBeeMallGoodsService; @Resource private NewBeeMallCategoryService newBeeMallCategoryService; @GetMapping("/goods") public String goodsPage(HttpServletRequest request) { request.setAttribute("path", "newbee_mall_goods"); return "admin/newbee_mall_goods"; } @GetMapping("/goods/edit") public String edit(HttpServletRequest request) { request.setAttribute("path", "edit"); //查詢所有的一級分類 List<GoodsCategory> firstLevelCategories = newBeeMallCategoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(0L), NewBeeMallCategoryLevelEnum.LEVEL_ONE.getLevel()); if (!CollectionUtils.isEmpty(firstLevelCategories)) { //查詢一級分類列表中第一個實體的所有二級分類 List<GoodsCategory> secondLevelCategories = newBeeMallCategoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(firstLevelCategories.get(0).getCategoryId()), NewBeeMallCategoryLevelEnum.LEVEL_TWO.getLevel()); if (!CollectionUtils.isEmpty(secondLevelCategories)) { //查詢二級分類列表中第一個實體的所有三級分類 List<GoodsCategory> thirdLevelCategories = newBeeMallCategoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(secondLevelCategories.get(0).getCategoryId()), NewBeeMallCategoryLevelEnum.LEVEL_THREE.getLevel()); request.setAttribute("firstLevelCategories", firstLevelCategories); request.setAttribute("secondLevelCategories", secondLevelCategories); request.setAttribute("thirdLevelCategories", thirdLevelCategories); request.setAttribute("path", "goods-edit"); return "admin/newbee_mall_goods_edit"; } } return "error/error_5xx"; } @GetMapping("/goods/edit/{goodsId}") public String edit(HttpServletRequest request, @PathVariable("goodsId") Long goodsId) { request.setAttribute("path", "edit"); NewBeeMallGoods newBeeMallGoods = newBeeMallGoodsService.getNewBeeMallGoodsById(goodsId); if (newBeeMallGoods == null) { return "error/error_400"; } if (newBeeMallGoods.getGoodsCategoryId() > 0) { if (newBeeMallGoods.getGoodsCategoryId() != null || newBeeMallGoods.getGoodsCategoryId() > 0) { //有分類字段則查詢相關(guān)分類數(shù)據(jù)返回給前端以供分類的三級聯(lián)動顯示 GoodsCategory currentGoodsCategory = newBeeMallCategoryService.getGoodsCategoryById(newBeeMallGoods.getGoodsCategoryId()); //商品表中存儲的分類id字段為三級分類的id,不為三級分類則是錯誤數(shù)據(jù) if (currentGoodsCategory != null && currentGoodsCategory.getCategoryLevel() == NewBeeMallCategoryLevelEnum.LEVEL_THREE.getLevel()) { //查詢所有的一級分類 List<GoodsCategory> firstLevelCategories = newBeeMallCategoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(0L), NewBeeMallCategoryLevelEnum.LEVEL_ONE.getLevel()); //根據(jù)parentId查詢當(dāng)前parentId下所有的三級分類 List<GoodsCategory> thirdLevelCategories = newBeeMallCategoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(currentGoodsCategory.getParentId()), NewBeeMallCategoryLevelEnum.LEVEL_THREE.getLevel()); //查詢當(dāng)前三級分類的父級二級分類 GoodsCategory secondCategory = newBeeMallCategoryService.getGoodsCategoryById(currentGoodsCategory.getParentId()); if (secondCategory != null) { //根據(jù)parentId查詢當(dāng)前parentId下所有的二級分類 List<GoodsCategory> secondLevelCategories = newBeeMallCategoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(secondCategory.getParentId()), NewBeeMallCategoryLevelEnum.LEVEL_TWO.getLevel()); //查詢當(dāng)前二級分類的父級一級分類 GoodsCategory firestCategory = newBeeMallCategoryService.getGoodsCategoryById(secondCategory.getParentId()); if (firestCategory != null) { //所有分類數(shù)據(jù)都得到之后放到request對象中供前端讀取 request.setAttribute("firstLevelCategories", firstLevelCategories); request.setAttribute("secondLevelCategories", secondLevelCategories); request.setAttribute("thirdLevelCategories", thirdLevelCategories); request.setAttribute("firstLevelCategoryId", firestCategory.getCategoryId()); request.setAttribute("secondLevelCategoryId", secondCategory.getCategoryId()); request.setAttribute("thirdLevelCategoryId", currentGoodsCategory.getCategoryId()); } } } } } if (newBeeMallGoods.getGoodsCategoryId() == 0) { //查詢所有的一級分類 List<GoodsCategory> firstLevelCategories = newBeeMallCategoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(0L), NewBeeMallCategoryLevelEnum.LEVEL_ONE.getLevel()); if (!CollectionUtils.isEmpty(firstLevelCategories)) { //查詢一級分類列表中第一個實體的所有二級分類 List<GoodsCategory> secondLevelCategories = newBeeMallCategoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(firstLevelCategories.get(0).getCategoryId()), NewBeeMallCategoryLevelEnum.LEVEL_TWO.getLevel()); if (!CollectionUtils.isEmpty(secondLevelCategories)) { //查詢二級分類列表中第一個實體的所有三級分類 List<GoodsCategory> thirdLevelCategories = newBeeMallCategoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(secondLevelCategories.get(0).getCategoryId()), NewBeeMallCategoryLevelEnum.LEVEL_THREE.getLevel()); request.setAttribute("firstLevelCategories", firstLevelCategories); request.setAttribute("secondLevelCategories", secondLevelCategories); request.setAttribute("thirdLevelCategories", thirdLevelCategories); } } } request.setAttribute("goods", newBeeMallGoods); request.setAttribute("path", "goods-edit"); return "admin/newbee_mall_goods_edit"; } /** * 列表 */ @RequestMapping(value = "/goods/list", method = RequestMethod.GET) @ResponseBody public Result list(@RequestParam Map<String, Object> params) { if (StringUtils.isEmpty(params.get("page")) || StringUtils.isEmpty(params.get("limit"))) { return ResultGenerator.genFailResult("參數(shù)異常!"); } PageQueryUtil pageUtil = new PageQueryUtil(params); return ResultGenerator.genSuccessResult(newBeeMallGoodsService.getNewBeeMallGoodsPage(pageUtil)); } /** * 添加 */ @RequestMapping(value = "/goods/save", method = RequestMethod.POST) @ResponseBody public Result save(@RequestBody NewBeeMallGoods newBeeMallGoods) { if (StringUtils.isEmpty(newBeeMallGoods.getGoodsName()) || StringUtils.isEmpty(newBeeMallGoods.getGoodsIntro()) || StringUtils.isEmpty(newBeeMallGoods.getTag()) || Objects.isNull(newBeeMallGoods.getOriginalPrice()) || Objects.isNull(newBeeMallGoods.getGoodsCategoryId()) || Objects.isNull(newBeeMallGoods.getSellingPrice()) || Objects.isNull(newBeeMallGoods.getStockNum()) || Objects.isNull(newBeeMallGoods.getGoodsSellStatus()) || StringUtils.isEmpty(newBeeMallGoods.getGoodsCoverImg()) || StringUtils.isEmpty(newBeeMallGoods.getGoodsDetailContent())) { return ResultGenerator.genFailResult("參數(shù)異常!"); } String result = newBeeMallGoodsService.saveNewBeeMallGoods(newBeeMallGoods); if (ServiceResultEnum.SUCCESS.getResult().equals(result)) { return ResultGenerator.genSuccessResult(); } else { return ResultGenerator.genFailResult(result); } } /** * 修改 */ @RequestMapping(value = "/goods/update", method = RequestMethod.POST) @ResponseBody public Result update(@RequestBody NewBeeMallGoods newBeeMallGoods) { if (Objects.isNull(newBeeMallGoods.getGoodsId()) || StringUtils.isEmpty(newBeeMallGoods.getGoodsName()) || StringUtils.isEmpty(newBeeMallGoods.getGoodsIntro()) || StringUtils.isEmpty(newBeeMallGoods.getTag()) || Objects.isNull(newBeeMallGoods.getOriginalPrice()) || Objects.isNull(newBeeMallGoods.getSellingPrice()) || Objects.isNull(newBeeMallGoods.getGoodsCategoryId()) || Objects.isNull(newBeeMallGoods.getStockNum()) || Objects.isNull(newBeeMallGoods.getGoodsSellStatus()) || StringUtils.isEmpty(newBeeMallGoods.getGoodsCoverImg()) || StringUtils.isEmpty(newBeeMallGoods.getGoodsDetailContent())) { return ResultGenerator.genFailResult("參數(shù)異常!"); } String result = newBeeMallGoodsService.updateNewBeeMallGoods(newBeeMallGoods); if (ServiceResultEnum.SUCCESS.getResult().equals(result)) { return ResultGenerator.genSuccessResult(); } else { return ResultGenerator.genFailResult(result); } } /** * 詳情 */ @GetMapping("/goods/info/{id}") @ResponseBody public Result info(@PathVariable("id") Long id) { NewBeeMallGoods goods = newBeeMallGoodsService.getNewBeeMallGoodsById(id); if (goods == null) { return ResultGenerator.genFailResult(ServiceResultEnum.DATA_NOT_EXIST.getResult()); } return ResultGenerator.genSuccessResult(goods); } /** * 批量修改銷售狀態(tài) */ @RequestMapping(value = "/goods/status/{sellStatus}", method = RequestMethod.PUT) @ResponseBody public Result delete(@RequestBody Long[] ids, @PathVariable("sellStatus") int sellStatus) { if (ids.length < 1) { return ResultGenerator.genFailResult("參數(shù)異常!"); } if (sellStatus != Constants.SELL_STATUS_UP && sellStatus != Constants.SELL_STATUS_DOWN) { return ResultGenerator.genFailResult("狀態(tài)異常!"); } if (newBeeMallGoodsService.batchUpdateSellStatus(ids, sellStatus)) { return ResultGenerator.genSuccessResult(); } else { return ResultGenerator.genFailResult("修改失敗"); } } }
/** * @author yy */ @Controller @RequestMapping("/admin") public class NewBeeMallGoodsCategoryController { @Resource private NewBeeMallCategoryService newBeeMallCategoryService; @GetMapping("/categories") public String categoriesPage(HttpServletRequest request, @RequestParam("categoryLevel") Byte categoryLevel, @RequestParam("parentId") Long parentId, @RequestParam("backParentId") Long backParentId) { if (categoryLevel == null || categoryLevel < 1 || categoryLevel > 3) { return "error/error_5xx"; } request.setAttribute("path", "newbee_mall_category"); request.setAttribute("parentId", parentId); request.setAttribute("backParentId", backParentId); request.setAttribute("categoryLevel", categoryLevel); return "admin/newbee_mall_category"; } /** * 列表 */ @RequestMapping(value = "/categories/list", method = RequestMethod.GET) @ResponseBody public Result list(@RequestParam Map<String, Object> params) { if (StringUtils.isEmpty(params.get("page")) || StringUtils.isEmpty(params.get("limit"))) { return ResultGenerator.genFailResult("參數(shù)異常!"); } PageQueryUtil pageUtil = new PageQueryUtil(params); return ResultGenerator.genSuccessResult(newBeeMallCategoryService.getCategorisPage(pageUtil)); } /** * 列表 */ @RequestMapping(value = "/categories/listForSelect", method = RequestMethod.GET) @ResponseBody public Result listForSelect(@RequestParam("categoryId") Long categoryId) { if (categoryId == null || categoryId < 1) { return ResultGenerator.genFailResult("缺少參數(shù)!"); } GoodsCategory category = newBeeMallCategoryService.getGoodsCategoryById(categoryId); //既不是一級分類也不是二級分類則為不返回數(shù)據(jù) if (category == null || category.getCategoryLevel() == NewBeeMallCategoryLevelEnum.LEVEL_THREE.getLevel()) { return ResultGenerator.genFailResult("參數(shù)異常!"); } Map categoryResult = new HashMap(2); if (category.getCategoryLevel() == NewBeeMallCategoryLevelEnum.LEVEL_ONE.getLevel()) { //如果是一級分類則返回當(dāng)前一級分類下的所有二級分類,以及二級分類列表中第一條數(shù)據(jù)下的所有三級分類列表 //查詢一級分類列表中第一個實體的所有二級分類 List<GoodsCategory> secondLevelCategories = newBeeMallCategoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(categoryId), NewBeeMallCategoryLevelEnum.LEVEL_TWO.getLevel()); if (!CollectionUtils.isEmpty(secondLevelCategories)) { //查詢二級分類列表中第一個實體的所有三級分類 List<GoodsCategory> thirdLevelCategories = newBeeMallCategoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(secondLevelCategories.get(0).getCategoryId()), NewBeeMallCategoryLevelEnum.LEVEL_THREE.getLevel()); categoryResult.put("secondLevelCategories", secondLevelCategories); categoryResult.put("thirdLevelCategories", thirdLevelCategories); } } if (category.getCategoryLevel() == NewBeeMallCategoryLevelEnum.LEVEL_TWO.getLevel()) { //如果是二級分類則返回當(dāng)前分類下的所有三級分類列表 List<GoodsCategory> thirdLevelCategories = newBeeMallCategoryService.selectByLevelAndParentIdsAndNumber(Collections.singletonList(categoryId), NewBeeMallCategoryLevelEnum.LEVEL_THREE.getLevel()); categoryResult.put("thirdLevelCategories", thirdLevelCategories); } return ResultGenerator.genSuccessResult(categoryResult); } /** * 添加 */ @RequestMapping(value = "/categories/save", method = RequestMethod.POST) @ResponseBody public Result save(@RequestBody GoodsCategory goodsCategory) { if (Objects.isNull(goodsCategory.getCategoryLevel()) || StringUtils.isEmpty(goodsCategory.getCategoryName()) || Objects.isNull(goodsCategory.getParentId()) || Objects.isNull(goodsCategory.getCategoryRank())) { return ResultGenerator.genFailResult("參數(shù)異常!"); } String result = newBeeMallCategoryService.saveCategory(goodsCategory); if (ServiceResultEnum.SUCCESS.getResult().equals(result)) { return ResultGenerator.genSuccessResult(); } else { return ResultGenerator.genFailResult(result); } } /** * 修改 */ @RequestMapping(value = "/categories/update", method = RequestMethod.POST) @ResponseBody public Result update(@RequestBody GoodsCategory goodsCategory) { if (Objects.isNull(goodsCategory.getCategoryId()) || Objects.isNull(goodsCategory.getCategoryLevel()) || StringUtils.isEmpty(goodsCategory.getCategoryName()) || Objects.isNull(goodsCategory.getParentId()) || Objects.isNull(goodsCategory.getCategoryRank())) { return ResultGenerator.genFailResult("參數(shù)異常!"); } String result = newBeeMallCategoryService.updateGoodsCategory(goodsCategory); if (ServiceResultEnum.SUCCESS.getResult().equals(result)) { return ResultGenerator.genSuccessResult(); } else { return ResultGenerator.genFailResult(result); } } /** * 詳情 */ @GetMapping("/categories/info/{id}") @ResponseBody public Result info(@PathVariable("id") Long id) { GoodsCategory goodsCategory = newBeeMallCategoryService.getGoodsCategoryById(id); if (goodsCategory == null) { return ResultGenerator.genFailResult("未查詢到數(shù)據(jù)"); } return ResultGenerator.genSuccessResult(goodsCategory); } /** * 分類刪除 */ @RequestMapping(value = "/categories/delete", method = RequestMethod.POST) @ResponseBody public Result delete(@RequestBody Integer[] ids) { if (ids.length < 1) { return ResultGenerator.genFailResult("參數(shù)異常!"); } if (newBeeMallCategoryService.deleteBatch(ids)) { return ResultGenerator.genSuccessResult(); } else { return ResultGenerator.genFailResult("刪除失敗"); } } }
關(guān)于“Java如何實現(xiàn)女裝商城系統(tǒng)”這篇文章就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,使各位可以學(xué)到更多知識,如果覺得文章不錯,請把它分享出去讓更多的人看到。
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。