Prechádzať zdrojové kódy

feat:新增大货订单管理

kgy 6 mesiacov pred
rodič
commit
26db3d9caf

+ 34 - 0
ruoyi-modules/ruoyi-bulkOrder/src/main/java/org/dromara/bulk/controller/daHuoDingDanGuanLiController.java

@@ -0,0 +1,34 @@
+package org.dromara.bulk.controller;
+
+import cn.dev33.satoken.annotation.SaIgnore;
+import lombok.RequiredArgsConstructor;
+import org.dromara.bulk.domain.bo.daHuoDingDanGuanLiBo;
+import org.dromara.bulk.domain.vo.daHuoDingDanGuanLiVo;
+import org.dromara.common.core.domain.R;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.dromara.common.web.core.BaseController;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+import org.dromara.bulk.service.daHuoDingDanGuanLiService;
+/**
+ * 大货订单管理接口
+ */
+@RestController
+@RequiredArgsConstructor
+@RequestMapping("/bulkOrder/daHuoDingDanGuanLi")
+public class daHuoDingDanGuanLiController extends BaseController {
+    private final daHuoDingDanGuanLiService daHuoDingDanGuanLiService;
+
+    @SaIgnore
+    @GetMapping("/PageList")
+    public TableDataInfo<daHuoDingDanGuanLiVo> selectPageDaHuoDingDanGuanLiList(daHuoDingDanGuanLiBo daHuoDingDanGuanLiBo, PageQuery pageQuery){
+        return daHuoDingDanGuanLiService.selectPageDaHuoDingDanGuanLiList(daHuoDingDanGuanLiBo, pageQuery);
+    }
+    @SaIgnore
+    @PostMapping()
+    public R<Void> insertDaHuoDingDanGuanLi(@Validated @RequestBody daHuoDingDanGuanLiBo daHuoDingDanGuanLiBo){
+        return toAjax(daHuoDingDanGuanLiService.insertDaHuoDingDanGuanLi(daHuoDingDanGuanLiBo));
+    }
+}
+

+ 111 - 0
ruoyi-modules/ruoyi-bulkOrder/src/main/java/org/dromara/bulk/domain/bo/daHuoDingDanGuanLiBo.java

@@ -0,0 +1,111 @@
+package org.dromara.bulk.domain.bo;
+
+import io.github.linpeilie.annotations.AutoMapper;
+import io.github.linpeilie.annotations.AutoMapping;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.apache.ibatis.annotations.Param;
+import org.dromara.bulk.domain.daHuoDingDanGuanLi;
+import org.dromara.commodityManagement.domain.DaHuoNumber;
+import org.dromara.commodityManagement.domain.bo.DaHuoNumberBo;
+import org.dromara.common.mybatis.core.domain.BaseEntity;
+/**
+ * 大货订单管理业务对象
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@AutoMapper(target = daHuoDingDanGuanLi.class, reverseConvertGenerate = false)
+public class daHuoDingDanGuanLiBo extends BaseEntity {
+    /**
+     * id
+     */
+    private Long id;
+    /**
+     * 用户id
+     */
+    private Long user_id;
+    /**
+     * 姓名
+     */
+    private String name;
+    /**
+     * 联系方式
+     */
+    private String phone;
+    /**
+     * 地址
+     */
+    private String address;
+    /**
+     * 订单号
+     */
+    private String order_num;
+    /**
+     * 订单价格
+     */
+    private Float order_price;
+    /**
+     * 状态:0=待审核,1=已审核,2=待发货,3=待收货,4=已收货,5=退款中,6=退款完成,7=交易取消,8=交易完成
+     */
+    private String order_status;
+    /**
+     * 备注
+     */
+    private String remark;
+    /**
+     * 支付状态:0=支付中,1=支付成功,2=支付失败
+     */
+    private String pay_status;
+    /**
+     * 付款时间
+     */
+    private String pay_time;
+    /**
+     * 配送类型:1=专业配送,2=到店自取
+     */
+    private String diver_type;
+    /**
+     * 门店id
+     */
+    private Long store_id;
+    /**
+     * 司机id
+     */
+    private Long diver_id;
+    /**
+     * 司机姓名
+     */
+    private String diver_name;
+    /**
+     * 司机电话
+     */
+    private String diver_phone;
+    /**
+     * 删除时间
+     */
+    private String delete_time;
+    /**
+     * 是否隐藏
+     */
+    private int hide=0;
+    /**
+     * 备注
+     */
+    private String note;
+    /**
+     * 确认收货时间
+     */
+    private String confirm_delivery_time;
+    /**
+     * 工厂用户id
+     */
+    private Long factory_user_id;
+    /**
+     * 联系人
+     */
+    private String contact_name;
+    /**
+     * 大货编号的Bo类
+     */
+    private DaHuoNumberBo daHuoNumberBo;
+}

