Browse Source

1、添加父级订单

qmj 4 months ago
parent
commit
bcd6256dc2
20 changed files with 1359 additions and 21 deletions
  1. 2 2
      .idea/ProjectStorage.xml
  2. 104 0
      ruoyi-admin/src/main/java/com/ruoyi/app/order/UserOrderController.java
  3. 37 0
      ruoyi-admin/src/main/java/com/ruoyi/app/order/dto/OrderCreatItem.java
  4. 37 0
      ruoyi-admin/src/main/java/com/ruoyi/app/order/dto/OrderCreateInput.java
  5. 21 11
      ruoyi-admin/src/main/java/com/ruoyi/app/user/UserAppIndexController.java
  6. 104 0
      ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/NightMarketController.java
  7. 281 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/NightMarket.java
  8. 71 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/OrderParent.java
  9. 3 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/PosOrder.java
  10. 7 7
      ruoyi-system/src/main/java/com/ruoyi/system/domain/PosType.java
  11. 2 0
      ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/OrderDTO.java
  12. 62 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/NightMarketMapper.java
  13. 62 0
      ruoyi-system/src/main/java/com/ruoyi/system/mapper/OrderParentMapper.java
  14. 62 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/INightMarketService.java
  15. 62 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/IOrderParentService.java
  16. 95 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/NightMarketServiceImpl.java
  17. 98 0
      ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OrderParentServiceImpl.java
  18. 141 0
      ruoyi-system/src/main/resources/mapper/system/NightMarketMapper.xml
  19. 101 0
      ruoyi-system/src/main/resources/mapper/system/OrderParentMapper.xml
  20. 7 1
      ruoyi-system/src/main/resources/mapper/system/PosOrderMapper.xml

+ 2 - 2
.idea/ProjectStorage.xml

@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <project version="4">
   <component name="ProjectStorage">
-    <option name="path" value="覃明健-&gt;CTE" />
-    <option name="projectId" value="4661c695547c000" />
+    <option name="path" value="覃明健-&gt;foodie" />
+    <option name="projectId" value="4f55bfdb5070000" />
   </component>
 </project>

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/app/order/UserOrderController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.app.order;
+
+import com.ruoyi.app.order.dto.OrderCreateInput;
+import com.ruoyi.app.order.dto.OrderCreatItem;
+import com.ruoyi.common.annotation.Anonymous;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.exception.ServiceException;
+import com.ruoyi.common.utils.MessageUtils;
+import com.ruoyi.system.domain.OrderParent;
+import com.ruoyi.system.domain.PosOrder;
+import com.ruoyi.system.service.IOrderParentService;
+import com.ruoyi.system.service.IPosOrderService;
+import com.ruoyi.system.utils.Auth;
+import com.ruoyi.system.utils.JwtUtil;
+import io.swagger.v3.oas.annotations.parameters.RequestBody;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.transaction.annotation.Transactional;
+import org.springframework.web.bind.annotation.RequestHeader;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.Date;
+
+/**
+ * 用户订单Controller
+ *
+ * @author ruoyi
+ * @date 2020-04-01
+ */
+@RestController
+@RequestMapping("/system/userOrder")
+public class UserOrderController extends BaseController {
+    @Autowired
+    private IOrderParentService orderParentService;
+    @Autowired
+    private IPosOrderService posOrderService;
+
+    /**
+     * 创建订单
+     */
+    @RequestMapping("/createOrder")
+    @Auth
+    @Anonymous
+    @Transactional(rollbackFor = Exception.class)
+    public AjaxResult createOrder(@RequestHeader String token, @RequestBody OrderCreateInput input)
+    {
+        JwtUtil jwtUtil = new JwtUtil();
+        String id = jwtUtil.getusid(token);
+        createOrderParent(input,Long.valueOf(id));
+        createOrderChild(input,Long.valueOf(id));
+        return super.success();
+    }
+
+    //创建父订单
+    private void createOrderParent(OrderCreateInput input,Long UserId){
+        OrderParent orderParent = new OrderParent();
+        orderParent.setUserId(UserId);
+        orderParent.setOrderStatus(0L);
+        orderParent.setTotalAmount(input.getTotalAmount());
+        orderParent.setActualPayAmount(input.getActualPayAmount());
+        orderParent.setPaymentMethod(input.getPaymentMethod());
+        orderParent.setPaymentTime(new Date());
+        orderParent.setCreateTime(new Date());
+        orderParent.setUpdateTime(new Date());
+        orderParent.setDdId(input.getDdId().toString());
+        orderParentService.save(orderParent);
+    }
+    //创建子订单
+    private void createOrderChild(OrderCreateInput input,Long orderParentId){
+        // 检查items是否为空
+        if (input.getItems() == null || input.getItems().isEmpty()) {
+            throw new ServiceException(MessageUtils.message("订单商品不能为空"));
+        }
+        String ddId = input.getDdId().toString();
+        // 循环items,为每个item创建一条PosOrder
+        for (OrderCreatItem item : input.getItems()) {
+            int index = input.getItems().indexOf(item) + 1;
+            String subddId = ddId+ index;
+            PosOrder posOrder = new PosOrder();
+            // 设置子订单的基本信息
+            posOrder.setDdId(Long.parseLong(subddId));
+            posOrder.setParentDdId(input.getDdId().toString()); // 设置父订单ID
+            posOrder.setCretim(new Date());
+            posOrder.setState(0L); // 初始状态
+            // 根据item设置订单信息
+            posOrder.setShId(item.getShId());
+            posOrder.setMdId(item.getMdId());
+            posOrder.setShdzId(input.getShdzId());
+            posOrder.setUserId(orderParentId); // 使用父订单的用户ID
+            posOrder.setAmount(item.getAmount());
+            posOrder.setRemarks(item.getRemarks());
+            posOrder.setType(item.getType());
+            posOrder.setDelryTime(item.getDelryTime());
+            posOrder.setFood(item.getFood());
+            // 设置支付相关信息(从父订单继承)
+            posOrder.setPayType(input.getPaymentMethod());
+            // 保存子订单
+            posOrderService.save(posOrder);
+        }
+    }
+
+
+}

