فهرست منبع

根据文档调整-https://shimo.im/file-invite/c8FyXfzvbD9h3Uk2oJYaPGMq5e9v6/

codingliang 2 سال پیش
والد
کامیت
9540032898

+ 2 - 0
src/main/java/com/sqx/modules/errand/service/impl/TbIndentServiceImpl.java

@@ -825,6 +825,7 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
         }
         if("4".equals(indentByNumber.getIndentState())){
             if("5".equals(indentByNumber.getIndentType())){
+                log.info("操作完成订单1:"+indentByNumber.getOrderId());
                 appOrderService.accomplishOrder(indentByNumber.getOrderId());
             }else{
                 if(indentByNumber.getItemCodeFlag()!=null && indentByNumber.getItemCodeFlag()==0){
@@ -854,6 +855,7 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
             TbIndent indentByNumber = tbIndentDao.findIndentByNumber(indentNumber);
             tbIndentDao.userDelivery(userId, indentNumber, date);
             finshIndent(userId, indentNumber);
+            log.info("操作完成订单5:"+indentByNumber.getOrderId());
             appOrderService.accomplishOrders(indentByNumber.getOrderId(),1);
             return Result.success();
         }catch (Exception e){

+ 8 - 3
src/main/java/com/sqx/modules/order/controller/OrderController.java

@@ -1,22 +1,26 @@
 package com.sqx.modules.order.controller;
 
 import com.sqx.common.utils.Result;
-import com.sqx.modules.app.annotation.Login;
 import com.sqx.modules.order.entity.Evaluate;
 import com.sqx.modules.order.entity.TbOrder;
 import com.sqx.modules.order.service.AppOrderService;
 import com.sqx.modules.order.service.EvaluateService;
 import com.sqx.modules.sys.controller.AbstractController;
-import com.sqx.modules.sys.entity.SysUserEntity;
 import com.sqx.modules.utils.excel.ExcelData;
 import com.sqx.modules.utils.excel.ExportExcelUtils;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.GetMapping;
+import org.springframework.web.bind.annotation.PostMapping;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletResponse;
 
+@Slf4j
 @Api(tags={"管理端-订单"})
 @RestController
 @RequestMapping("/admin/order")
@@ -55,6 +59,7 @@ public class OrderController extends AbstractController {
     public Result accomplishOrder(Long orderId){
         TbOrder tbOrder2 = appOrderService.getById(orderId);
         if(tbOrder2.getAutoSendOrder()!=null && tbOrder2.getAutoSendOrder()==1){
+            log.info("操作完成订单2:"+orderId);
             return appOrderService.accomplishOrder( orderId);
         }
         return Result.error("当前订单为自动派单,不能手动完成!");

+ 3 - 1
src/main/java/com/sqx/modules/order/controller/app/AppOrderController.java

@@ -8,11 +8,13 @@ import com.sqx.modules.order.service.AppOrderService;
 import com.sqx.modules.order.service.EvaluateService;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
+import lombok.extern.slf4j.Slf4j;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.web.bind.annotation.*;
 
 import java.util.List;
 
+@Slf4j
 @Api(tags={"用户端-订单"})
 @RestController
 @RequestMapping("/app/order")
@@ -205,7 +207,7 @@ public class AppOrderController {
     @ApiOperation("用户选择完成订单")
     @PostMapping(value = "accomplishOrder")
     public Result accomplishOrder(Long orderId){
-
+        log.info("操作完成订单3:"+orderId);
         return appOrderService.accomplishOrder( orderId);
     }
 

+ 4 - 6
src/main/java/com/sqx/modules/order/service/impl/AppAppOrderServiceImpl.java

@@ -63,7 +63,6 @@ import java.time.LocalDateTime;
 import java.time.format.DateTimeFormatter;
 import java.util.*;
 import java.util.concurrent.locks.ReentrantReadWriteLock;
-import java.util.stream.IntStream;
 
 @Service
 @Slf4j
@@ -889,6 +888,7 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
             if (tbOrder.getStatus().equals(4)) {
                 return Result.success();
             }
+            log.info("操作完成订单4:"+order.getOrderId());
             Result result = this.accomplishOrder(order.getOrderId());
             if("500".equals(String.valueOf(result.get("code")))){
                 return result;
@@ -1013,8 +1013,6 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
         return Result.error("系统繁忙,请稍后再试!");
     }
 
-
-    @Transactional
     @Override
     public Result accomplishOrder(Long orderId) {
         reentrantReadWriteLock.writeLock().lock();
@@ -1038,7 +1036,9 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
     @Transactional
     @Override
     public Result accomplishOrders(Long orderId, Integer type) {
+        log.info("订单id:"+orderId+",类型:"+type);
         TbOrder tbOrder = appOrderDao.selectById(orderId);
+        log.info("订单状态 :"+tbOrder.getStatus());
         if (tbOrder.getStatus().equals(4)) {
             return Result.success();
         }
@@ -1067,7 +1067,6 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
             appOrderDao.updateById(tbOrder);
         }
 
-
         GoodsShop goodsShop = shopMessageService.selectShopId(tbOrder.getShopId());
         //计算商户应得金额
 
@@ -1117,7 +1116,6 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
             }*/
         }
 
-
         tbOrder.setShopIncomeMoney(shopMoney);
         appOrderDao.updateById(tbOrder);
         //添加商户用户钱包收入记录
@@ -1206,6 +1204,7 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
             //计算当前订单什么时候超时完成
             LocalDateTime overDateTime = updateTime.plusHours(Integer.parseInt(one.getValue()));
             if (LocalDateTime.now().isAfter(overDateTime)) {
+                log.info("操作完成订单6:"+tbOrder.getOrderId());
                 accomplishOrders(tbOrder.getOrderId(),2);
                 //管理端完成订单,则消息通知用户
                 //添加消息记录
@@ -1324,7 +1323,6 @@ public class AppAppOrderServiceImpl extends ServiceImpl<AppOrderDao, TbOrder> im
         if (tbOrder.getStatus() == 7) {
             UserEntity userEntity = userDao.selectById(tbOrder.getUserId());
             //已支付判断支付方式
-
             if (tbOrder.getPayType() == 2) {
                 //余额支付,直接退还钱包
                 userMoneyDao.updateMayMoney(1, tbOrder.getUserId(), tbOrder.getPayMoney().doubleValue());