+ 104 - 0
ruoyi-modules/ruoyi-bulkOrder/src/main/java/org/dromara/bulk/domain/vo/daHuoDingDanGuanLiVo.java

@@ -0,0 +1,104 @@
+package org.dromara.bulk.domain.vo;
+
+import io.github.linpeilie.annotations.AutoMapper;
+import io.github.linpeilie.annotations.AutoMapping;
+import lombok.Data;
+import lombok.EqualsAndHashCode;
+import org.dromara.bulk.domain.daHuoDingDanGuanLi;
+import org.dromara.common.mybatis.core.domain.BaseEntity;
+/**
+ * 大货订单管理值对象
+ */
+@Data
+@EqualsAndHashCode(callSuper = true)
+@AutoMapper(target = daHuoDingDanGuanLi.class)
+public class daHuoDingDanGuanLiVo extends BaseEntity {
+    /**
+     * id
+     */
+    private Long id;
+    /**
+     * 用户id
+     */
+    private Long user_id;
+    /**
+     * 姓名
+     */
+    private String name;
+    /**
+     * 联系方式
+     */
+    private String phone;
+    /**
+     * 地址
+     */
+    private String address;
+    /**
+     * 订单号
+     */
+    private String order_num;
+    /**
+     * 订单价格
+     */
+    private Float order_price;
+    /**
+     * 状态:0=待审核,1=已审核,2=待发货,3=待收货,4=已收货,5=退款中,6=退款完成,7=交易取消,8=交易完成
+     */
+    private String order_status;
+    /**
+     * 备注
+     */
+    private String remark;
+    /**
+     * 支付状态:0=支付中,1=支付成功,2=支付失败
+     */
+    private String pay_status;
+    /**
+     * 付款时间
+     */
+    private String pay_time;
+    /**
+     * 配送类型:1=专业配送,2=到店自取
+     */
+    private String diver_type;
+    /**
+     * 门店id
+     */
+    private Long store_id;
+    /**
+     * 司机id
+     */
+    private Long diver_id;
+    /**
+     * 司机姓名
+     */
+    private String diver_name;
+    /**
+     * 司机电话
+     */
+    private String diver_phone;
+    /**
+     * 删除时间
+     */
+    private String delete_time;
+    /**
+     * 是否隐藏
+     */
+    private int hide=0;
+    /**
+     * 备注
+     */
+    private String note;
+    /**
+     * 确认收货时间
+     */
+    private String confirm_delivery_time;
+    /**
+     * 工厂用户id
+     */
+    private Long factory_user_id;
+    /**
+     * 联系人
+     */
+    private String contact_name;
+}

+ 13 - 0
ruoyi-modules/ruoyi-bulkOrder/src/main/java/org/dromara/bulk/mapper/daHuoDingDanGuanLiMapper.java

@@ -0,0 +1,13 @@
+package org.dromara.bulk.mapper;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import org.apache.ibatis.annotations.Mapper;
+import org.dromara.bulk.domain.bo.daHuoDingDanGuanLiBo;
+import org.dromara.bulk.domain.daHuoDingDanGuanLi;
+import org.dromara.bulk.domain.vo.daHuoDingDanGuanLiVo;
+import org.dromara.common.mybatis.core.mapper.BaseMapperPlus;
+
+@Mapper
+public interface daHuoDingDanGuanLiMapper extends BaseMapperPlus<daHuoDingDanGuanLi, daHuoDingDanGuanLiVo> {
+
+}

+ 11 - 0
ruoyi-modules/ruoyi-bulkOrder/src/main/java/org/dromara/bulk/service/daHuoDingDanGuanLiService.java

@@ -0,0 +1,11 @@
+package org.dromara.bulk.service;
+
+import org.dromara.bulk.domain.bo.daHuoDingDanGuanLiBo;
+import org.dromara.bulk.domain.vo.daHuoDingDanGuanLiVo;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+
+public interface daHuoDingDanGuanLiService {
+    TableDataInfo<daHuoDingDanGuanLiVo> selectPageDaHuoDingDanGuanLiList(daHuoDingDanGuanLiBo daHuoDingDanGuanLiBo, PageQuery pageQuery);
+    int insertDaHuoDingDanGuanLi(daHuoDingDanGuanLiBo daHuoDingDanGuanLiBo);
+}

+ 39 - 0
ruoyi-modules/ruoyi-bulkOrder/src/main/java/org/dromara/bulk/service/impl/daHuoDingDanGuanLiServiceImpl.java

