From 36bf3a03a51fcb2569951e31e921f6483a6be875 Mon Sep 17 00:00:00 2001 From: Bobi <2166145077@qq.com> Date: Fri, 25 Jul 2025 15:47:22 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9C=B0=E5=9D=80=E5=92=8C=E8=B4=AD=E7=89=A9?= =?UTF-8?q?=E8=BD=A6=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/AppletApiAddressController.java | 166 +++++++++++++++ .../applet/controller/AppletApiCarController.java | 118 +++++++++++ .../appletCar/controller/AppletCarController.java | 181 ++++++++++++++++ .../modules/demo/appletCar/entity/AppletCar.java | 71 +++++++ .../demo/appletCar/mapper/AppletCarMapper.java | 17 ++ .../demo/appletCar/mapper/xml/AppletCarMapper.xml | 5 + .../demo/appletCar/service/IAppletCarService.java | 14 ++ .../service/impl/AppletCarServiceImpl.java | 19 ++ .../demo/appletCar/uniapp/AppletCarForm.vue | 95 +++++++++ .../demo/appletCar/uniapp/AppletCarList.vue | 44 ++++ .../demo/appletCar/uniapp3/AppletCarData.ts | 19 ++ .../demo/appletCar/uniapp3/AppletCarForm.vue | 235 +++++++++++++++++++++ .../demo/appletCar/uniapp3/AppletCarList.vue | 148 +++++++++++++ .../modules/demo/appletCar/vue3/AppletCar.api.ts | 64 ++++++ .../modules/demo/appletCar/vue3/AppletCar.data.ts | 67 ++++++ .../modules/demo/appletCar/vue3/AppletCarList.vue | 206 ++++++++++++++++++ .../vue3/V20250724_1__menu_insert_AppletCar.sql | 26 +++ .../appletCar/vue3/components/AppletCarForm.vue | 70 ++++++ .../appletCar/vue3/components/AppletCarModal.vue | 99 +++++++++ 19 files changed, 1664 insertions(+) create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiAddressController.java create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiCarController.java create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/controller/AppletCarController.java create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/entity/AppletCar.java create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/mapper/AppletCarMapper.java create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/mapper/xml/AppletCarMapper.xml create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/service/IAppletCarService.java create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/service/impl/AppletCarServiceImpl.java create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp/AppletCarForm.vue create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp/AppletCarList.vue create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp3/AppletCarData.ts create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp3/AppletCarForm.vue create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp3/AppletCarList.vue create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/AppletCar.api.ts create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/AppletCar.data.ts create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/AppletCarList.vue create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/V20250724_1__menu_insert_AppletCar.sql create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/components/AppletCarForm.vue create mode 100644 jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/components/AppletCarModal.vue diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiAddressController.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiAddressController.java new file mode 100644 index 0000000..10d6bc3 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiAddressController.java @@ -0,0 +1,166 @@ +package org.jeecg.modules.applet.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.slf4j.Slf4j; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.config.shiro.IgnoreAuth; +import org.jeecg.modules.applet.service.AppletApiAddressService; +import org.jeecg.modules.demo.appletShippingAddress.entity.AppletShippingAddress; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; + +/** +* @Description: 小程序收货地址 +* @Author: jeecg-boot +* @Date: 2025-07-22 +* @Version: V1.0 +*/ +@Tag(name="小程序收货地址") +@RestController +@RequestMapping("/appletApi/addressd") +@Slf4j +public class AppletApiAddressController { + + @Autowired + private AppletApiAddressService appletAddressService; + + /** + * 地址列表查询 + * + * @param appletShippingAddress + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "小程序收货地址-分页列表查询") +// @AutoLog(value = "地址管理") + @Operation(summary="小程序收货地址-地址列表查询") + @GetMapping(value = "/list") + @IgnoreAuth + public Result> queryPageList(AppletShippingAddress appletShippingAddress, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + Page page = new Page(pageNo, pageSize); + IPage pageList = appletAddressService.page(page, appletShippingAddress); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param appletShippingAddress + * @return + */ + @Operation(summary="小程序收货地址-添加地址") + @PostMapping(value = "/add") + @IgnoreAuth + public Result add(AppletShippingAddress appletShippingAddress) { // 去掉@RequestBody + appletAddressService.save(appletShippingAddress); + return Result.OK("添加成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "小程序收货地址-通过id查询") + @Operation(summary="小程序收货地址-通过id查询") + @GetMapping(value = "/getById") + @IgnoreAuth + public Result queryById(@RequestParam(name="id",required=true) String id) { + AppletShippingAddress appletShippingAddress = appletAddressService.getById(id); + if(appletShippingAddress==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appletShippingAddress); + } + + /** + * 编辑 + * + * @param appletShippingAddress + * @return + */ + @Operation(summary="小程序收货地址-修改地址") + @PutMapping(value = "/update") + @IgnoreAuth + public Result edit(AppletShippingAddress appletShippingAddress) { + appletAddressService.updateById(appletShippingAddress); + return Result.OK("编辑成功!"); + } + + + + + +// /** +// * 通过id删除 +// * +// * @param id +// * @return +// */ +// @Operation(summary="小程序收货地址-通过id删除") +// @DeleteMapping(value = "/delete") +// public Result delete(@RequestParam(name="id",required=true) String id) { +// appletAddressService.removeById(id); +// return Result.OK("删除成功!"); +// } + + + + +// /** +// * 批量删除 +// * +// * @param ids +// * @return +// */ +// @AutoLog(value = "小程序收货地址-批量删除") +// @Operation(summary="小程序收货地址-批量删除") +// @RequiresPermissions("appletShippingAddress:applet_shipping_address:deleteBatch") +// @DeleteMapping(value = "/deleteBatch") +// public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { +// this.appletAddressService.removeByIds(Arrays.asList(ids.split(","))); +// return Result.OK("批量删除成功!"); +// } + + + +// /** +// * 导出excel +// * +// * @param request +// * @param appletShippingAddress +// */ +// @RequiresPermissions("appletShippingAddress:applet_shipping_address:exportXls") +// @RequestMapping(value = "/exportXls") +// public ModelAndView exportXls(HttpServletRequest request, AppletShippingAddress appletShippingAddress) { +// return super.exportXls(request, appletShippingAddress, AppletShippingAddress.class, "小程序收货地址"); +// } +// +// /** +// * 通过excel导入数据 +// * +// * @param request +// * @param response +// * @return +// */ +// @RequiresPermissions("appletShippingAddress:applet_shipping_address:importExcel") +// @RequestMapping(value = "/importExcel", method = RequestMethod.POST) +// public Result importExcel(HttpServletRequest request, HttpServletResponse response) { +// return super.importExcel(request, response, AppletShippingAddress.class); +// } + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiCarController.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiCarController.java new file mode 100644 index 0000000..d4ef222 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/applet/controller/AppletApiCarController.java @@ -0,0 +1,118 @@ +package org.jeecg.modules.applet.controller; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import io.swagger.v3.oas.annotations.Operation; +import io.swagger.v3.oas.annotations.tags.Tag; +import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.jeecg.common.system.base.controller.JeecgController; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.config.shiro.IgnoreAuth; +import org.jeecg.modules.applet.service.AppletApiCarService; +import org.jeecg.modules.demo.appletCar.entity.AppletCar; + +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletRequest; +;import java.util.Arrays; + +/** + * @Description: 购物车 + * @Author: jeecg-boot + * @Date: 2025-07-24 + * @Version: V1.0 + */ +@Tag(name = "小程序购物车") +@RestController +@RequestMapping("/appletApi/cart")//必须appletApi开头,购物车用cart单词吧 +@Slf4j +public class AppletApiCarController { + @Autowired + private AppletApiCarService appletApiCarService; + + /** + * 分页列表查询 + * + * @param appletCar + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "购物车-分页列表查询") + @Operation(summary = "购物车-列表查询") + @GetMapping(value = "/list") + @IgnoreAuth + public Result> queryPageList(AppletCar appletCar, + @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo, + @RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, + HttpServletRequest req) { +// QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appletCar, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = appletApiCarService.page(page, appletCar); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param appletCar + * @return + */ + + @Operation(summary = "购物车-添加") + @PostMapping(value = "/add") + public Result add(AppletCar appletCar) { + appletApiCarService.save(appletCar); + return Result.OK("添加成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "购物车-通过id查询") + @Operation(summary = "购物车-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name = "id", required = true) String id) { + AppletCar appletCar = appletApiCarService.getById(id); + if (appletCar == null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appletCar); + } + + /** + * 编辑 + * + * @param appletCar + * @return + */ + @Operation(summary = "购物车-编辑购物车") + @PutMapping(value = "/edit") + public Result edit( AppletCar appletCar) { + appletApiCarService.updateById(appletCar); + return Result.OK("编辑购物车!"); + } + /** + * 批量删除 + * + * @param ids + * @return + */ + @Operation(summary="购物车-批量删除") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.appletApiCarService.removeById(Arrays.asList(ids.split(",")).toString()); + return Result.OK("批量删除成功!"); + } + + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/controller/AppletCarController.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/controller/AppletCarController.java new file mode 100644 index 0000000..bc98d04 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/controller/AppletCarController.java @@ -0,0 +1,181 @@ +package org.jeecg.modules.demo.appletCar.controller; + +import java.util.Arrays; +import java.util.HashMap; +import java.util.List; +import java.util.Map; +import java.util.stream.Collectors; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.net.URLDecoder; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import org.jeecg.common.api.vo.Result; +import org.jeecg.common.system.query.QueryGenerator; +import org.jeecg.common.system.query.QueryRuleEnum; +import org.jeecg.common.util.oConvertUtils; +import org.jeecg.modules.demo.appletCar.entity.AppletCar; +import org.jeecg.modules.demo.appletCar.service.IAppletCarService; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import lombok.extern.slf4j.Slf4j; + +import org.jeecgframework.poi.excel.ExcelImportUtil; +import org.jeecgframework.poi.excel.def.NormalExcelConstants; +import org.jeecgframework.poi.excel.entity.ExportParams; +import org.jeecgframework.poi.excel.entity.ImportParams; +import org.jeecgframework.poi.excel.view.JeecgEntityExcelView; +import org.jeecg.common.system.base.controller.JeecgController; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; +import org.springframework.web.multipart.MultipartHttpServletRequest; +import org.springframework.web.servlet.ModelAndView; +import com.alibaba.fastjson.JSON; +import io.swagger.v3.oas.annotations.tags.Tag; +import io.swagger.v3.oas.annotations.Operation; +import org.jeecg.common.aspect.annotation.AutoLog; +import org.apache.shiro.authz.annotation.RequiresPermissions; + /** + * @Description: 购物车 + * @Author: jeecg-boot + * @Date: 2025-07-24 + * @Version: V1.0 + */ +@Tag(name="购物车") +@RestController +@RequestMapping("/appletCar/appletCar") +@Slf4j +public class AppletCarController extends JeecgController { + @Autowired + private IAppletCarService appletCarService; + + /** + * 分页列表查询 + * + * @param appletCar + * @param pageNo + * @param pageSize + * @param req + * @return + */ + //@AutoLog(value = "购物车-分页列表查询") + @Operation(summary="购物车-分页列表查询") + @GetMapping(value = "/list") + public Result> queryPageList(AppletCar appletCar, + @RequestParam(name="pageNo", defaultValue="1") Integer pageNo, + @RequestParam(name="pageSize", defaultValue="10") Integer pageSize, + HttpServletRequest req) { + + + QueryWrapper queryWrapper = QueryGenerator.initQueryWrapper(appletCar, req.getParameterMap()); + Page page = new Page(pageNo, pageSize); + IPage pageList = appletCarService.page(page, queryWrapper); + return Result.OK(pageList); + } + + /** + * 添加 + * + * @param appletCar + * @return + */ + @AutoLog(value = "购物车-添加") + @Operation(summary="购物车-添加") + @RequiresPermissions("appletCar:applet_car:add") + @PostMapping(value = "/add") + public Result add(@RequestBody AppletCar appletCar) { + appletCarService.save(appletCar); + return Result.OK("添加成功!"); + } + + /** + * 编辑 + * + * @param appletCar + * @return + */ + @AutoLog(value = "购物车-编辑") + @Operation(summary="购物车-编辑") + @RequiresPermissions("appletCar:applet_car:edit") + @RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST}) + public Result edit(@RequestBody AppletCar appletCar) { + appletCarService.updateById(appletCar); + return Result.OK("编辑成功!"); + } + + /** + * 通过id删除 + * + * @param id + * @return + */ + @AutoLog(value = "购物车-通过id删除") + @Operation(summary="购物车-通过id删除") + @RequiresPermissions("appletCar:applet_car:delete") + @DeleteMapping(value = "/delete") + public Result delete(@RequestParam(name="id",required=true) String id) { + appletCarService.removeById(id); + return Result.OK("删除成功!"); + } + + /** + * 批量删除 + * + * @param ids + * @return + */ + @AutoLog(value = "购物车-批量删除") + @Operation(summary="购物车-批量删除") + @RequiresPermissions("appletCar:applet_car:deleteBatch") + @DeleteMapping(value = "/deleteBatch") + public Result deleteBatch(@RequestParam(name="ids",required=true) String ids) { + this.appletCarService.removeByIds(Arrays.asList(ids.split(","))); + return Result.OK("批量删除成功!"); + } + + /** + * 通过id查询 + * + * @param id + * @return + */ + //@AutoLog(value = "购物车-通过id查询") + @Operation(summary="购物车-通过id查询") + @GetMapping(value = "/queryById") + public Result queryById(@RequestParam(name="id",required=true) String id) { + AppletCar appletCar = appletCarService.getById(id); + if(appletCar==null) { + return Result.error("未找到对应数据"); + } + return Result.OK(appletCar); + } + + /** + * 导出excel + * + * @param request + * @param appletCar + */ + @RequiresPermissions("appletCar:applet_car:exportXls") + @RequestMapping(value = "/exportXls") + public ModelAndView exportXls(HttpServletRequest request, AppletCar appletCar) { + return super.exportXls(request, appletCar, AppletCar.class, "购物车"); + } + + /** + * 通过excel导入数据 + * + * @param request + * @param response + * @return + */ + @RequiresPermissions("appletCar:applet_car:importExcel") + @RequestMapping(value = "/importExcel", method = RequestMethod.POST) + public Result importExcel(HttpServletRequest request, HttpServletResponse response) { + return super.importExcel(request, response, AppletCar.class); + } + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/entity/AppletCar.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/entity/AppletCar.java new file mode 100644 index 0000000..45096d0 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/entity/AppletCar.java @@ -0,0 +1,71 @@ +package org.jeecg.modules.demo.appletCar.entity; + +import java.io.Serializable; +import java.io.UnsupportedEncodingException; +import java.util.Date; +import java.math.BigDecimal; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import com.baomidou.mybatisplus.annotation.TableLogic; +import org.jeecg.common.constant.ProvinceCityArea; +import org.jeecg.common.util.SpringContextUtils; +import lombok.Data; +import com.fasterxml.jackson.annotation.JsonFormat; +import org.springframework.format.annotation.DateTimeFormat; +import org.jeecgframework.poi.excel.annotation.Excel; +import org.jeecg.common.aspect.annotation.Dict; +import io.swagger.v3.oas.annotations.media.Schema; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +/** + * @Description: 购物车 + * @Author: jeecg-boot + * @Date: 2025-07-24 + * @Version: V1.0 + */ +@Data +@TableName("applet_car") +@Accessors(chain = true) +@EqualsAndHashCode(callSuper = false) +@Schema(description="购物车") +public class AppletCar implements Serializable { + private static final long serialVersionUID = 1L; + + /**主键*/ + @TableId(type = IdType.ASSIGN_ID) + @Schema(description = "主键") + private java.lang.String id; + /**创建人*/ + @Schema(description = "创建人") + private java.lang.String createBy; + /**创建日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @Schema(description = "创建日期") + private java.util.Date createTime; + /**更新人*/ + @Schema(description = "更新人") + private java.lang.String updateBy; + /**更新日期*/ + @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss") + @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss") + @Schema(description = "更新日期") + private java.util.Date updateTime; + /**所属部门*/ + @Schema(description = "所属部门") + private java.lang.String sysOrgCode; + /**用户id*/ + @Excel(name = "用户id", width = 15) + @Schema(description = "用户id") + private java.lang.String userId; + /**商品id*/ + @Excel(name = "商品id", width = 15) + @Schema(description = "商品id") + private java.lang.String productId; + /**商品规格*/ + @Excel(name = "商品规格", width = 15) + @Schema(description = "商品规格") + private java.lang.String skuId; +} diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/mapper/AppletCarMapper.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/mapper/AppletCarMapper.java new file mode 100644 index 0000000..b7598cb --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/mapper/AppletCarMapper.java @@ -0,0 +1,17 @@ +package org.jeecg.modules.demo.appletCar.mapper; + +import java.util.List; + +import org.apache.ibatis.annotations.Param; +import org.jeecg.modules.demo.appletCar.entity.AppletCar; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** + * @Description: 购物车 + * @Author: jeecg-boot + * @Date: 2025-07-24 + * @Version: V1.0 + */ +public interface AppletCarMapper extends BaseMapper { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/mapper/xml/AppletCarMapper.xml b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/mapper/xml/AppletCarMapper.xml new file mode 100644 index 0000000..3f155c3 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/mapper/xml/AppletCarMapper.xml @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/service/IAppletCarService.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/service/IAppletCarService.java new file mode 100644 index 0000000..038c273 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/service/IAppletCarService.java @@ -0,0 +1,14 @@ +package org.jeecg.modules.demo.appletCar.service; + +import org.jeecg.modules.demo.appletCar.entity.AppletCar; +import com.baomidou.mybatisplus.extension.service.IService; + +/** + * @Description: 购物车 + * @Author: jeecg-boot + * @Date: 2025-07-24 + * @Version: V1.0 + */ +public interface IAppletCarService extends IService { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/service/impl/AppletCarServiceImpl.java b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/service/impl/AppletCarServiceImpl.java new file mode 100644 index 0000000..0fff7e9 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/service/impl/AppletCarServiceImpl.java @@ -0,0 +1,19 @@ +package org.jeecg.modules.demo.appletCar.service.impl; + +import org.jeecg.modules.demo.appletCar.entity.AppletCar; +import org.jeecg.modules.demo.appletCar.mapper.AppletCarMapper; +import org.jeecg.modules.demo.appletCar.service.IAppletCarService; +import org.springframework.stereotype.Service; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; + +/** + * @Description: 购物车 + * @Author: jeecg-boot + * @Date: 2025-07-24 + * @Version: V1.0 + */ +@Service +public class AppletCarServiceImpl extends ServiceImpl implements IAppletCarService { + +} diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp/AppletCarForm.vue b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp/AppletCarForm.vue new file mode 100644 index 0000000..14d5969 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp/AppletCarForm.vue @@ -0,0 +1,95 @@ + + + diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp/AppletCarList.vue b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp/AppletCarList.vue new file mode 100644 index 0000000..855a267 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp/AppletCarList.vue @@ -0,0 +1,44 @@ + + + + diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp3/AppletCarData.ts b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp3/AppletCarData.ts new file mode 100644 index 0000000..52ef3fe --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp3/AppletCarData.ts @@ -0,0 +1,19 @@ +import { render } from '@/common/renderUtils'; +//列表数据 +export const columns = [ + { + title: '用户id', + align:"center", + dataIndex: 'userId' + }, + { + title: '商品id', + align:"center", + dataIndex: 'productId' + }, + { + title: '商品规格', + align:"center", + dataIndex: 'skuId' + }, +]; \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp3/AppletCarForm.vue b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp3/AppletCarForm.vue new file mode 100644 index 0000000..1491215 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp3/AppletCarForm.vue @@ -0,0 +1,235 @@ + +{ +layout: 'default', +style: { +navigationStyle: 'custom', +navigationBarTitleText: '购物车', +}, +} + + + + + + diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp3/AppletCarList.vue b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp3/AppletCarList.vue new file mode 100644 index 0000000..edf6354 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/uniapp3/AppletCarList.vue @@ -0,0 +1,148 @@ + +{ +layout: 'default', +style: { +navigationBarTitleText: '购物车', +navigationStyle: 'custom', +}, +} + + + + + + diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/AppletCar.api.ts b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/AppletCar.api.ts new file mode 100644 index 0000000..f4c4d6e --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/AppletCar.api.ts @@ -0,0 +1,64 @@ +import {defHttp} from '/@/utils/http/axios'; +import { useMessage } from "/@/hooks/web/useMessage"; + +const { createConfirm } = useMessage(); + +enum Api { + list = '/appletCar/appletCar/list', + save='/appletCar/appletCar/add', + edit='/appletCar/appletCar/edit', + deleteOne = '/appletCar/appletCar/delete', + deleteBatch = '/appletCar/appletCar/deleteBatch', + importExcel = '/appletCar/appletCar/importExcel', + exportXls = '/appletCar/appletCar/exportXls', +} +/** + * 导出api + * @param params + */ +export const getExportUrl = Api.exportXls; +/** + * 导入api + */ +export const getImportUrl = Api.importExcel; +/** + * 列表接口 + * @param params + */ +export const list = (params) => + defHttp.get({url: Api.list, params}); + +/** + * 删除单个 + */ +export const deleteOne = (params,handleSuccess) => { + return defHttp.delete({url: Api.deleteOne, params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); +} +/** + * 批量删除 + * @param params + */ +export const batchDelete = (params, handleSuccess) => { + createConfirm({ + iconType: 'warning', + title: '确认删除', + content: '是否删除选中数据', + okText: '确认', + cancelText: '取消', + onOk: () => { + return defHttp.delete({url: Api.deleteBatch, data: params}, {joinParamsToUrl: true}).then(() => { + handleSuccess(); + }); + } + }); +} +/** + * 保存或者更新 + * @param params + */ +export const saveOrUpdate = (params, isUpdate) => { + let url = isUpdate ? Api.edit : Api.save; + return defHttp.post({url: url, params}); +} diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/AppletCar.data.ts b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/AppletCar.data.ts new file mode 100644 index 0000000..c7674a7 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/AppletCar.data.ts @@ -0,0 +1,67 @@ +import {BasicColumn} from '/@/components/Table'; +import {FormSchema} from '/@/components/Table'; +import { rules} from '/@/utils/helper/validator'; +import { render } from '/@/utils/common/renderUtils'; +import { getWeekMonthQuarterYear } from '/@/utils'; +//列表数据 +export const columns: BasicColumn[] = [ + { + title: '用户id', + align:"center", + dataIndex: 'userId' + }, + { + title: '商品id', + align:"center", + dataIndex: 'productId' + }, + { + title: '商品规格', + align:"center", + dataIndex: 'skuId' + }, +]; +//查询数据 +export const searchFormSchema: FormSchema[] = [ +]; +//表单数据 +export const formSchema: FormSchema[] = [ + { + label: '用户id', + field: 'userId', + component: 'Input', + }, + { + label: '商品id', + field: 'productId', + component: 'Input', + }, + { + label: '商品规格', + field: 'skuId', + component: 'Input', + }, + // TODO 主键隐藏字段,目前写死为ID + { + label: '', + field: 'id', + component: 'Input', + show: false + }, +]; + +// 高级查询数据 +export const superQuerySchema = { + userId: {title: '用户id',order: 0,view: 'text', type: 'string',}, + productId: {title: '商品id',order: 1,view: 'text', type: 'string',}, + skuId: {title: '商品规格',order: 2,view: 'text', type: 'string',}, +}; + +/** +* 流程表单调用这个方法获取formSchema +* @param param +*/ +export function getBpmFormSchema(_formData): FormSchema[]{ + // 默认和原始表单保持一致 如果流程中配置了权限数据,这里需要单独处理formSchema + return formSchema; +} \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/AppletCarList.vue b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/AppletCarList.vue new file mode 100644 index 0000000..65c21dd --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/AppletCarList.vue @@ -0,0 +1,206 @@ + + + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/V20250724_1__menu_insert_AppletCar.sql b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/V20250724_1__menu_insert_AppletCar.sql new file mode 100644 index 0000000..ea5af32 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/V20250724_1__menu_insert_AppletCar.sql @@ -0,0 +1,26 @@ +-- 注意:该页面对应的前台目录为views/appletCar文件夹下 +-- 如果你想更改到其他目录,请修改sql中component字段对应的值 + + +INSERT INTO sys_permission(id, parent_id, name, url, component, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_route, is_leaf, keep_alive, hidden, hide_tab, description, status, del_flag, rule_flag, create_by, create_time, update_by, update_time, internal_or_external) +VALUES ('2025072401193310000', NULL, '购物车', '/appletCar/appletCarList', 'appletCar/AppletCarList', NULL, NULL, 0, NULL, '1', 0.00, 0, NULL, 1, 0, 0, 0, 0, NULL, '1', 0, 0, 'admin', '2025-07-24 13:19:00', NULL, NULL, 0); + +-- 权限控制sql +-- 新增 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2025072401193310001', '2025072401193310000', '添加购物车', NULL, NULL, 0, NULL, NULL, 2, 'appletCar:applet_car:add', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-24 13:19:00', NULL, NULL, 0, 0, '1', 0); +-- 编辑 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2025072401193310002', '2025072401193310000', '编辑购物车', NULL, NULL, 0, NULL, NULL, 2, 'appletCar:applet_car:edit', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-24 13:19:00', NULL, NULL, 0, 0, '1', 0); +-- 删除 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2025072401193310003', '2025072401193310000', '删除购物车', NULL, NULL, 0, NULL, NULL, 2, 'appletCar:applet_car:delete', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-24 13:19:00', NULL, NULL, 0, 0, '1', 0); +-- 批量删除 +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2025072401193310004', '2025072401193310000', '批量删除购物车', NULL, NULL, 0, NULL, NULL, 2, 'appletCar:applet_car:deleteBatch', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-24 13:19:00', NULL, NULL, 0, 0, '1', 0); +-- 导出excel +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2025072401193320005', '2025072401193310000', '导出excel_购物车', NULL, NULL, 0, NULL, NULL, 2, 'appletCar:applet_car:exportXls', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-24 13:19:00', NULL, NULL, 0, 0, '1', 0); +-- 导入excel +INSERT INTO sys_permission(id, parent_id, name, url, component, is_route, component_name, redirect, menu_type, perms, perms_type, sort_no, always_show, icon, is_leaf, keep_alive, hidden, hide_tab, description, create_by, create_time, update_by, update_time, del_flag, rule_flag, status, internal_or_external) +VALUES ('2025072401193320006', '2025072401193310000', '导入excel_购物车', NULL, NULL, 0, NULL, NULL, 2, 'appletCar:applet_car:importExcel', '1', NULL, 0, NULL, 1, 0, 0, 0, NULL, 'admin', '2025-07-24 13:19:00', NULL, NULL, 0, 0, '1', 0); \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/components/AppletCarForm.vue b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/components/AppletCarForm.vue new file mode 100644 index 0000000..f5430ec --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/components/AppletCarForm.vue @@ -0,0 +1,70 @@ + + + \ No newline at end of file diff --git a/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/components/AppletCarModal.vue b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/components/AppletCarModal.vue new file mode 100644 index 0000000..f17af01 --- /dev/null +++ b/jeecg-boot/jeecg-boot-module/jeecgboot-boot-applet/src/main/java/org/jeecg/modules/demo/appletCar/vue3/components/AppletCarModal.vue @@ -0,0 +1,99 @@ + + + + + \ No newline at end of file