Bläddra i källkod

消息通知配置与商家认证

(cherry picked from commit 87d41a59f0180db1cdda6aa4da778128b83290ba)
liude 1 år sedan
förälder
incheckning
6f00077758

+ 8 - 0
vehicle-api/src/main/java/com/chelvc/cloud/vehicle/api/service/IOmsOrderService.java

@@ -65,6 +65,14 @@ public interface IOmsOrderService
      */
      */
     Pagination<OmsOrderDTO> getOrderPaging(OrderPagingParam param);
     Pagination<OmsOrderDTO> getOrderPaging(OrderPagingParam param);
 
 
+    /**
+     * 分页查询订单
+     *
+     * @param param 查询参数
+     * @return 订单分页信息
+     */
+    Pagination<OmsOrderDTO> getOmsOrderPaging(OrderPagingParam param);
+
     /**
     /**
      * 根据订单ID获取订单详情
      * 根据订单ID获取订单详情
      */
      */

+ 38 - 0
vehicle-api/src/main/java/com/chelvc/cloud/vehicle/api/service/MerchantAuthService.java

@@ -0,0 +1,38 @@
+package com.chelvc.cloud.vehicle.api.service;
+import com.chelvc.cloud.vehicle.api.dto.MerchantAuthDTO;
+import com.chelvc.cloud.vehicle.api.param.MerchantAuthModifyParam;
+import com.chelvc.cloud.vehicle.api.param.MerchantAuthPagingParam;
+import com.chelvc.framework.common.model.Pagination;
+
+/**
+ * 商家认证业务接口
+ *
+ * @author liude
+ * @data 2023/12/7
+ */
+public interface MerchantAuthService {
+
+    /**
+     * 新增商家认证
+     *
+     * @param param 新增参数
+     * @return 主键
+     */
+    Long addMerchantAuth(MerchantAuthModifyParam param);
+
+    /**
+     * 修改商家认证
+     *
+     * @param id    主键
+     * @param param 修改参数
+     */
+    void updateMerchantAuth(Long id, MerchantAuthModifyParam param);
+
+    /**
+     * 查询商家认证
+     *
+     * @param param 查询参数
+     * @return 商家认证分页信息
+     */
+    Pagination<MerchantAuthDTO> getMerchantAuthPaging(MerchantAuthPagingParam param);
+}

+ 38 - 0
vehicle-api/src/main/java/com/chelvc/cloud/vehicle/api/service/NoticeService.java

@@ -0,0 +1,38 @@
+package com.chelvc.cloud.vehicle.api.service;
+import com.chelvc.cloud.vehicle.api.dto.NoticeDTO;
+import com.chelvc.cloud.vehicle.api.param.NoticeModifyParam;
+import com.chelvc.cloud.vehicle.api.param.NoticePagingParam;
+import com.chelvc.framework.common.model.Pagination;
+
+/**
+ * 通知配置业务接口
+ *
+ * @author liude
+ * @data 2023/12/7
+ */
+public interface NoticeService {
+
+    /**
+     * 新增通知
+     *
+     * @param param 新增参数
+     * @return 主键
+     */
+    Long addNotice(NoticeModifyParam param);
+
+    /**
+     * 修改通知
+     *
+     * @param id    主键
+     * @param param 修改参数
+     */
+    void updateNotice(Long id, NoticeModifyParam param);
+
+    /**
+     * 查询通知
+     *
+     * @param param 查询参数
+     * @return 通知分页信息
+     */
+    Pagination<NoticeDTO> getNoticePaging(NoticePagingParam param);
+}

+ 13 - 0
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/MerchantAuthService.java

@@ -0,0 +1,13 @@
+package com.chelvc.cloud.vehicle.server.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.chelvc.cloud.vehicle.server.entity.MerchantAuth;
+
+/**
+ * 商家认证业务操作接口
+ *
+ * @author liude
+ * @date 2023/12/5
+ */
+public interface MerchantAuthService extends IService<MerchantAuth> {
+}

+ 13 - 0
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/NoticeService.java

