Huanyi 1 mesiac pred
rodič
commit
2534c2ae7b
23 zmenil súbory, kde vykonal 215 pridanie a 25 odobranie
  1. 2 0
      ruoyi-api/yingpaipay-api-fulfiller/src/main/java/org/dromara/fulfiller/api/RemoteFulfillerService.java
  2. 6 0
      ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/CacheNames.java
  3. 5 0
      ruoyi-common/ruoyi-common-translation/pom.xml
  4. 6 0
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/constant/TransConstant.java
  5. 27 0
      ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/FulfillerNameTranslationImpl.java
  6. 1 0
      ruoyi-common/ruoyi-common-translation/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports
  7. 2 0
      ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/domain/vo/FlfFulfillerOnOrderVo.java
  8. 11 0
      ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/dubbo/RemoteFulfillerServiceImpl.java
  9. 3 1
      ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/service/impl/FlfAnamalyServiceImpl.java
  10. 12 1
      ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/service/impl/FlfFulfillerServiceImpl.java
  11. 5 0
      ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/controller/SysSubOrderController.java
  12. 1 1
      ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/domain/bo/SysSubOrderClockInBo.java
  13. 12 0
      ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/domain/bo/SysSubOrderRejectBo.java
  14. 4 0
      ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/domain/vo/SysSubOrderListOnMyOrderPageVo.java
  15. 6 0
      ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/domain/vo/SysSubOrderVo.java
  16. 2 0
      ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/dubbo/RemoteSubOrderServiceImpl.java
  17. 3 1
      ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/enums/OrderLogFulfillerStepEnum.java
  18. 2 0
      ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/service/ISysSubOrderService.java
  19. 91 11
      ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/service/impl/SysSubOrderServiceImpl.java
  20. 2 2
      ruoyi-modules/yingpaipay-service/src/main/java/org/dromara/service/controller/SysServiceController.java
  21. 4 2
      ruoyi-modules/yingpaipay-service/src/main/java/org/dromara/service/enums/ServiceModeEnum.java
  22. 2 2
      ruoyi-modules/yingpaipay-service/src/main/java/org/dromara/service/service/ISysServiceService.java
  23. 6 4
      ruoyi-modules/yingpaipay-service/src/main/java/org/dromara/service/service/impl/SysServiceServiceImpl.java

+ 2 - 0
ruoyi-api/yingpaipay-api-fulfiller/src/main/java/org/dromara/fulfiller/api/RemoteFulfillerService.java

@@ -34,4 +34,6 @@ public interface RemoteFulfillerService {
     List<RemoteFulfillerVo> getByIds(List<Long> fulfillerIds);
 
     boolean settlement(Long fulfiller, Long price, String orderCode);
+
+    String getNameById(Long id);
 }

+ 6 - 0
ruoyi-common/ruoyi-common-core/src/main/java/org/dromara/common/core/constant/CacheNames.java

@@ -121,4 +121,10 @@ public interface CacheNames {
      * @Author: Huanyi
      */
     String SYS_SERVICE = "sys_service#30d";
+
+    /**
+     * 履约者名称
+     * @Author: Huanyi
+     */
+    String FLF_FULFILLER_NAME = "flf_fulfiller_name#30d";
 }

+ 5 - 0
ruoyi-common/ruoyi-common-translation/pom.xml

@@ -47,6 +47,11 @@
             <artifactId>yingpaipay-api-order</artifactId>
         </dependency>
 
+        <dependency>
+            <groupId>org.dromara</groupId>
+            <artifactId>yingpaipay-api-fulfiller</artifactId>
+        </dependency>
+
     </dependencies>
 
 </project>

+ 6 - 0
ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/constant/TransConstant.java

@@ -68,4 +68,10 @@ public interface TransConstant {
      * @Author: Huanyi
      */
     String ORDER_ID_TO_CODE = "order_id_to_code";
+
+    /**
+     * 履约者ID转名称
+     * @Author: Huanyi
+     */
+    String FULFILLER_ID_TO_NAME = "fulfiller_id_to_name";
 }

+ 27 - 0
ruoyi-common/ruoyi-common-translation/src/main/java/org/dromara/common/translation/core/impl/FulfillerNameTranslationImpl.java