+ 37 - 0
ruoyi-admin/src/main/java/com/ruoyi/app/order/dto/OrderCreatItem.java

@@ -0,0 +1,37 @@
+package com.ruoyi.app.order.dto;
+
+import lombok.Data;
+
+@Data
+public class OrderCreatItem {
+    private static final long serialVersionUID = 1L;
+    /** 商家id */
+
+    private Long shId;
+
+    /** 门店id */
+
+    private Long mdId;
+
+    /** 订单合计金额 */
+
+    private Integer amount;
+
+    /** 备注 */
+
+    private String remarks;
+
+
+    /** 订单类型:0外送,1自取,2堂食 */
+
+    private Long type;
+
+    /** 配送时间 */
+
+    private String delryTime;
+
+    /** 订单商品 */
+
+    private String food;
+
+}

+ 37 - 0
ruoyi-admin/src/main/java/com/ruoyi/app/order/dto/OrderCreateInput.java

@@ -0,0 +1,37 @@
+package com.ruoyi.app.order.dto;
+
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+
+import java.util.List;
+
+@Data
+public class OrderCreateInput {
+    private static final long serialVersionUID = 1L;
+
+    /** 订单号 */
+    private Long ddId;
+    /** 收货地址id */
+    private Long shdzId;
+
+    /** 订单总金额(分) */
+
+    private Long totalAmount;
+
+    /** 总优惠金额(分) */
+
+    //private Long totalDiscount;
+
+    /** 实际支付金额(分) */
+
+    private Long actualPayAmount;
+
+    /** 支付方式 */
+
+    private String paymentMethod;
+
+//    /** 父订单id号 */
+//    private String parentDdId;
+
+    private List<OrderCreatItem> items;
+}

+ 21 - 11
ruoyi-admin/src/main/java/com/ruoyi/app/user/UserAppIndexController.java

@@ -26,17 +26,13 @@ import org.springframework.web.bind.annotation.*;
 import java.math.BigDecimal;
 import java.util.List;
 import java.util.ArrayList;
-import java.util.Map;
-import java.util.HashMap;
-import java.util.Comparator;
-import java.util.stream.Collectors;
 import com.ruoyi.system.mapper.PosOrderMapper;
 import com.ruoyi.system.service.IFoodStatisticsService;
 import com.ruoyi.app.user.dto.StoreOutput;
 import org.springframework.beans.BeanUtils;
 
 /**
- * 用户中心-首页
+ * 用户美食首页
  *
  * @author ruoyi
  */