@@ -0,0 +1,13 @@
+package com.chelvc.cloud.vehicle.server.service;
+
+import com.baomidou.mybatisplus.extension.service.IService;
+import com.chelvc.cloud.vehicle.server.entity.Notice;
+
+/**
+ * 通知配置业务操作接口
+ *
+ * @author liude
+ * @date 2023/12/5
+ */
+public interface NoticeService extends IService<Notice> {
+}

+ 61 - 0
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/MerchantAuthServiceImpl.java

@@ -0,0 +1,61 @@
+package com.chelvc.cloud.vehicle.server.service.impl;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.chelvc.cloud.vehicle.api.dto.MerchantAuthDTO;
+import com.chelvc.cloud.vehicle.api.dto.NoticeDTO;
+import com.chelvc.cloud.vehicle.api.param.MerchantAuthModifyParam;
+import com.chelvc.cloud.vehicle.api.param.MerchantAuthPagingParam;
+import com.chelvc.cloud.vehicle.api.param.NoticeModifyParam;
+import com.chelvc.cloud.vehicle.api.param.NoticePagingParam;
+import com.chelvc.cloud.vehicle.server.copier.MerchantAuthCopier;
+import com.chelvc.cloud.vehicle.server.copier.NoticeCopier;
+import com.chelvc.cloud.vehicle.server.dao.MerchantAuthMapper;
+import com.chelvc.cloud.vehicle.server.dao.NoticeMapper;
+import com.chelvc.cloud.vehicle.server.entity.MerchantAuth;
+import com.chelvc.cloud.vehicle.server.entity.Notice;
+import com.chelvc.cloud.vehicle.server.service.MerchantAuthService;
+import com.chelvc.cloud.vehicle.server.service.NoticeService;
+import com.chelvc.framework.base.context.SessionContextHolder;
+import com.chelvc.framework.base.util.ResourceUtils;
+import com.chelvc.framework.common.model.Pagination;
+import com.chelvc.framework.common.util.StringUtils;
+import com.chelvc.framework.database.util.PagingUtils;
+import lombok.NonNull;
+import lombok.RequiredArgsConstructor;
+import org.apache.dubbo.config.annotation.DubboService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * 通知配置业务操作实现
+ *
+ * @author liude
+ * @date 2023/12/2
+ */
+@RequiredArgsConstructor(onConstructor = @__(@Autowired))
+@DubboService(interfaceClass = com.chelvc.cloud.vehicle.api.service.MerchantAuthService.class)
+public class MerchantAuthServiceImpl extends ServiceImpl<MerchantAuthMapper, MerchantAuth> implements MerchantAuthService,
+        com.chelvc.cloud.vehicle.api.service.MerchantAuthService {
+    @Override
+    public Long addMerchantAuth(MerchantAuthModifyParam param){
+        MerchantAuth merchantAuth = MerchantAuthCopier.INSTANCE.copying(param);
+        Long userId = SessionContextHolder.getId();
+        this.save(merchantAuth);
+        return merchantAuth.getId();
+    }
+
+    @Override
+    public void updateMerchantAuth(@NonNull Long id, @NonNull MerchantAuthModifyParam param) {
+        MerchantAuth merchantAuth = ResourceUtils.required(this.getById(id), "商家认证不存在");
+        MerchantAuthCopier.INSTANCE.copying(param, merchantAuth);
+        this.updateById(merchantAuth);
+    }
+
+    @Override
+    public Pagination<MerchantAuthDTO> getMerchantAuthPaging(@NonNull MerchantAuthPagingParam param) {
+        Page<MerchantAuth> page = this.lambdaQuery()
+                .like(StringUtils.nonEmpty(param.getStoreName()), MerchantAuth::getStoreName, param.getStoreName())
+                .orderByAsc(MerchantAuth::getReviewTime).page(PagingUtils.convert(param.getPaging()));
+        return PagingUtils.convert(page, MerchantAuthCopier.INSTANCE::copying);
+    }
+}

+ 57 - 0
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/NoticeServiceImpl.java