@@ -0,0 +1,27 @@
+package org.dromara.common.translation.core.impl;
+
+import cn.hutool.core.convert.Convert;
+import lombok.AllArgsConstructor;
+import org.apache.dubbo.config.annotation.DubboReference;
+import org.dromara.common.translation.annotation.TranslationType;
+import org.dromara.common.translation.constant.TransConstant;
+import org.dromara.common.translation.core.TranslationInterface;
+import org.dromara.fulfiller.api.RemoteFulfillerService;
+
+/**
+ * 履约者ID翻译为名称
+ * @Author: Huanyi
+ */
+
+@AllArgsConstructor
+@TranslationType(type = TransConstant.FULFILLER_ID_TO_NAME)
+public class FulfillerNameTranslationImpl implements TranslationInterface<String> {
+
+    @DubboReference
+    private final RemoteFulfillerService remoteFulfillerService;
+
+    @Override
+    public String translation(Object key, String other) {
+        return remoteFulfillerService.getNameById(Convert.toLong(key));
+    }
+}

+ 1 - 0
ruoyi-common/ruoyi-common-translation/src/main/resources/META-INF/spring/org.springframework.boot.autoconfigure.AutoConfiguration.imports

@@ -10,3 +10,4 @@ org.dromara.common.translation.core.impl.TenantCatergoriesNameTranslationImpl
 org.dromara.common.translation.core.impl.CustomerNameTranslationImpl
 org.dromara.common.translation.core.impl.OrderCodeTranslationImpl
 org.dromara.common.translation.core.impl.StoreNameTranslationImpl
+org.dromara.common.translation.core.impl.FulfillerNameTranslationImpl

+ 2 - 0
ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/domain/vo/FlfFulfillerOnOrderVo.java

@@ -29,4 +29,6 @@ public class FlfFulfillerOnOrderVo implements Serializable {
 
     private Date nextOrderTime;
 
+    private String gender;
+
 }

+ 11 - 0
ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/dubbo/RemoteFulfillerServiceImpl.java

@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
 import lombok.RequiredArgsConstructor;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboService;
+import org.dromara.common.core.constant.CacheNames;
 import org.dromara.common.core.exception.ServiceException;
 import org.dromara.common.core.exception.user.UserException;
 import org.dromara.common.tenant.helper.TenantHelper;
@@ -14,6 +15,7 @@ import org.dromara.fulfiller.domain.FlfBalanceLog;
 import org.dromara.fulfiller.domain.FlfFulfiller;
 import org.dromara.fulfiller.mapper.FlfBalanceLogMapper;
 import org.dromara.fulfiller.mapper.FlfFulfillerMapper;
+import org.springframework.cache.annotation.Cacheable;
 import org.springframework.stereotype.Service;
 
 import java.util.ArrayList;
@@ -123,6 +125,15 @@ public class RemoteFulfillerServiceImpl implements RemoteFulfillerService {
         return true;
     }
 
+    @Cacheable(cacheNames = CacheNames.FLF_FULFILLER_NAME, key = "#id")
+    @Override
+    public String getNameById(Long id) {
+        return fulfillerMapper.selectOne(
+            Wrappers.lambdaQuery(FlfFulfiller.class).select(FlfFulfiller::getName)
+                .eq(FlfFulfiller::getId, id)
+        ).getName();
+    }
+
     /**
      * 手动转换 FlfFulfiller → FulfillerLoginUser(避免跨模块 MapStruct 转换器缺失)
      */

+ 3 - 1
ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/service/impl/FlfAnamalyServiceImpl.java

