Prechádzať zdrojové kódy

Accept Merge Request #103: (dev-xwt -> dev-test)

Merge Request: 修复

Created By: @夏文涛
Accepted By: @夏文涛
URL: https://chuanghaikeji.coding.net/p/moxuanyunshangwaimai/d/backend/git/merge/103?initial=true
夏文涛 1 rok pred
rodič
commit
739d723e4d

+ 25 - 0
src/main/java/com/sqx/modules/errand/controller/TbIndentController.java

@@ -8,9 +8,13 @@ import com.sqx.modules.common.entity.CommonInfo;
 import com.sqx.modules.common.service.CommonInfoService;
 import com.sqx.modules.datacentre.query.DataCenterQuery;
 import com.sqx.modules.errand.entity.TbIndent;
+import com.sqx.modules.errand.entity.TransferRecordEntity;
 import com.sqx.modules.errand.service.TbIndentService;
+import com.sqx.modules.errand.service.TransferRecordService;
 import com.sqx.modules.order.entity.TbOrder;
 import com.sqx.modules.order.service.AppOrderService;
+import com.sqx.modules.riderStation.entity.RiderStation;
+import com.sqx.modules.riderStation.service.RiderStationService;
 import com.sqx.modules.utils.SenInfoCheckUtil;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
@@ -21,6 +25,7 @@ import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.text.SimpleDateFormat;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.List;
@@ -38,6 +43,10 @@ public class TbIndentController {
     private CommonInfoService commonInfoService;
     @Autowired
     private AppOrderService appOrderService;
+    @Autowired
+    private RiderStationService riderStationService;
+    @Autowired
+    private TransferRecordService transferRecordService;
 
     @ApiOperation("查看所有派单任务")
     @GetMapping(value = "findallIndent")
@@ -144,6 +153,22 @@ public class TbIndentController {
         indent.setRiderUserId(riderUserId);
         indent.setIsRider(1);
         tbIndentService.updateById(indent);
+        //获取站点内容
+        RiderStation station = riderStationService.stationById(userEntity.getRiderStationId());
+        if(station != null){
+            userEntity.setStationName(station.getStationName());
+        }
+        String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
+        TransferRecordEntity tr = new TransferRecordEntity();
+        tr.setUserId(userEntity.getUserId());
+        tr.setUserName(userEntity.getUserName());
+        tr.setUserPhone(userEntity.getPhone());
+        tr.setOrderId(indent.getOrderId());
+        tr.setReceveTime(format);
+        tr.setStationName(station.getStationName());
+        tr.setDeleteFlag(0);
+        transferRecordService.insertPrintInfo(tr);
+
         UserEntity user = userService.getById(indent.getUserId());
         CommonInfo one = commonInfoService.findOne(335);
         List<String> msgList=new ArrayList<>();

+ 3 - 1
src/main/java/com/sqx/modules/errand/controller/app/AppTbIndentController.java

@@ -364,11 +364,13 @@ public class AppTbIndentController {
     @ApiOperation("转单")
     @PostMapping("/transferOfOrder")
     public Result transferOfOrder(@RequestAttribute Long userId, @Valid RiderTransferOrderDTO transferOrderDTO) {
+        log.info("测试是否进入转单");
         // 检查入参
         checkTransferOrderParam(transferOrderDTO);
 
+        log.info("测试是否进入转单1");
         tbIndentService.transferOfOrder(userId, transferOrderDTO);
-
+        log.info("测试是否进入转单2");
         return Result.success();
     }
 

+ 4 - 3
src/main/java/com/sqx/modules/errand/service/impl/TbIndentServiceImpl.java

@@ -1023,7 +1023,7 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
         indent.setRiderUserId(userEntity.getUserId());
         indent.setIsRider(1);
         updateById(indent);
-
+        log.info("测试是否进入转单3");
         String format = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date());
         TransferRecordEntity tr = new TransferRecordEntity();
         tr.setUserId(userEntity.getUserId());
@@ -1033,8 +1033,9 @@ public class TbIndentServiceImpl extends ServiceImpl<TbIndentDao, TbIndent> impl
         tr.setReceveTime(format);
         tr.setStationName(userEntity.getStationName());
         tr.setDeleteFlag(0);
-        transferRecordDao.insert(tr);
-
+        log.info("测试是否进入转单4,tr:"+ new Gson().toJson(tr));
+        int insertCount = transferRecordDao.insert(tr);
+        log.info("测试是否进入转单5,insertCount:"+insertCount);
         // 消息通知
         noticeAfterTransfer(indent);
     }