@@ -0,0 +1,39 @@
+package org.dromara.bulk.service.impl;
+
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import lombok.RequiredArgsConstructor;
+import org.dromara.bulk.domain.bo.daHuoDingDanGuanLiBo;
+import org.dromara.bulk.domain.daHuoDingDanGuanLi;
+import org.dromara.bulk.domain.vo.daHuoDingDanGuanLiVo;
+import org.dromara.bulk.mapper.daHuoDingDanGuanLiMapper;
+import org.dromara.bulk.service.daHuoDingDanGuanLiService;
+import org.dromara.common.core.domain.R;
+import org.dromara.common.core.utils.MapstructUtils;
+import org.dromara.common.mybatis.core.page.PageQuery;
+import org.dromara.common.mybatis.core.page.TableDataInfo;
+import org.springframework.stereotype.Service;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.RequestBody;
+
+@RequiredArgsConstructor
+@Service
+public class daHuoDingDanGuanLiServiceImpl implements daHuoDingDanGuanLiService {
+    private final daHuoDingDanGuanLiMapper daHuoDingDanGuanLiMapper;
+    @Override
+    public TableDataInfo <daHuoDingDanGuanLiVo> selectPageDaHuoDingDanGuanLiList(daHuoDingDanGuanLiBo daHuoDingDanGuanLiBo, PageQuery pageQuery) {
+        QueryWrapper<daHuoDingDanGuanLi> queryWrapper = new QueryWrapper<>();
+        queryWrapper.eq(StringUtils.isNotBlank(daHuoDingDanGuanLiBo.getName()),"name", daHuoDingDanGuanLiBo.getName())
+                .eq(StringUtils.isNotBlank(daHuoDingDanGuanLiBo.getPhone()), "phone", daHuoDingDanGuanLiBo.getPhone())
+                .eq(StringUtils.isNotBlank(daHuoDingDanGuanLiBo.getContact_name()), "contact_name", daHuoDingDanGuanLiBo.getContact_name());
+        Page<daHuoDingDanGuanLiVo> page = daHuoDingDanGuanLiMapper.selectVoPage(pageQuery.build(), queryWrapper);
+        return TableDataInfo.build(page);
+    }
+    @Override
+    public int insertDaHuoDingDanGuanLi(@Validated @RequestBody daHuoDingDanGuanLiBo daHuoDingDanGuanLiBo) {
+        daHuoDingDanGuanLi daHuoDingDanGuanLi=MapstructUtils.convert(daHuoDingDanGuanLiBo, daHuoDingDanGuanLi.class);
+
+        return daHuoDingDanGuanLiMapper.insert(daHuoDingDanGuanLi);
+    }
+}

+ 52 - 0
ruoyi-modules/ruoyi-bulkOrder/src/main/resources/mapper/daHuoDingDanGuanLiMapper.xml

@@ -0,0 +1,52 @@
+<?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="org.dromara.bulk.mapper.daHuoDingDanGuanLiMapper">
+
+    <!-- 关联查询 fa_kuyou_user 和 fa_kuyou_user_order 表 -->
+    <select id="selectOrderWithContactName" parameterType="org.dromara.bulk.domain.bo.daHuoDingDanGuanLiBo" resultType="org.dromara.bulk.domain.vo.daHuoDingDanGuanLiVo">
+        SELECT
+        o.id,
+        o.user_id,
+        o.name,
+        o.phone,
+        o.address,
+        o.order_num,
+        o.order_price,
+        o.order_status,
+        o.remark,
+        o.pay_status,
+        o.pay_time,
+        o.diver_type,
+        o.store_id,
+        o.diver_id,
+        o.diver_name,
+        o.diver_phone,
+        o.delete_time,
+        o.hide,
+        o.note,
+        o.confirm_delivery_time,
+        o.factory_user_id,
+        u.contact_name
+        FROM
+        fa_kuyou_user_order o
+        LEFT JOIN
+        fa_kuyou_user u ON o.user_id = u.id
+        <where>
+            <if test="daHuoDingDanGuanLiBo.name != null and daHuoDingDanGuanLiBo.name != ''">
+                AND o.name = #{daHuoDingDanGuanLiBo.name}
+            </if>
+            <if test="daHuoDingDanGuanLiBo.phone != null and daHuoDingDanGuanLiBo.phone != ''">
+                AND o.phone = #{daHuoDingDanGuanLiBo.phone}
+            </if>
+            <if test="daHuoDingDanGuanLiBo.user_id != null">
+                AND o.user_id = #{daHuoDingDanGuanLiBo.user_id}
+            </if>
+            <if test="daHuoDingDanGuanLiBo.contact_name != null and daHuoDingDanGuanLiBo.contact_name != ''">
+                and u.contact_name = #{daHuoDingDanGuanLiBo.contact_name}
+            </if>
+        </where>
+    </select>
+
+</mapper>