@@ -0,0 +1,57 @@
+package com.chelvc.cloud.vehicle.server.service.impl;
+
+import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
+import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
+import com.chelvc.cloud.vehicle.api.dto.NoticeDTO;
+import com.chelvc.cloud.vehicle.api.param.NoticeModifyParam;
+import com.chelvc.cloud.vehicle.api.param.NoticePagingParam;
+import com.chelvc.cloud.vehicle.server.copier.NoticeCopier;
+import com.chelvc.cloud.vehicle.server.dao.NoticeMapper;
+import com.chelvc.cloud.vehicle.server.entity.Notice;
+import com.chelvc.cloud.vehicle.server.service.NoticeService;
+import com.chelvc.framework.base.context.SessionContextHolder;
+import com.chelvc.framework.base.util.ResourceUtils;
+import com.chelvc.framework.common.model.Pagination;
+import com.chelvc.framework.common.util.StringUtils;
+import com.chelvc.framework.database.util.PagingUtils;
+import lombok.NonNull;
+import lombok.RequiredArgsConstructor;
+import org.apache.dubbo.config.annotation.DubboService;
+import org.springframework.beans.factory.annotation.Autowired;
+
+/**
+ * 通知配置业务操作实现
+ *
+ * @author liude
+ * @date 2023/12/2
+ */
+@RequiredArgsConstructor(onConstructor = @__(@Autowired))
+@DubboService(interfaceClass = com.chelvc.cloud.vehicle.api.service.NoticeService.class)
+public class NoticeServiceImpl extends ServiceImpl<NoticeMapper, Notice> implements NoticeService,
+        com.chelvc.cloud.vehicle.api.service.NoticeService {
+    @Override
+    public Long addNotice(NoticeModifyParam param){
+        Notice notice = NoticeCopier.INSTANCE.copying(param);
+        Long userId = SessionContextHolder.getId();
+        notice.setCreator(userId.toString());
+        notice.setUpdater(userId.toString());
+        notice.setStatus("1");
+        this.save(notice);
+        return notice.getId();
+    }
+
+    @Override
+    public void updateNotice(@NonNull Long id, @NonNull NoticeModifyParam param) {
+        Notice notice = ResourceUtils.required(this.getById(id), "通知配置不存在");
+        NoticeCopier.INSTANCE.copying(param, notice);
+        this.updateById(notice);
+    }
+
+    @Override
+    public Pagination<NoticeDTO> getNoticePaging(@NonNull NoticePagingParam param) {
+        Page<Notice> page = this.lambdaQuery()
+                .like(StringUtils.nonEmpty(param.getTitle()), Notice::getTitle, param.getTitle())
+                .orderByAsc(Notice::getStatus).page(PagingUtils.convert(param.getPaging()));
+        return PagingUtils.convert(page, NoticeCopier.INSTANCE::copying);
+    }
+}

+ 9 - 0
vehicle-server/src/main/java/com/chelvc/cloud/vehicle/server/service/impl/OmsOrderServiceImpl.java

@@ -352,6 +352,15 @@ public class OmsOrderServiceImpl extends ServiceImpl<OmsOrderMapper, OmsOrder> i
        return PagingUtils.convert(page, OrderCopier.INSTANCE::copying);
        return PagingUtils.convert(page, OrderCopier.INSTANCE::copying);
     }
     }
 
 
+    @Override
+    public Pagination<OmsOrderDTO> getOmsOrderPaging(OrderPagingParam param){
+        Page<OmsOrder> page = this.lambdaQuery()
+                .eq(OmsOrder :: getStatus,param.getStatus())
+                .orderByDesc(OmsOrder :: getCreateTime)
+                .page(PagingUtils.convert(param.getPaging()));
+        return PagingUtils.convert(page, OrderCopier.INSTANCE::copying);
+    }
+
     @Override
     @Override
     public OmsOrderDetailDTO detail(Long orderId) {
     public OmsOrderDetailDTO detail(Long orderId) {
         OmsOrder omsOrder = this.baseMapper.selectOmsOrderById(orderId);
         OmsOrder omsOrder = this.baseMapper.selectOmsOrderById(orderId);