@@ -211,7 +211,9 @@ public class FlfAnamalyServiceImpl implements IFlfAnamalyService {
             vo.setId(anamaly.getId());
             vo.setType(anamaly.getType());
             vo.setContent(anamaly.getContent());
-            vo.setPhotos(Arrays.stream(anamaly.getPhotos().split(",")).map(Long::valueOf).map(e -> photoMap.get(e).getUrl()).toList());
+            if (StringUtils.isNotBlank(anamaly.getPhotos())) {
+                vo.setPhotos(Arrays.stream(anamaly.getPhotos().split(",")).map(Long::valueOf).map(e -> photoMap.get(e).getUrl()).toList());
+            }
             vo.setFulfiller(anamaly.getFulfiller());
             FlfFulfiller fulfiller = fulfillerMap.get(anamaly.getFulfiller());
             if (fulfiller != null) {

+ 12 - 1
ruoyi-modules/yingpaipay-fulfiller/src/main/java/org/dromara/fulfiller/service/impl/FlfFulfillerServiceImpl.java

@@ -1,5 +1,6 @@
 package org.dromara.fulfiller.service.impl;
 
+import org.dromara.common.core.constant.CacheNames;
 import org.dromara.common.core.exception.ServiceException;
 import org.dromara.common.core.utils.MapstructUtils;
 import org.dromara.common.core.utils.StringUtils;
@@ -14,6 +15,7 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.dubbo.config.annotation.DubboReference;
 import org.dromara.common.mybatis.helper.DataBaseHelper;
 import org.dromara.common.mybatis.utils.WrapperUtils;
+import org.dromara.common.redis.utils.CacheUtils;
 import org.dromara.common.satoken.utils.LoginHelper;
 import org.dromara.fulfiller.constants.TagTargetConstants;
 import org.dromara.fulfiller.domain.vo.FlfFulfillerOnOrderVo;
@@ -148,6 +150,9 @@ public class FlfFulfillerServiceImpl implements IFlfFulfillerService {
             bo.setId(add.getId());
             saveTagRels(add.getId(), bo.getTagIds(), TagTargetConstants.FULFILLER);
         }
+
+        CacheUtils.put(CacheNames.FLF_FULFILLER_NAME, add.getId(), add.getName());
+
         return flag;
     }
 
@@ -160,6 +165,9 @@ public class FlfFulfillerServiceImpl implements IFlfFulfillerService {
         if (flag) {
             saveTagRels(bo.getId(), bo.getTagIds(), TagTargetConstants.FULFILLER);
         }
+
+        CacheUtils.put(CacheNames.FLF_FULFILLER_NAME, update.getId(), update.getName());
+
         return flag;
     }
 
@@ -499,6 +507,7 @@ public class FlfFulfillerServiceImpl implements IFlfFulfillerService {
         if (fulfiller == null) {
             return false;
         }
+        CacheUtils.evict(CacheNames.FLF_FULFILLER_NAME, userId);
         // 逻辑删除履约者信息
         return baseMapper.deleteById(fulfiller.getId()) > 0;
     }
@@ -563,7 +572,7 @@ public class FlfFulfillerServiceImpl implements IFlfFulfillerService {
         Page<FlfFulfiller> page = baseMapper.selectPage(
             pageQuery.build(),
             Wrappers.lambdaQuery(FlfFulfiller.class)
-                .select(FlfFulfiller::getId, FlfFulfiller::getAvatar, FlfFulfiller::getPhone, FlfFulfiller::getName, FlfFulfiller::getStatus, FlfFulfiller::getServiceTypes)
+                .select(FlfFulfiller::getId, FlfFulfiller::getAvatar, FlfFulfiller::getPhone, FlfFulfiller::getName, FlfFulfiller::getStatus, FlfFulfiller::getServiceTypes, FlfFulfiller::getGender)
                 .orderByDesc(FlfFulfiller::getId)
                 .and(StringUtils.isNotBlank(content), wrapper -> wrapper
                     .like(FlfFulfiller::getName, content).or().like(FlfFulfiller::getPhone, content)
@@ -605,6 +614,7 @@ public class FlfFulfillerServiceImpl implements IFlfFulfillerService {
             vo.setServiceTypes(e.getServiceTypes());
             List<RemoteSubOrderVo> orders = orderMap.get(e.getId());
             vo.setNextOrderTime(orders != null && !orders.isEmpty() ? orders.get(0).getServiceTime() : null);
+            vo.setGender(e.getGender());
             return vo;
         }));
     }
@@ -693,6 +703,7 @@ public class FlfFulfillerServiceImpl implements IFlfFulfillerService {
             vo.setStatus(e.getStatus());
             vo.setServiceTypes(e.getServiceTypes());
             vo.setNextOrderTime(new Date());
+            vo.setGender(e.getGender());
             vos.add(vo);
         });
 

+ 5 - 0
ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/controller/SysSubOrderController.java

@@ -95,4 +95,9 @@ public class SysSubOrderController extends BaseController {
         return R.ok(subOrderService.listOnDispatch(service, site));
     }
 