@@ -61,7 +57,7 @@ public class UserAppIndexController extends BaseController {
      * 获取分类列表
      */
     @Anonymous
-    @GetMapping("/getUserInfo")
+    @GetMapping("/getcategoryList")
     public AjaxResult getCategoryList() {
         LambdaQueryWrapper<PosType> queryWrapper = new LambdaQueryWrapper<>();
         queryWrapper.ne(PosType::getId, 0);
@@ -69,15 +65,28 @@ public class UserAppIndexController extends BaseController {
         return AjaxResult.success(list);
     }
 
+    /**
+     * 获取门店分页列表
+     */
     @Anonymous
     @GetMapping("/getStoreList")
-    public AjaxResult getFoodStoreList( @RequestParam BigDecimal longitude,
+    public AjaxResult getFoodStoreList(@RequestParam String language,
+                                       @RequestParam BigDecimal longitude,
                                         @RequestParam BigDecimal latitude,
                                         @RequestParam Integer page,
-                                        @RequestParam Long flId) {
+                                        @RequestParam(defaultValue = "0") Long flId) {
         List<PosStore> storeList = posStoreMapper.getjxStore(longitude,latitude,(page-1)*10,flId);
         int count = posStoreMapper.getjxStoreCount(longitude,latitude,flId);
-
+        String lang="3";
+        if ("zh-CN".equals(language)) {
+            lang = "2";
+        }
+        if ("zh-TW".equals(language)) {
+            lang = "3";
+        }
+        if ("en-US".equals(language)) {
+            lang = "1";
+        }
         // 转换为StoreOutput并查询每个门店的商品列表
         List<StoreOutput> storeOutputList = new ArrayList<>();
         for (PosStore store : storeList) {
@@ -87,8 +96,9 @@ public class UserAppIndexController extends BaseController {
             // 查询门店的商品列表
             LambdaQueryWrapper<PosFood> foodWrapper = new LambdaQueryWrapper<>();
             foodWrapper.eq(PosFood::getMdid, store.getId());
-            foodWrapper.ne(PosFood::getToExamine, "1");
-            foodWrapper.last("limit 10");
+            foodWrapper.eq(PosFood::getToExamine, "1");
+            foodWrapper.eq(PosFood::getLanguage, lang);
+            foodWrapper.last("limit 6");
             List<PosFood> foodList = posFoodService.list(foodWrapper);
             storeOutput.setFoodList(foodList);
             storeOutputList.add(storeOutput);

+ 104 - 0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/NightMarketController.java

@@ -0,0 +1,104 @@
+package com.ruoyi.web.controller.system;
+
+import java.util.List;
+import javax.servlet.http.HttpServletResponse;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.PutMapping;
+import org.springframework.web.bind.annotation.DeleteMapping;
+import org.springframework.web.bind.annotation.PathVariable;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
+import com.ruoyi.common.annotation.Log;
+import com.ruoyi.common.core.controller.BaseController;
+import com.ruoyi.common.core.domain.AjaxResult;
+import com.ruoyi.common.enums.BusinessType;
+import com.ruoyi.system.domain.NightMarket;
+import com.ruoyi.system.service.INightMarketService;
+import com.ruoyi.common.utils.poi.ExcelUtil;
+import com.ruoyi.common.core.page.TableDataInfo;
+
+/**
+ * 夜市Controller
+ *
+ * @author ruoyi
+ * @date 2025-09-02
+ */
+@RestController
+@RequestMapping("/system/market")
+public class NightMarketController extends BaseController
+{
+    @Autowired
+    private INightMarketService nightMarketService;
+
+    /**
+     * 查询夜市列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:market:list')")
+    @GetMapping("/list")
+    public TableDataInfo list(NightMarket nightMarket)
+    {
+        startPage();
+        List<NightMarket> list = nightMarketService.selectNightMarketList(nightMarket);
+        return getDataTable(list);
+    }
+
+    /**
+     * 导出夜市列表
+     */
+    @PreAuthorize("@ss.hasPermi('system:market:export')")
+    @Log(title = "夜市", businessType = BusinessType.EXPORT)
+    @PostMapping("/export")
+    public void export(HttpServletResponse response, NightMarket nightMarket)
+    {
+        List<NightMarket> list = nightMarketService.selectNightMarketList(nightMarket);
+        ExcelUtil<NightMarket> util = new ExcelUtil<NightMarket>(NightMarket.class);
+        util.exportExcel(response, list, "夜市数据");
+    }
+
+    /**
+     * 获取夜市详细信息
+     */
+    @PreAuthorize("@ss.hasPermi('system:market:query')")
+    @GetMapping(value = "/{id}")
+    public AjaxResult getInfo(@PathVariable("id") Long id)
+    {
+        return success(nightMarketService.selectNightMarketById(id));
+    }
+
+    /**
+     * 新增夜市
+     */
+    @PreAuthorize("@ss.hasPermi('system:market:add')")
+    @Log(title = "夜市", businessType = BusinessType.INSERT)
+    @PostMapping
+    public AjaxResult add(@RequestBody NightMarket nightMarket)
+    {
+        return toAjax(nightMarketService.insertNightMarket(nightMarket));
+    }
+
+    /**
+     * 修改夜市
+     */
+    @PreAuthorize("@ss.hasPermi('system:market:edit')")
+    @Log(title = "夜市", businessType = BusinessType.UPDATE)
+    @PutMapping
+    public AjaxResult edit(@RequestBody NightMarket nightMarket)
+    {
+        return toAjax(nightMarketService.updateNightMarket(nightMarket));
+    }
+
+    /**
+     * 删除夜市
+     */
+    @PreAuthorize("@ss.hasPermi('system:market:remove')")
+    @Log(title = "夜市", businessType = BusinessType.DELETE)
+    @DeleteMapping("/{ids}")
+    public AjaxResult remove(@PathVariable Long[] ids)
+    {
+        return toAjax(nightMarketService.deleteNightMarketByIds(ids));
+    }
+}

+ 281 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/NightMarket.java

@@ -0,0 +1,281 @@
+package com.ruoyi.system.domain;
+
+import java.math.BigDecimal;
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import javax.persistence.GeneratedValue;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 夜市对象 night_market
+ *
+ * @author ruoyi
+ * @date 2025-09-02
+ */
+@Data
+@TableName(value = "night_market")
+@EqualsAndHashCode(callSuper = false)
+public class NightMarket
+{
+    private static final long serialVersionUID = 1L;
+
+    @TableId(type = IdType.AUTO)
+    @GeneratedValue
+    /** $column.columnComment */
+    private Long id;
+
+    /** 夜市名称 */
+    @Excel(name = "夜市名称")
+    private String name;
+
+    /** 夜市封面 */
+    @Excel(name = "夜市封面")
+    private String image;
+
+    /** 所在地区 */
+    @Excel(name = "所在地区")
+    private String area;
+
+    /** 详细地址 */
+    @Excel(name = "详细地址")
+    private String address;
+
+    /** 经度 */
+    @Excel(name = "经度")
+    private BigDecimal longitude;
+
+    /** 纬度 */
+    @Excel(name = "纬度")
+    private BigDecimal latitude;
+
+    /** 简介 */
+    @Excel(name = "简介")
+    private String briefIntroduction;
+
+    /** 开始营业 */
+    @Excel(name = "开始营业")
+    private String openBusiness;
+
+    /** 结束营业 */
+    @Excel(name = "结束营业")
+    private String windingUp;
+
+    /** 分类 */
+    @Excel(name = "分类")
+    private Long sort;
+
+    /** 所属用户id */
+    @Excel(name = "所属用户id")
+    private Long userId;
+
+    /** 创建时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "创建时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date cretim;
+
+    /** 状态(0营业,1打烊) */
+    @Excel(name = "状态", readConverterExp = "0=营业,1打烊")
+    private Long state;
+
+    /** 客服电话 */
+    @Excel(name = "客服电话")
+    private String telephone;
+
+    /** 用户名 */
+    @Excel(name = "用户名")
+    private String userName;
+
+    /** logo */
+    @Excel(name = "logo")
+    private String logo;
+
+    /** 下架 */
+    @Excel(name = "下架")
+    private String offShelf;
+
+    /** 证件上传 */
+    @Excel(name = "证件上传")
+    private String hygieneLicence;
+
+    public void setId(Long id)
+    {
+        this.id = id;
+    }
+
+    public Long getId()
+    {
+        return id;
+    }
+    public void setName(String name)
+    {
+        this.name = name;
+    }
+
+    public String getName()
+    {
+        return name;
+    }
+    public void setImage(String image)
+    {
+        this.image = image;
+    }
+
+    public String getImage()
+    {
+        return image;
+    }
+    public void setArea(String area)
+    {
+        this.area = area;
+    }
+
+    public String getArea()
+    {
+        return area;
+    }
+    public void setAddress(String address)
+    {
+        this.address = address;
+    }
+
+    public String getAddress()
+    {
+        return address;
+    }
+    public void setLongitude(BigDecimal longitude)
+    {
+        this.longitude = longitude;
+    }
+
+    public BigDecimal getLongitude()
+    {
+        return longitude;
+    }
+    public void setLatitude(BigDecimal latitude)
+    {
+        this.latitude = latitude;
+    }
+
+    public BigDecimal getLatitude()
+    {
+        return latitude;
+    }
+    public void setBriefIntroduction(String briefIntroduction)
+    {
+        this.briefIntroduction = briefIntroduction;
+    }
+
+    public String getBriefIntroduction()
+    {
+        return briefIntroduction;
+    }
+    public void setOpenBusiness(String openBusiness)
+    {
+        this.openBusiness = openBusiness;
+    }
+
+    public String getOpenBusiness()
+    {
+        return openBusiness;
+    }
+    public void setWindingUp(String windingUp)
+    {
+        this.windingUp = windingUp;
+    }
+
+    public String getWindingUp()
+    {
+        return windingUp;
+    }
+    public void setSort(Long sort)
+    {
+        this.sort = sort;
+    }
+
+    public Long getSort()
+    {
+        return sort;
+    }
+    public void setUserId(Long userId)
+    {
+        this.userId = userId;
+    }
+
+    public Long getUserId()
+    {
+        return userId;
+    }
+    public void setCretim(Date cretim)
+    {
+        this.cretim = cretim;
+    }
+
+    public Date getCretim()
+    {
+        return cretim;
+    }
+    public void setState(Long state)
+    {
+        this.state = state;
+    }
+
+    public Long getState()
+    {
+        return state;
+    }
+    public void setTelephone(String telephone)
+    {
+        this.telephone = telephone;
+    }
+
+    public String getTelephone()
+    {
+        return telephone;
+    }
+    public void setUserName(String userName)
+    {
+        this.userName = userName;
+    }
+
+    public String getUserName()
+    {
+        return userName;
+    }
+    public void setLogo(String logo)
+    {
+        this.logo = logo;
+    }
+
+    public String getLogo()
+    {
+        return logo;
+    }
+    public void setOffShelf(String offShelf)
+    {
+        this.offShelf = offShelf;
+    }
+
+    public String getOffShelf()
+    {
+        return offShelf;
+    }
+    public void setHygieneLicence(String hygieneLicence)
+    {
+        this.hygieneLicence = hygieneLicence;
+    }
+
+    public String getHygieneLicence()
+    {
+        return hygieneLicence;
+    }
+
+}

+ 71 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/OrderParent.java

@@ -0,0 +1,71 @@
+package com.ruoyi.system.domain;
+
+import java.util.Date;
+import com.fasterxml.jackson.annotation.JsonFormat;
+import com.baomidou.mybatisplus.annotation.IdType;
+import com.baomidou.mybatisplus.annotation.TableId;
+import com.baomidou.mybatisplus.annotation.TableName;
+import org.apache.commons.lang3.builder.ToStringBuilder;
+import org.apache.commons.lang3.builder.ToStringStyle;
+import com.ruoyi.common.annotation.Excel;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+
+import javax.persistence.GeneratedValue;
+import com.ruoyi.common.core.domain.BaseEntity;
+
+/**
+ * 父订单对象 order_parent
+ *
+ * @author ruoyi
+ * @date 2025-09-02
+ */
+@Data
+@TableName(value = "order_parent")
+@EqualsAndHashCode(callSuper = false)
+public class OrderParent
+{
+    private static final long serialVersionUID = 1L;
+
+    @TableId(type = IdType.AUTO)
+    @GeneratedValue
+    /** 父订单ID */
+    private Long parentOrderId;
+
+    /** 用户ID */
+    @Excel(name = "用户ID")
+    private Long userId;
+
+    /** 订单状态:0待支付,1已支付,2已取消 */
+    @Excel(name = "订单状态:0待支付,1已支付,2已取消")
+    private Long orderStatus;
+
+    /** 订单总金额(分) */
+    @Excel(name = "订单总金额(分)")
+    private Long totalAmount;
+
+    /** 总优惠金额(分) */
+    @Excel(name = "总优惠金额(分)")
+    private Long totalDiscount;
+
+    /** 实际支付金额(分) */
+    @Excel(name = "实际支付金额(分)")
+    private Long actualPayAmount;
+
+    /** 支付方式 */
+    @Excel(name = "支付方式")
+    private String paymentMethod;
+
+    /** 支付时间 */
+    @JsonFormat(pattern = "yyyy-MM-dd")
+    @Excel(name = "支付时间", width = 30, dateFormat = "yyyy-MM-dd")
+    private Date paymentTime;
+
+    private Date createTime;
+
+    private Date updateTime;
+
+    private String ddId;
+
+
+}

+ 3 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/PosOrder.java

@@ -198,6 +198,9 @@ public class  PosOrder
     /** 预计送达时间 */
     private String yjsdTime;
 
+    /** 父订单号 */
+    private String parentDdId;
+
 
 
 

+ 7 - 7
ruoyi-system/src/main/java/com/ruoyi/system/domain/PosType.java

@@ -7,11 +7,11 @@ import com.ruoyi.common.core.domain.BaseEntity;
 
 /**
  * 门店分类对象 pos_type
- * 
+ *
  * @author ruoyi
  * @date 2023-05-13
  */
-public class PosType extends BaseEntity
+public class PosType
 {
     private static final long serialVersionUID = 1L;
 
@@ -42,21 +42,21 @@ public class PosType extends BaseEntity
     @Excel(name = "排序")
     private String sort;
 
-    public void setId(Long id) 
+    public void setId(Long id)
     {
         this.id = id;
     }
 
-    public Long getId() 
+    public Long getId()
     {
         return id;
     }
-    public void setName(String name) 
+    public void setName(String name)
     {
         this.name = name;
     }
 
-    public String getName() 
+    public String getName()
     {
         return name;
     }
@@ -90,7 +90,7 @@ public class PosType extends BaseEntity
         this.image = image;
     }
 
-    public String getImage() 
+    public String getImage()
     {
         return image;
     }

+ 2 - 0
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/OrderDTO.java

@@ -151,5 +151,7 @@ public class OrderDTO {
     /** 积分抵扣值 */
     private Integer pointsReduction;
 
+    /** 父订单id号 */
+    private String parentDdId;
 
 }

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/NightMarketMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.system.domain.NightMarket;
+
+/**
+ * 夜市Mapper接口
+ *
+ * @author ruoyi
+ * @date 2025-09-02
+ */
+public interface NightMarketMapper  extends BaseMapper<NightMarket>
+{
+    /**
+     * 查询夜市
+     *
+     * @param id 夜市主键
+     * @return 夜市
+     */
+    public NightMarket selectNightMarketById(Long id);
+
+    /**
+     * 查询夜市列表
+     *
+     * @param nightMarket 夜市
+     * @return 夜市集合
+     */
+    public List<NightMarket> selectNightMarketList(NightMarket nightMarket);
+
+    /**
+     * 新增夜市
+     *
+     * @param nightMarket 夜市
+     * @return 结果
+     */
+    public int insertNightMarket(NightMarket nightMarket);
+
+    /**
+     * 修改夜市
+     *
+     * @param nightMarket 夜市
+     * @return 结果
+     */
+    public int updateNightMarket(NightMarket nightMarket);
+
+    /**
+     * 删除夜市
+     *
+     * @param id 夜市主键
+     * @return 结果
+     */
+    public int deleteNightMarketById(Long id);
+
+    /**
+     * 批量删除夜市
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteNightMarketByIds(Long[] ids);
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/OrderParentMapper.java

@@ -0,0 +1,62 @@
+package com.ruoyi.system.mapper;
+
+import java.util.List;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.system.domain.OrderParent;
+
+/**
+ * 父订单Mapper接口
+ *
+ * @author ruoyi
+ * @date 2025-09-02
+ */
+public interface OrderParentMapper  extends BaseMapper<OrderParent>
+{
+    /**
+     * 查询父订单
+     *
+     * @param id 父订单主键
+     * @return 父订单
+     */
+    public OrderParent selectOrderParentById(Long id);
+
+    /**
+     * 查询父订单列表
+     *
+     * @param orderParent 父订单
+     * @return 父订单集合
+     */
+    public List<OrderParent> selectOrderParentList(OrderParent orderParent);
+
+    /**
+     * 新增父订单
+     *
+     * @param orderParent 父订单
+     * @return 结果
+     */
+    public int insertOrderParent(OrderParent orderParent);
+
+    /**
+     * 修改父订单
+     *
+     * @param orderParent 父订单
+     * @return 结果
+     */
+    public int updateOrderParent(OrderParent orderParent);
+
+    /**
+     * 删除父订单
+     *
+     * @param id 父订单主键
+     * @return 结果
+     */
+    public int deleteOrderParentById(Long id);
+
+    /**
+     * 批量删除父订单
+     *
+     * @param ids 需要删除的数据主键集合
+     * @return 结果
+     */
+    public int deleteOrderParentByIds(Long[] ids);
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/INightMarketService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.system.domain.NightMarket;
+
+/**
+ * 夜市Service接口
+ *
+ * @author ruoyi
+ * @date 2025-09-02
+ */
+public interface INightMarketService extends IService<NightMarket>
+{
+    /**
+     * 查询夜市
+     *
+     * @param id 夜市主键
+     * @return 夜市
+     */
+    public NightMarket selectNightMarketById(Long id);
+
+    /**
+     * 查询夜市列表
+     *
+     * @param nightMarket 夜市
+     * @return 夜市集合
+     */
+    public List<NightMarket> selectNightMarketList(NightMarket nightMarket);
+
+    /**
+     * 新增夜市
+     *
+     * @param nightMarket 夜市
+     * @return 结果
+     */
+    public int insertNightMarket(NightMarket nightMarket);
+
+    /**
+     * 修改夜市
+     *
+     * @param nightMarket 夜市
+     * @return 结果
+     */
+    public int updateNightMarket(NightMarket nightMarket);
+
+    /**
+     * 批量删除夜市
+     *
+     * @param ids 需要删除的夜市主键集合
+     * @return 结果
+     */
+    public int deleteNightMarketByIds(Long[] ids);
+
+    /**
+     * 删除夜市信息
+     *
+     * @param id 夜市主键
+     * @return 结果
+     */
+    public int deleteNightMarketById(Long id);
+}

+ 62 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/IOrderParentService.java

@@ -0,0 +1,62 @@
+package com.ruoyi.system.service;
+
+import java.util.List;
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.ruoyi.system.domain.OrderParent;
+
+/**
+ * 父订单Service接口
+ *
+ * @author ruoyi
+ * @date 2025-09-02
+ */
+public interface IOrderParentService extends IService<OrderParent>
+{
+    /**
+     * 查询父订单
+     *
+     * @param id 父订单主键
+     * @return 父订单
+     */
+    public OrderParent selectOrderParentById(Long id);
+
+    /**
+     * 查询父订单列表
+     *
+     * @param orderParent 父订单
+     * @return 父订单集合
+     */
+    public List<OrderParent> selectOrderParentList(OrderParent orderParent);
+
+    /**
+     * 新增父订单
+     *
+     * @param orderParent 父订单
+     * @return 结果
+     */
+    public int insertOrderParent(OrderParent orderParent);
+
+    /**
+     * 修改父订单
+     *
+     * @param orderParent 父订单
+     * @return 结果
+     */
+    public int updateOrderParent(OrderParent orderParent);
+
+    /**
+     * 批量删除父订单
+     *
+     * @param ids 需要删除的父订单主键集合
+     * @return 结果
+     */
+    public int deleteOrderParentByIds(Long[] ids);
+
+    /**
+     * 删除父订单信息
+     *
+     * @param id 父订单主键
+     * @return 结果
+     */
+    public int deleteOrderParentById(Long id);
+}

+ 95 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/NightMarketServiceImpl.java

@@ -0,0 +1,95 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.system.mapper.NightMarketMapper;
+import com.ruoyi.system.domain.NightMarket;
+import com.ruoyi.system.service.INightMarketService;
+
+/**
+ * 夜市Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2025-09-02
+ */
+@Service
+public class NightMarketServiceImpl extends ServiceImpl<BaseMapper<NightMarket>,NightMarket> implements INightMarketService
+{
+    @Autowired
+    private NightMarketMapper nightMarketMapper;
+
+    /**
+     * 查询夜市
+     *
+     * @param id 夜市主键
+     * @return 夜市
+     */
+    @Override
+    public NightMarket selectNightMarketById(Long id)
+    {
+        return nightMarketMapper.selectNightMarketById(id);
+    }
+
+    /**
+     * 查询夜市列表
+     *
+     * @param nightMarket 夜市
+     * @return 夜市
+     */
+    @Override
+    public List<NightMarket> selectNightMarketList(NightMarket nightMarket)
+    {
+        return nightMarketMapper.selectNightMarketList(nightMarket);
+    }
+
+    /**
+     * 新增夜市
+     *
+     * @param nightMarket 夜市
+     * @return 结果
+     */
+    @Override
+    public int insertNightMarket(NightMarket nightMarket)
+    {
+        return nightMarketMapper.insertNightMarket(nightMarket);
+    }
+
+    /**
+     * 修改夜市
+     *
+     * @param nightMarket 夜市
+     * @return 结果
+     */
+    @Override
+    public int updateNightMarket(NightMarket nightMarket)
+    {
+        return nightMarketMapper.updateNightMarket(nightMarket);
+    }
+
+    /**
+     * 批量删除夜市
+     *
+     * @param ids 需要删除的夜市主键
+     * @return 结果
+     */
+    @Override
+    public int deleteNightMarketByIds(Long[] ids)
+    {
+        return nightMarketMapper.deleteNightMarketByIds(ids);
+    }
+
+    /**
+     * 删除夜市信息
+     *
+     * @param id 夜市主键
+     * @return 结果
+     */
+    @Override
+    public int deleteNightMarketById(Long id)
+    {
+        return nightMarketMapper.deleteNightMarketById(id);
+    }
+}

+ 98 - 0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OrderParentServiceImpl.java

@@ -0,0 +1,98 @@
+package com.ruoyi.system.service.impl;
+
+import java.util.List;
+import com.ruoyi.common.utils.DateUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.ruoyi.system.mapper.OrderParentMapper;
+import com.ruoyi.system.domain.OrderParent;
+import com.ruoyi.system.service.IOrderParentService;
+
+/**
+ * 父订单Service业务层处理
+ *
+ * @author ruoyi
+ * @date 2025-09-02
+ */
+@Service
+public class OrderParentServiceImpl extends ServiceImpl<BaseMapper<OrderParent>,OrderParent> implements IOrderParentService
+{
+    @Autowired
+    private OrderParentMapper orderParentMapper;
+
+    /**
+     * 查询父订单
+     *
+     * @param id 父订单主键
+     * @return 父订单
+     */
+    @Override
+    public OrderParent selectOrderParentById(Long id)
+    {
+        return orderParentMapper.selectOrderParentById(id);
+    }
+
+    /**
+     * 查询父订单列表
+     *
+     * @param orderParent 父订单
+     * @return 父订单
+     */
+    @Override
+    public List<OrderParent> selectOrderParentList(OrderParent orderParent)
+    {
+        return orderParentMapper.selectOrderParentList(orderParent);
+    }
+
+    /**
+     * 新增父订单
+     *
+     * @param orderParent 父订单
+     * @return 结果
+     */
+    @Override
+    public int insertOrderParent(OrderParent orderParent)
+    {
+        orderParent.setCreateTime(DateUtils.getNowDate());
+        return orderParentMapper.insertOrderParent(orderParent);
+    }
+
+    /**
+     * 修改父订单
+     *
+     * @param orderParent 父订单
+     * @return 结果
+     */
+    @Override
+    public int updateOrderParent(OrderParent orderParent)
+    {
+        orderParent.setUpdateTime(DateUtils.getNowDate());
+        return orderParentMapper.updateOrderParent(orderParent);
+    }
+
+    /**
+     * 批量删除父订单
+     *
+     * @param ids 需要删除的父订单主键
+     * @return 结果
+     */
+    @Override
+    public int deleteOrderParentByIds(Long[] ids)
+    {
+        return orderParentMapper.deleteOrderParentByIds(ids);
+    }
+
+    /**
+     * 删除父订单信息
+     *
+     * @param id 父订单主键
+     * @return 结果
+     */
+    @Override
+    public int deleteOrderParentById(Long id)
+    {
+        return orderParentMapper.deleteOrderParentById(id);
+    }
+}

+ 141 - 0
ruoyi-system/src/main/resources/mapper/system/NightMarketMapper.xml

@@ -0,0 +1,141 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.system.mapper.NightMarketMapper">
+
+    <resultMap type="NightMarket" id="NightMarketResult">
+        <result property="id"    column="id"    />
+        <result property="name"    column="name"    />
+        <result property="image"    column="image"    />
+        <result property="area"    column="area"    />
+        <result property="address"    column="address"    />
+        <result property="longitude"    column="longitude"    />
+        <result property="latitude"    column="latitude"    />
+        <result property="briefIntroduction"    column="brief_introduction"    />
+        <result property="openBusiness"    column="open_business"    />
+        <result property="windingUp"    column="winding_up"    />
+        <result property="sort"    column="sort"    />
+        <result property="userId"    column="user_id"    />
+        <result property="cretim"    column="cretim"    />
+        <result property="state"    column="state"    />
+        <result property="telephone"    column="telephone"    />
+        <result property="userName"    column="user_name"    />
+        <result property="logo"    column="logo"    />
+        <result property="offShelf"    column="off_shelf"    />
+        <result property="hygieneLicence"    column="hygiene_licence"    />
+    </resultMap>
+
+    <sql id="selectNightMarketVo">
+        select id, name, image, area, address, longitude, latitude, brief_introduction, open_business, winding_up, sort, user_id, cretim, state, telephone, user_name, logo, off_shelf, hygiene_licence from night_market
+    </sql>
+
+    <select id="selectNightMarketList" parameterType="NightMarket" resultMap="NightMarketResult">
+        <include refid="selectNightMarketVo"/>
+        <where>
+            <if test="name != null  and name != ''"> and name like concat('%', #{name}, '%')</if>
+            <if test="image != null  and image != ''"> and image = #{image}</if>
+            <if test="area != null  and area != ''"> and area = #{area}</if>
+            <if test="address != null  and address != ''"> and address = #{address}</if>
+            <if test="longitude != null "> and longitude = #{longitude}</if>
+            <if test="latitude != null "> and latitude = #{latitude}</if>
+            <if test="briefIntroduction != null  and briefIntroduction != ''"> and brief_introduction = #{briefIntroduction}</if>
+            <if test="openBusiness != null  and openBusiness != ''"> and open_business = #{openBusiness}</if>
+            <if test="windingUp != null  and windingUp != ''"> and winding_up = #{windingUp}</if>
+            <if test="sort != null "> and sort = #{sort}</if>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="cretim != null "> and cretim = #{cretim}</if>
+            <if test="state != null "> and state = #{state}</if>
+            <if test="telephone != null  and telephone != ''"> and telephone = #{telephone}</if>
+            <if test="userName != null  and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
+            <if test="logo != null  and logo != ''"> and logo = #{logo}</if>
+            <if test="offShelf != null  and offShelf != ''"> and off_shelf = #{offShelf}</if>
+            <if test="hygieneLicence != null  and hygieneLicence != ''"> and hygiene_licence = #{hygieneLicence}</if>
+        </where>
+    </select>
+
+    <select id="selectNightMarketById" parameterType="Long" resultMap="NightMarketResult">
+        <include refid="selectNightMarketVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertNightMarket" parameterType="NightMarket" useGeneratedKeys="true" keyProperty="id">
+        insert into night_market
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="name != null">name,</if>
+            <if test="image != null">image,</if>
+            <if test="area != null">area,</if>
+            <if test="address != null">address,</if>
+            <if test="longitude != null">longitude,</if>
+            <if test="latitude != null">latitude,</if>
+            <if test="briefIntroduction != null">brief_introduction,</if>
+            <if test="openBusiness != null">open_business,</if>
+            <if test="windingUp != null">winding_up,</if>
+            <if test="sort != null">sort,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="cretim != null">cretim,</if>
+            <if test="state != null">state,</if>
+            <if test="telephone != null">telephone,</if>
+            <if test="userName != null">user_name,</if>
+            <if test="logo != null">logo,</if>
+            <if test="offShelf != null">off_shelf,</if>
+            <if test="hygieneLicence != null">hygiene_licence,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="name != null">#{name},</if>
+            <if test="image != null">#{image},</if>
+            <if test="area != null">#{area},</if>
+            <if test="address != null">#{address},</if>
+            <if test="longitude != null">#{longitude},</if>
+            <if test="latitude != null">#{latitude},</if>
+            <if test="briefIntroduction != null">#{briefIntroduction},</if>
+            <if test="openBusiness != null">#{openBusiness},</if>
+            <if test="windingUp != null">#{windingUp},</if>
+            <if test="sort != null">#{sort},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="cretim != null">#{cretim},</if>
+            <if test="state != null">#{state},</if>
+            <if test="telephone != null">#{telephone},</if>
+            <if test="userName != null">#{userName},</if>
+            <if test="logo != null">#{logo},</if>
+            <if test="offShelf != null">#{offShelf},</if>
+            <if test="hygieneLicence != null">#{hygieneLicence},</if>
+        </trim>
+    </insert>
+
+    <update id="updateNightMarket" parameterType="NightMarket">
+        update night_market
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="name != null">name = #{name},</if>
+            <if test="image != null">image = #{image},</if>
+            <if test="area != null">area = #{area},</if>
+            <if test="address != null">address = #{address},</if>
+            <if test="longitude != null">longitude = #{longitude},</if>
+            <if test="latitude != null">latitude = #{latitude},</if>
+            <if test="briefIntroduction != null">brief_introduction = #{briefIntroduction},</if>
+            <if test="openBusiness != null">open_business = #{openBusiness},</if>
+            <if test="windingUp != null">winding_up = #{windingUp},</if>
+            <if test="sort != null">sort = #{sort},</if>
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="cretim != null">cretim = #{cretim},</if>
+            <if test="state != null">state = #{state},</if>
+            <if test="telephone != null">telephone = #{telephone},</if>
+            <if test="userName != null">user_name = #{userName},</if>
+            <if test="logo != null">logo = #{logo},</if>
+            <if test="offShelf != null">off_shelf = #{offShelf},</if>
+            <if test="hygieneLicence != null">hygiene_licence = #{hygieneLicence},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteNightMarketById" parameterType="Long">
+        delete from night_market where id = #{id}
+    </delete>
+
+    <delete id="deleteNightMarketByIds" parameterType="String">
+        delete from night_market where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 101 - 0
ruoyi-system/src/main/resources/mapper/system/OrderParentMapper.xml

@@ -0,0 +1,101 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!DOCTYPE mapper
+        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
+        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
+<mapper namespace="com.ruoyi.system.mapper.OrderParentMapper">
+
+    <resultMap type="OrderParent" id="OrderParentResult">
+        <result property="id"    column="id"    />
+        <result property="userId"    column="user_id"    />
+        <result property="orderStatus"    column="order_status"    />
+        <result property="totalAmount"    column="total_amount"    />
+        <result property="totalDiscount"    column="total_discount"    />
+        <result property="actualPayAmount"    column="actual_pay_amount"    />
+        <result property="paymentMethod"    column="payment_method"    />
+        <result property="paymentTime"    column="payment_time"    />
+        <result property="createTime"    column="create_time"    />
+        <result property="updateTime"    column="update_time"    />
+        <result property="ddId"    column="dd_id"    />
+    </resultMap>
+
+    <sql id="selectOrderParentVo">
+        select id, user_id, order_status, total_amount, total_discount, actual_pay_amount, payment_method, payment_time, create_time, update_time, dd_id from order_parent
+    </sql>
+
+    <select id="selectOrderParentList" parameterType="OrderParent" resultMap="OrderParentResult">
+        <include refid="selectOrderParentVo"/>
+        <where>
+            <if test="userId != null "> and user_id = #{userId}</if>
+            <if test="orderStatus != null "> and order_status = #{orderStatus}</if>
+            <if test="totalAmount != null "> and total_amount = #{totalAmount}</if>
+            <if test="totalDiscount != null "> and total_discount = #{totalDiscount}</if>
+            <if test="actualPayAmount != null "> and actual_pay_amount = #{actualPayAmount}</if>
+            <if test="paymentMethod != null  and paymentMethod != ''"> and payment_method = #{paymentMethod}</if>
+            <if test="paymentTime != null "> and payment_time = #{paymentTime}</if>
+            <if test="ddId != null  and ddId != ''"> and dd_id = #{ddId}</if>
+        </where>
+    </select>
+
+    <select id="selectOrderParentById" parameterType="Long" resultMap="OrderParentResult">
+        <include refid="selectOrderParentVo"/>
+        where id = #{id}
+    </select>
+
+    <insert id="insertOrderParent" parameterType="OrderParent">
+        insert into order_parent
+        <trim prefix="(" suffix=")" suffixOverrides=",">
+            <if test="id != null">id,</if>
+            <if test="userId != null">user_id,</if>
+            <if test="orderStatus != null">order_status,</if>
+            <if test="totalAmount != null">total_amount,</if>
+            <if test="totalDiscount != null">total_discount,</if>
+            <if test="actualPayAmount != null">actual_pay_amount,</if>
+            <if test="paymentMethod != null">payment_method,</if>
+            <if test="paymentTime != null">payment_time,</if>
+            <if test="createTime != null">create_time,</if>
+            <if test="updateTime != null">update_time,</if>
+            <if test="ddId != null">dd_id,</if>
+        </trim>
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
+            <if test="id != null">#{id},</if>
+            <if test="userId != null">#{userId},</if>
+            <if test="orderStatus != null">#{orderStatus},</if>
+            <if test="totalAmount != null">#{totalAmount},</if>
+            <if test="totalDiscount != null">#{totalDiscount},</if>
+            <if test="actualPayAmount != null">#{actualPayAmount},</if>
+            <if test="paymentMethod != null">#{paymentMethod},</if>
+            <if test="paymentTime != null">#{paymentTime},</if>
+            <if test="createTime != null">#{createTime},</if>
+            <if test="updateTime != null">#{updateTime},</if>
+            <if test="ddId != null">#{ddId},</if>
+        </trim>
+    </insert>
+
+    <update id="updateOrderParent" parameterType="OrderParent">
+        update order_parent
+        <trim prefix="SET" suffixOverrides=",">
+            <if test="userId != null">user_id = #{userId},</if>
+            <if test="orderStatus != null">order_status = #{orderStatus},</if>
+            <if test="totalAmount != null">total_amount = #{totalAmount},</if>
+            <if test="totalDiscount != null">total_discount = #{totalDiscount},</if>
+            <if test="actualPayAmount != null">actual_pay_amount = #{actualPayAmount},</if>
+            <if test="paymentMethod != null">payment_method = #{paymentMethod},</if>
+            <if test="paymentTime != null">payment_time = #{paymentTime},</if>
+            <if test="createTime != null">create_time = #{createTime},</if>
+            <if test="updateTime != null">update_time = #{updateTime},</if>
+            <if test="ddId != null">dd_id = #{ddId},</if>
+        </trim>
+        where id = #{id}
+    </update>
+
+    <delete id="deleteOrderParentById" parameterType="Long">
+        delete from order_parent where id = #{id}
+    </delete>
+
+    <delete id="deleteOrderParentByIds" parameterType="String">
+        delete from order_parent where id in
+        <foreach item="id" collection="array" open="(" separator="," close=")">
+            #{id}
+        </foreach>
+    </delete>
+</mapper>

+ 7 - 1
ruoyi-system/src/main/resources/mapper/system/PosOrderMapper.xml

@@ -44,10 +44,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="pointsReduction" column="points_reduction" />
         <result property="sdTime" column="sd_time" />
         <result property="payType" column="pay_type" />
+        <result property="parentDdId" column="parent_dd_id" />
     </resultMap>
 
     <sql id="selectPosOrderVo">
-        select id, dd_id, sh_id, md_id, cretim, shdz_id, user_id,sh_address, amount, remarks, state, type, delry_time,food,yh_id,yh_name,md_yh_id,md_yh_name,md_discount_amount,jvli,freight,dining_status,qs_id,pay_url,collect_payment,activity,md_activity,kefu_state,kefu_content,kefu_repeat,repeat_dd_id,sales_name,md_sales_name,sales_reduction,md_sales_reduction,points,points_reduction,sd_time,pay_type from pos_order
+        select id, dd_id, sh_id, md_id, cretim, shdz_id, user_id,sh_address, amount, remarks, state, type, delry_time,food,yh_id,yh_name,md_yh_id,md_yh_name,md_discount_amount,jvli,freight,dining_status,qs_id,pay_url,collect_payment,activity,md_activity,kefu_state,kefu_content,kefu_repeat,repeat_dd_id,sales_name,md_sales_name,sales_reduction,md_sales_reduction,points,points_reduction,sd_time,pay_type,parent_dd_id from pos_order
     </sql>
 
     <select id="selectPosOrderList" parameterType="PosOrder" resultMap="PosOrderResult">
@@ -79,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="pointsReduction != null"> and points_reduction = #{pointsReduction}</if>
             <if test="sdTime != null"> and sd_time = #{sdTime}</if>
             <if test="payType != null"> and pay_type =#{payType}</if>
+            <if test="parentDdId != null and parentDdId != ''"> and parent_dd_id = #{parentDdId}</if>
             and not (state=0 and collect_payment=0)
         </where>
         order by id desc
@@ -113,6 +115,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="pointsReduction != null"> and points_reduction = #{pointsReduction}</if>
              <if test="sdTime != null"> and sd_time =#{sdTime}</if>
             <if test="payType != null"> and pay_type =#{payType}</if>
+            <if test="parentDdId != null and parentDdId != ''"> and parent_dd_id = #{parentDdId}</if>
         </where>
         order by kefu_state desc,cretim desc
     </select>
@@ -150,6 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="pointsReduction != null">points_reduction,</if>
             <if test="sdTime != null">sd_time,</if>
             <if test="payType != null">pay_type,</if>
+            <if test="parentDdId != null and parentDdId != ''">parent_dd_id,</if>
          </trim>
         <trim prefix="values (" suffix=")" suffixOverrides=",">
             <if test="ddId != null">#{ddId},</if>
@@ -177,6 +181,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="pointsReduction != null">#{pointsReduction},</if>
             <if test="sdTime != null">#{sdTime},</if>
             <if test="payType != null">#{payType},</if>
+            <if test="parentDdId != null and parentDdId != ''">#{parentDdId},</if>
          </trim>
     </insert>
 
@@ -210,6 +215,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             <if test="pointsReduction != null">points_reduction = #{pointsReduction},</if>
             <if test="sdTime != null">sd_time = #{sdTime},</if>
             <if test="payType != null">pay_type = #{payType},</if>
+            <if test="parentDdId != null and parentDdId != ''">parent_dd_id = #{parentDdId},</if>
         </trim>
         where id = #{id}
     </update>