+    @PutMapping("/reject")
+    public R<Void> reject(@RequestBody SysSubOrderRejectBo bo) {
+        return toAjax(subOrderService.reject(bo));
+    }
+
 }

+ 1 - 1
ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/domain/bo/SysSubOrderClockInBo.java

@@ -19,6 +19,6 @@ public class SysSubOrderClockInBo {
 
     private Boolean startFlag;
 
-    private Boolean finalFlag;
+    private Boolean endFlag;
 
 }

+ 12 - 0
ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/domain/bo/SysSubOrderRejectBo.java

@@ -0,0 +1,12 @@
+package org.dromara.order.domain.bo;
+
+import lombok.Data;
+
+@Data
+public class SysSubOrderRejectBo {
+
+    private Long orderId;
+
+    private String rejectReason;
+
+}

+ 4 - 0
ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/domain/vo/SysSubOrderListOnMyOrderPageVo.java

@@ -24,6 +24,8 @@ public class SysSubOrderListOnMyOrderPageVo implements Serializable {
 
     private String petName;
 
+    private String petAvatar;
+
     private String breed;
 
     private Long store;
@@ -50,4 +52,6 @@ public class SysSubOrderListOnMyOrderPageVo implements Serializable {
 
     private String remark;
 
+    private Integer status;
+
 }

+ 6 - 0
ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/domain/vo/SysSubOrderVo.java

@@ -120,6 +120,8 @@ public class SysSubOrderVo implements Serializable {
      * 履约者
      */
     @ExcelProperty(value = "履约者")
+    @Translation(type = TransConstant.FULFILLER_ID_TO_NAME, mapper = "fulfiller")
+    private String fulfillerName;
     private Long fulfiller;
 
     /**
@@ -141,4 +143,8 @@ public class SysSubOrderVo implements Serializable {
 
     private Long usrCustomer;
 
+    private Long service;
+
+    private String nursingSummary;
+
 }

+ 2 - 0
ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/dubbo/RemoteSubOrderServiceImpl.java

@@ -6,6 +6,7 @@ import org.apache.dubbo.config.annotation.DubboService;
 import org.dromara.order.api.RemoteSubOrderService;
 import org.dromara.order.api.domain.vo.RemoteSubOrderVo;
 import org.dromara.order.domain.SysSubOrder;
+import org.dromara.order.enums.OrderStatusEnum;
 import org.dromara.order.mapper.SysSubOrderMapper;
 import org.springframework.stereotype.Service;
 
@@ -90,6 +91,7 @@ public class RemoteSubOrderServiceImpl implements RemoteSubOrderService {
             Wrappers.lambdaQuery(SysSubOrder.class)
                 .select(SysSubOrder::getFulfiller, SysSubOrder::getServiceTime)
                 .in(SysSubOrder::getFulfiller, fulfillerIds)
+                .in(SysSubOrder::getStatus, List.of(OrderStatusEnum.PENDING_SERVICE.getValue()))
                 .orderByAsc(SysSubOrder::getServiceTime)
         ).forEach(e -> {
             RemoteSubOrderVo vo = new RemoteSubOrderVo();

+ 3 - 1
ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/enums/OrderLogFulfillerStepEnum.java

@@ -8,9 +8,11 @@ import lombok.Getter;
 @AllArgsConstructor(access = AccessLevel.PRIVATE)
 public enum OrderLogFulfillerStepEnum {
 
+    REJECT(-1, "已拒绝", "履约者 %s 已确认接单,准备前往服务地点"),
     RECIEVED(0, "已接单", "履约者 %s 已确认接单,准备前往服务地点"),
+    COMPLETED(99, "订单完成", "用户/商家已确认,服务圆满结束"),
     ;
-    private final Integer value;
+    private final Integer step;
     private final String title;
     private final String content;
 

+ 2 - 0
ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/service/ISysSubOrderService.java

@@ -35,4 +35,6 @@ public interface ISysSubOrderService {
     boolean nursingSummary(SysSubOrderNursingSummaryBo bo);
 
     List<SysSubOrderOnDispatchVo> listOnDispatch(Long service, Long site);
+
+    boolean reject(SysSubOrderRejectBo bo);
 }

+ 91 - 11
ruoyi-modules/yingpaipay-order/src/main/java/org/dromara/order/service/impl/SysSubOrderServiceImpl.java

@@ -371,7 +371,7 @@ public class SysSubOrderServiceImpl implements ISysSubOrderService {
         fulfillerLog.setActioner(LoginHelper.getUserId());
         fulfillerLog.setActionerType(OrderLogActionerTypeEnum.FULFILLER.getValue());
         fulfillerLog.setLogType(OrderLogTypeEnum.FULFILLER.getValue());
-        fulfillerLog.setStep(OrderLogFulfillerStepEnum.RECIEVED.getValue());
+        fulfillerLog.setStep(OrderLogFulfillerStepEnum.RECIEVED.getStep());
         fulfillerLog.setTitle(OrderLogFulfillerStepEnum.RECIEVED.getTitle());
         fulfillerLog.setContent(String.format(OrderLogFulfillerStepEnum.RECIEVED.getContent(), LoginHelper.getLoginUser().getNickname()));
         fulfillerLog.setTenantId(subOrder.getTenantId());
@@ -403,11 +403,14 @@ public class SysSubOrderServiceImpl implements ISysSubOrderService {
         return vo;
     }
 
-    @Transactional(rollbackFor = Exception.class)
+    @GlobalTransactional(rollbackFor = Exception.class)
     @Override
     public boolean clockIn(SysSubOrderClockInBo bo) {
 
+        List<SysSubOrderLog> logs = new ArrayList<>();
+
         SysSubOrder subOrder = baseMapper.selectById(bo.getOrderId());
+
         if (bo.getStartFlag()) {
             subOrder.setStatus(OrderStatusEnum.IN_SERVICE.getValue());
             boolean flag = baseMapper.updateById(subOrder) == 0;
@@ -415,12 +418,18 @@ public class SysSubOrderServiceImpl implements ISysSubOrderService {
                 throw new RuntimeException("修改订单状态失败");
             }
 
-        } else if (bo.getFinalFlag()) {
-            subOrder.setStatus(OrderStatusEnum.COMPLETED.getValue());
-            boolean flag = baseMapper.updateById(subOrder) == 0;
-            if (flag) {
-                throw new RuntimeException("修改订单状态失败");
-            }
+            SysSubOrderLog startSysLog = new SysSubOrderLog();
+            startSysLog.setSubOrderId(subOrder.getId());
+            startSysLog.setActioner(LoginHelper.getUserId());
+            startSysLog.setActionerType(OrderLogActionerTypeEnum.SYS_USER.getValue());
+            startSysLog.setLogType(OrderLogTypeEnum.ORDER.getValue());
+            OrderLogSystemStepEnum step = OrderLogSystemStepEnum.ARRIVED;
+            startSysLog.setStep(step.getStep());
+            startSysLog.setTitle(step.getTitle());
+            startSysLog.setContent(step.getContent());
+            startSysLog.setTenantId(subOrder.getTenantId());
+            logs.add(startSysLog);
+
         }
 
         SysSubOrderLog log = new SysSubOrderLog();
@@ -433,11 +442,51 @@ public class SysSubOrderServiceImpl implements ISysSubOrderService {
         log.setContent(bo.getContent());
         log.setPhotos(bo.getPhotos().stream().map(String::valueOf).collect(Collectors.joining(",")));
         log.setTenantId(subOrder.getTenantId());
-        boolean flag = subOrderLogMapper.insert(log) == 0;
-        if (flag) {
+        logs.add(log);
+
+        if (bo.getEndFlag()) {
+            subOrder.setStatus(OrderStatusEnum.COMPLETED.getValue());
+            boolean flag = baseMapper.updateById(subOrder) == 0;
+            if (flag) {
+                throw new RuntimeException("修改订单状态失败");
+            }
+
+            SysSubOrderLog endFlfLog = new SysSubOrderLog();
+            endFlfLog.setSubOrderId(subOrder.getId());
+            endFlfLog.setActioner(LoginHelper.getUserId());
+            endFlfLog.setActionerType(OrderLogActionerTypeEnum.FULFILLER.getValue());
+            endFlfLog.setLogType(OrderLogTypeEnum.FULFILLER.getValue());
+            OrderLogFulfillerStepEnum flfStep = OrderLogFulfillerStepEnum.COMPLETED;
+            endFlfLog.setStep(flfStep.getStep());
+            endFlfLog.setTitle(flfStep.getTitle());
+            endFlfLog.setContent(flfStep.getContent());
+            endFlfLog.setTenantId(subOrder.getTenantId());
+            logs.add(endFlfLog);
+
+            SysSubOrderLog endSysLog = new SysSubOrderLog();
+            endSysLog.setSubOrderId(subOrder.getId());
+            endSysLog.setActioner(LoginHelper.getUserId());
+            endSysLog.setActionerType(OrderLogActionerTypeEnum.FULFILLER.getValue());
+            endSysLog.setLogType(OrderLogTypeEnum.FULFILLER.getValue());
+            OrderLogSystemStepEnum sysStep = OrderLogSystemStepEnum.FINISH;
+            endSysLog.setStep(sysStep.getStep());
+            endSysLog.setTitle(sysStep.getTitle());
+            endSysLog.setContent(sysStep.getContent());
+            endSysLog.setTenantId(subOrder.getTenantId());
+            logs.add(endSysLog);
+
+        }
+        boolean flag = subOrderLogMapper.insertBatch(logs);
+        if (!flag) {
             throw new RuntimeException("记录服务进度失败");
         }
 
+        // 履约者拿到佣金
+        boolean fulfillerFlag = remoteFulfillerService.settlement(subOrder.getFulfiller(), subOrder.getPrice(), subOrder.getCode());
+        if (!fulfillerFlag) {
+            throw new RuntimeException("履约者新增佣金失败");
+        }
+
         return true;
     }
 
@@ -446,6 +495,7 @@ public class SysSubOrderServiceImpl implements ISysSubOrderService {
 
         LambdaQueryWrapper<SysSubOrder> wrapper = Wrappers.lambdaQuery(SysSubOrder.class)
             .eq(SysSubOrder::getStatus, bo.getStatus())
+            .eq(bo.getService() != null, SysSubOrder::getService, bo.getService())
             .ge(bo.getStartServiceTime() != null, SysSubOrder::getServiceTime, bo.getStartServiceTime())
             .le(bo.getEndServiceTime() != null, SysSubOrder::getServiceTime, bo.getEndServiceTime())
             .orderByDesc(SysSubOrder::getId);
@@ -488,13 +538,14 @@ public class SysSubOrderServiceImpl implements ISysSubOrderService {
             RemoteCustomerVo customer = customerMap.get(e.getUsrCustomer());
             if (customer != null) {
                 vo.setCustomerName(customer.getName());
-                vo.setCustomerPhone(customer.getAddress());
+                vo.setCustomerPhone(customer.getPhone());
             }
             vo.setFromCode(e.getFromCode());
             vo.setFromAddress(e.getFromAddress());
             vo.setToCode(e.getToCode());
             vo.setToAddress(e.getToAddress());
             vo.setRemark(e.getRemark());
+            vo.setStatus(e.getStatus());
             return vo;
         }));
     }
@@ -583,4 +634,33 @@ public class SysSubOrderServiceImpl implements ISysSubOrderService {
 
         return vos;
     }
+
+    @Transactional(rollbackFor = Exception.class)
+    @Override
+    public boolean reject(SysSubOrderRejectBo bo) {
+
+        SysSubOrder subOrder = baseMapper.selectById(bo.getOrderId());
+        subOrder.setStatus(OrderStatusEnum.CANCELLED.getValue());
+        boolean orderFlag = baseMapper.updateById(subOrder) == 0;
+        if (orderFlag) {
+            throw new RuntimeException("修改订单状态失败");
+        }
+
+        SysSubOrderLog log = new SysSubOrderLog();
+        log.setSubOrderId(subOrder.getId());
+        log.setActioner(LoginHelper.getUserId());
+        log.setActionerType(OrderLogActionerTypeEnum.FULFILLER.getValue());
+        log.setLogType(OrderLogTypeEnum.FULFILLER.getValue());
+        OrderLogFulfillerStepEnum step = OrderLogFulfillerStepEnum.REJECT;
+        log.setStep(step.getStep());
+        log.setTitle(step.getTitle());
+        log.setContent(bo.getRejectReason());
+        log.setTenantId(subOrder.getTenantId());
+        boolean logFlag = subOrderLogMapper.insert(log) == 0;
+        if (logFlag) {
+            throw new RuntimeException("日志新增失败");
+        }
+
+        return true;
+    }
 }

+ 2 - 2
ruoyi-modules/yingpaipay-service/src/main/java/org/dromara/service/controller/SysServiceController.java

@@ -77,7 +77,7 @@ public class SysServiceController extends BaseController {
     @RepeatSubmit()
     @PostMapping()
     public R<Void> add(@Validated(AddGroup.class) @RequestBody SysServiceBo bo) {
-        return toAjax(sysServiceService.insertByBo(bo));
+        return toAjax(sysServiceService.insertByBo(bo) != null);
     }
 
     /**
@@ -88,7 +88,7 @@ public class SysServiceController extends BaseController {
     @RepeatSubmit()
     @PutMapping()
     public R<Void> edit(@Validated(EditGroup.class) @RequestBody SysServiceBo bo) {
-        return toAjax(sysServiceService.updateByBo(bo));
+        return toAjax(sysServiceService.updateByBo(bo) != null);
     }
 
     /**

+ 4 - 2
ruoyi-modules/yingpaipay-service/src/main/java/org/dromara/service/enums/ServiceModeEnum.java

@@ -11,8 +11,10 @@ import java.util.List;
 @AllArgsConstructor(access = AccessLevel.PRIVATE)
 public enum ServiceModeEnum {
 
-    ONEWAY_SINGLETRIP(0, "单程/单次"),
-    ROUNDTRIP_RETURNTRIP(1, "往返/双程"),
+//    ONEWAY_SINGLETRIP(0, "单程/单次"),
+    SERVICE(0, "服务订单"),
+//    ROUNDTRIP_RETURNTRIP(1, "往返/双程"),
+    PICK_UP(1, "接送订单"),
     ;
 
     private final Integer value;

+ 2 - 2
ruoyi-modules/yingpaipay-service/src/main/java/org/dromara/service/service/ISysServiceService.java

@@ -51,7 +51,7 @@ public interface ISysServiceService {
      * @param bo 服务列表
      * @return 是否新增成功
      */
-    Boolean insertByBo(SysServiceBo bo);
+    SysServiceVo insertByBo(SysServiceBo bo);
 
     /**
      * 修改服务列表
@@ -59,7 +59,7 @@ public interface ISysServiceService {
      * @param bo 服务列表
      * @return 是否修改成功
      */
-    Boolean updateByBo(SysServiceBo bo);
+    SysServiceVo updateByBo(SysServiceBo bo);
 
     /**
      * 校验并批量删除服务列表信息

+ 6 - 4
ruoyi-modules/yingpaipay-service/src/main/java/org/dromara/service/service/impl/SysServiceServiceImpl.java

@@ -97,14 +97,14 @@ public class SysServiceServiceImpl implements ISysServiceService {
      */
     @CachePut(cacheNames = CacheNames.SYS_SERVICE, key = "#bo.id")
     @Override
-    public Boolean insertByBo(SysServiceBo bo) {
+    public SysServiceVo insertByBo(SysServiceBo bo) {
         SysService add = MapstructUtils.convert(bo, SysService.class);
         validEntityBeforeSave(add);
         boolean flag = baseMapper.insert(add) > 0;
         if (flag) {
             bo.setId(add.getId());
         }
-        return flag;
+        return baseMapper.selectVoById(bo.getId());
     }
 
     /**
@@ -115,10 +115,12 @@ public class SysServiceServiceImpl implements ISysServiceService {
      */
     @CachePut(cacheNames = CacheNames.SYS_SERVICE, key = "#bo.id")
     @Override
-    public Boolean updateByBo(SysServiceBo bo) {
+    public SysServiceVo updateByBo(SysServiceBo bo) {
         SysService update = MapstructUtils.convert(bo, SysService.class);
         validEntityBeforeSave(update);
-        return baseMapper.updateById(update) > 0;
+        boolean flag = baseMapper.updateById(update) > 0;
+        if (flag) {}
+        return baseMapper.selectVoById(bo.getId());
     }
 
     /**