|
|
@@ -7,6 +7,7 @@ import com.sqx.modules.app.annotation.Login;
|
|
|
import com.sqx.modules.app.entity.UserEntity;
|
|
|
import com.sqx.modules.app.service.UserService;
|
|
|
import com.sqx.modules.common.service.CommonInfoService;
|
|
|
+import com.sqx.modules.errand.dto.OrderRiderDeliveryDTO;
|
|
|
import com.sqx.modules.errand.dto.RiderDeliveryDTO;
|
|
|
import com.sqx.modules.errand.dto.RiderTransferOrderDTO;
|
|
|
import com.sqx.modules.errand.dto.WaitForAcceptOrderQueryDTO;
|
|
|
@@ -20,6 +21,7 @@ import com.sqx.modules.errand.service.TbIndentService;
|
|
|
import io.swagger.annotations.Api;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.apache.commons.lang.StringUtils;
|
|
|
+import org.apache.poi.ss.formula.functions.T;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.web.bind.annotation.GetMapping;
|
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
|
@@ -48,7 +50,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@PostMapping(value = "distance")
|
|
|
@ApiOperation("根据经纬度计算两点之间距离")
|
|
|
- public Result distance(double ol, double od, double dl, double dd){
|
|
|
+ public Result distance(double ol, double od, double dl, double dd) {
|
|
|
|
|
|
return tbIndentService.distance(ol, od, dl, dd);
|
|
|
}
|
|
|
@@ -56,7 +58,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@ApiOperation("保存用户输入地址")
|
|
|
@PostMapping(value = "addUserAddress")
|
|
|
- public Result addUserAddress(@RequestAttribute Long userId, @RequestBody ErrandAddress errandAddress){
|
|
|
+ public Result addUserAddress(@RequestAttribute Long userId, @RequestBody ErrandAddress errandAddress) {
|
|
|
|
|
|
return tbIndentService.addUserAddress(userId, errandAddress);
|
|
|
}
|
|
|
@@ -64,7 +66,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@ApiOperation("编辑地址")
|
|
|
@PostMapping(value = "updateAddress")
|
|
|
- public Result updateAddress(@RequestAttribute Long userId, @RequestBody ErrandAddress errandAddress){
|
|
|
+ public Result updateAddress(@RequestAttribute Long userId, @RequestBody ErrandAddress errandAddress) {
|
|
|
|
|
|
return tbIndentService.updateAddress(userId, errandAddress);
|
|
|
}
|
|
|
@@ -72,7 +74,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@ApiOperation("获取用户历史地址")
|
|
|
@GetMapping(value = "findUserAddress")
|
|
|
- public Result findUserAddress(@RequestAttribute Long userId){
|
|
|
+ public Result findUserAddress(@RequestAttribute Long userId) {
|
|
|
|
|
|
return tbIndentService.findUserAddress(userId);
|
|
|
}
|
|
|
@@ -80,7 +82,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@ApiOperation("根据地址id获取地址信息")
|
|
|
@GetMapping(value = "findAddressById")
|
|
|
- public Result findAddressById(@RequestAttribute Long userId, Integer addressId){
|
|
|
+ public Result findAddressById(@RequestAttribute Long userId, Integer addressId) {
|
|
|
|
|
|
return tbIndentService.findAddressById(userId, addressId);
|
|
|
}
|
|
|
@@ -88,7 +90,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@ApiOperation("设置默认地址")
|
|
|
@GetMapping(value = "addDefaultAddress")
|
|
|
- private Result addDefaultAddress(@RequestAttribute Long userId, Integer addressId){
|
|
|
+ private Result addDefaultAddress(@RequestAttribute Long userId, Integer addressId) {
|
|
|
|
|
|
return tbIndentService.addDefaultAddress(userId, addressId);
|
|
|
}
|
|
|
@@ -96,7 +98,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@ApiOperation("删除历史地址")
|
|
|
@GetMapping(value = "delUserAddress")
|
|
|
- public Result delUserAddress(@RequestAttribute Long userId, Integer addressId){
|
|
|
+ public Result delUserAddress(@RequestAttribute Long userId, Integer addressId) {
|
|
|
|
|
|
return tbIndentService.delUserAddress(userId, addressId);
|
|
|
}
|
|
|
@@ -104,7 +106,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@ApiOperation("获取订单起点附近5公里内所有骑手")
|
|
|
@GetMapping(value = "find5KmRider")
|
|
|
- public Result find5KmRider(double lng, double lat){
|
|
|
+ public Result find5KmRider(double lng, double lat) {
|
|
|
|
|
|
return tbIndentService.find5KmRider(lng, lat);
|
|
|
}
|
|
|
@@ -112,17 +114,16 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@ApiOperation("骑手上线时更新骑手坐标")
|
|
|
@PostMapping(value = "updateCoordinate")
|
|
|
- public Result updateCoordinate(@RequestAttribute Long userId, double lng, double lat){
|
|
|
+ public Result updateCoordinate(@RequestAttribute Long userId, double lng, double lat) {
|
|
|
|
|
|
return tbIndentService.updateCoordinate(userId, lng, lat);
|
|
|
}
|
|
|
|
|
|
|
|
|
-
|
|
|
@Login
|
|
|
@GetMapping(value = "/findUserInfoById")
|
|
|
@ApiOperation("获取登陆用户信息")
|
|
|
- public Result findUserInfoById(@RequestAttribute("userId") Long userId){
|
|
|
+ public Result findUserInfoById(@RequestAttribute("userId") Long userId) {
|
|
|
UserEntity userEntity = tbIndentService.findUserInfoById(userId);
|
|
|
|
|
|
return Result.success().put("data", userEntity);
|
|
|
@@ -131,7 +132,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@ApiOperation("新用户领取新人红包")
|
|
|
@GetMapping(value = "getNewUserRedPacket")
|
|
|
- public Result getNewUserRedPacket(@RequestAttribute Long userId){
|
|
|
+ public Result getNewUserRedPacket(@RequestAttribute Long userId) {
|
|
|
|
|
|
return tbIndentService.getNewUserRedPacket(userId);
|
|
|
}
|
|
|
@@ -139,7 +140,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@GetMapping(value = "findAllRedPacket")
|
|
|
@ApiOperation("获取该用户的所有红包")
|
|
|
- public Result findAllRedPacket(@RequestAttribute Long userId){
|
|
|
+ public Result findAllRedPacket(@RequestAttribute Long userId) {
|
|
|
List<ErrandRedPacket> allRedPacket = tbIndentService.findAllRedPacket(userId);
|
|
|
return Result.success().put("data", allRedPacket);
|
|
|
}
|
|
|
@@ -147,7 +148,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@PostMapping(value = "findRedPacket")
|
|
|
@ApiOperation("获取用户可用红包")
|
|
|
- public Result findRedPacket(@RequestAttribute Long userId, @RequestBody TbIndent indent){
|
|
|
+ public Result findRedPacket(@RequestAttribute Long userId, @RequestBody TbIndent indent) {
|
|
|
List<ErrandRedPacket> redPackets = tbIndentService.findRedPacket(userId, indent);
|
|
|
return Result.success().put("data", redPackets);
|
|
|
}
|
|
|
@@ -155,15 +156,15 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@PostMapping(value = "basicsMoney")
|
|
|
@ApiOperation("计算订单基础价格")
|
|
|
- public Result basicsMoney(@RequestBody TbIndent tbIndent){
|
|
|
+ public Result basicsMoney(@RequestBody TbIndent tbIndent) {
|
|
|
|
|
|
- return Result.success().put("data",tbIndentService.basicsMoney(tbIndent));
|
|
|
+ return Result.success().put("data", tbIndentService.basicsMoney(tbIndent));
|
|
|
}
|
|
|
|
|
|
@Login
|
|
|
@PostMapping(value = "addIndent")
|
|
|
@ApiOperation("用户下单")
|
|
|
- public Result addIndentBuy(@RequestAttribute Long userId, @RequestBody TbIndent tbIndent){
|
|
|
+ public Result addIndentBuy(@RequestAttribute Long userId, @RequestBody TbIndent tbIndent) {
|
|
|
tbIndent.setUserId(userId);
|
|
|
return tbIndentService.addIndentBuy(tbIndent);
|
|
|
}
|
|
|
@@ -171,7 +172,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@PostMapping(value = "findNewIndent")
|
|
|
@ApiOperation("骑手查看可接订单")
|
|
|
- public Result findNewIndent(@RequestAttribute Long userId, @RequestBody TbIndent tbIndent){
|
|
|
+ public Result findNewIndent(@RequestAttribute Long userId, @RequestBody TbIndent tbIndent) {
|
|
|
String receivingPettern = tbIndent.getReceivingPettern();
|
|
|
double riderlat = tbIndent.getRiderlat();
|
|
|
double riderlng = tbIndent.getRiderlng();
|
|
|
@@ -185,7 +186,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@PostMapping(value = "find-new-indent")
|
|
|
@ApiOperation("骑手查看可接订单(新)")
|
|
|
- public Result findNewIndent(@Valid @RequestBody WaitForAcceptOrderQueryDTO queryDTO){
|
|
|
+ public Result findNewIndent(@Valid @RequestBody WaitForAcceptOrderQueryDTO queryDTO) {
|
|
|
PageUtils newIndent = tbIndentService.findNewIndent(queryDTO);
|
|
|
return Result.success().put("data", newIndent);
|
|
|
}
|
|
|
@@ -193,7 +194,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@PostMapping(value = "find-new-indent-group-by-shop")
|
|
|
@ApiOperation("骑手查看可接订单(按商家分组)")
|
|
|
- public Result findNewIndentGroupByShop(@Valid @RequestBody WaitForAcceptOrderQueryDTO queryDTO){
|
|
|
+ public Result findNewIndentGroupByShop(@Valid @RequestBody WaitForAcceptOrderQueryDTO queryDTO) {
|
|
|
PageUtils newIndent = tbIndentService.findNewIndentGroupByShop(queryDTO);
|
|
|
return Result.success().put("data", newIndent);
|
|
|
}
|
|
|
@@ -201,7 +202,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@PostMapping(value = "indentReceiving")
|
|
|
@ApiOperation("骑手接单")
|
|
|
- public Result indentReceiving(@RequestAttribute Long userId, String indentNumber){
|
|
|
+ public Result indentReceiving(@RequestAttribute Long userId, String indentNumber) {
|
|
|
|
|
|
return tbIndentService.indentReceiving(userId, indentNumber);
|
|
|
}
|
|
|
@@ -209,7 +210,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@PostMapping(value = "riderBuyGoods")
|
|
|
@ApiOperation("骑手修改订单状态")
|
|
|
- public Result riderBuyGoods(@RequestBody TbIndent tbIndent){
|
|
|
+ public Result riderBuyGoods(@RequestBody TbIndent tbIndent) {
|
|
|
|
|
|
return tbIndentService.riderBuyGoods(tbIndent);
|
|
|
}
|
|
|
@@ -217,9 +218,9 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@GetMapping(value = "findUserIndent")
|
|
|
@ApiOperation("用户查看自己所有订单(全部、待付款、待接单、派送中(已接单未完成)、已完成)")
|
|
|
- public Result findUserIndent(@RequestAttribute Long userId, Integer page, Integer limit,String indentState){
|
|
|
+ public Result findUserIndent(@RequestAttribute Long userId, Integer page, Integer limit, String indentState) {
|
|
|
|
|
|
- return tbIndentService.findUserIndent(userId, page, limit,indentState);
|
|
|
+ return tbIndentService.findUserIndent(userId, page, limit, indentState);
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -233,7 +234,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@PostMapping(value = "userCancleIndent")
|
|
|
@ApiOperation("用户取消订单")
|
|
|
- public Result userCancleIndent(@RequestAttribute Long userId, String indentNumber){
|
|
|
+ public Result userCancleIndent(@RequestAttribute Long userId, String indentNumber) {
|
|
|
|
|
|
return tbIndentService.userCancleIndent(userId, indentNumber);
|
|
|
}
|
|
|
@@ -241,7 +242,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@GetMapping(value = "findRiderIndent")
|
|
|
@ApiOperation("骑手查看自己所有订单")
|
|
|
- public Result findRiderIndent(@RequestAttribute Long userId, Integer page, Integer limit, String indentState){
|
|
|
+ public Result findRiderIndent(@RequestAttribute Long userId, Integer page, Integer limit, String indentState) {
|
|
|
|
|
|
return tbIndentService.findRiderIndent(userId, page, limit, indentState);
|
|
|
}
|
|
|
@@ -264,15 +265,15 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@PostMapping(value = "riderCancleIndent")
|
|
|
@ApiOperation("骑手取消订单")
|
|
|
- public Result riderCancleIndent( String indentNumber){
|
|
|
- return tbIndentService.riderCancleIndent(indentNumber,1);
|
|
|
+ public Result riderCancleIndent(String indentNumber) {
|
|
|
+ return tbIndentService.riderCancleIndent(indentNumber, 1);
|
|
|
}
|
|
|
|
|
|
//骑手已送达
|
|
|
@Login
|
|
|
@PostMapping(value = "riderDelivery")
|
|
|
@ApiOperation("骑手已送达")
|
|
|
- public Result riderDelivery(@RequestAttribute Long userId, @Valid @RequestBody RiderDeliveryDTO riderDeliveryDTO){
|
|
|
+ public Result riderDelivery(@RequestAttribute Long userId, @Valid @RequestBody RiderDeliveryDTO riderDeliveryDTO) {
|
|
|
|
|
|
return tbIndentService.riderDelivery(userId, riderDeliveryDTO);
|
|
|
}
|
|
|
@@ -281,7 +282,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@PostMapping(value = "userDelivery")
|
|
|
@ApiOperation("用户确认已送达")
|
|
|
- public Result userDelivery(@RequestAttribute Long userId, String indentNumber){
|
|
|
+ public Result userDelivery(@RequestAttribute Long userId, String indentNumber) {
|
|
|
|
|
|
return tbIndentService.userDelivery(userId, indentNumber);
|
|
|
}
|
|
|
@@ -289,14 +290,14 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@PostMapping(value = "userEvaluate")
|
|
|
@ApiOperation("用户评价(评价等级和内容)")
|
|
|
- public Result userEvaluate(@RequestAttribute Long userId, @RequestBody ErrandEvaluate errandEvaluate){
|
|
|
+ public Result userEvaluate(@RequestAttribute Long userId, @RequestBody ErrandEvaluate errandEvaluate) {
|
|
|
errandEvaluate.setUserId(userId);
|
|
|
return tbIndentService.userEvaluate(errandEvaluate);
|
|
|
}
|
|
|
|
|
|
@ApiOperation("用户投诉订单")
|
|
|
@PostMapping(value = "insertComplaint")
|
|
|
- public Result insertComplaint(@RequestBody ErrandComplaint errandComplaint){
|
|
|
+ public Result insertComplaint(@RequestBody ErrandComplaint errandComplaint) {
|
|
|
|
|
|
return errandComplaintService.insertComplaint(errandComplaint);
|
|
|
}
|
|
|
@@ -304,7 +305,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@ApiOperation("用户查看所有投诉")
|
|
|
@GetMapping(value = "selectComplaint")
|
|
|
- public Result selectComplaint(@RequestAttribute Long userId, Integer page, Integer limit){
|
|
|
+ public Result selectComplaint(@RequestAttribute Long userId, Integer page, Integer limit) {
|
|
|
|
|
|
return errandComplaintService.selectComplaint(userId, page, limit);
|
|
|
}
|
|
|
@@ -312,23 +313,23 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@GetMapping(value = "findAllComplaint")
|
|
|
@ApiOperation("骑手查看自己的所有被投诉")
|
|
|
- public Result findAllComplaint(@RequestAttribute Long userId, Integer illegalId, Integer complaintState, Integer page, Integer limit){
|
|
|
+ public Result findAllComplaint(@RequestAttribute Long userId, Integer illegalId, Integer complaintState, Integer page, Integer limit) {
|
|
|
|
|
|
- return errandComplaintService.findAllComplaint(userId,illegalId, complaintState, page, limit);
|
|
|
+ return errandComplaintService.findAllComplaint(userId, illegalId, complaintState, page, limit);
|
|
|
}
|
|
|
|
|
|
@Login
|
|
|
@GetMapping(value = "findComplaint")
|
|
|
@ApiOperation("骑手查看被投诉内容")
|
|
|
- public Result findComplaint(@RequestAttribute Long userId, Long complaintId){
|
|
|
+ public Result findComplaint(@RequestAttribute Long userId, Long complaintId) {
|
|
|
|
|
|
- return errandComplaintService.findComplaint(userId,complaintId);
|
|
|
+ return errandComplaintService.findComplaint(userId, complaintId);
|
|
|
}
|
|
|
|
|
|
@Login
|
|
|
@PostMapping(value = "appealIndent")
|
|
|
@ApiOperation("骑手提交申诉")
|
|
|
- public Result appealIndent(@RequestAttribute Long userId, @RequestBody ErrandComplaint errandComplaint){
|
|
|
+ public Result appealIndent(@RequestAttribute Long userId, @RequestBody ErrandComplaint errandComplaint) {
|
|
|
|
|
|
return errandComplaintService.appealIndent(userId, errandComplaint);
|
|
|
}
|
|
|
@@ -340,7 +341,7 @@ public class AppTbIndentController {
|
|
|
@Login
|
|
|
@ApiOperation("转单")
|
|
|
@PostMapping("/transferOfOrder")
|
|
|
- public Result transferOfOrder(@RequestAttribute Long userId, @Valid RiderTransferOrderDTO transferOrderDTO){
|
|
|
+ public Result transferOfOrder(@RequestAttribute Long userId, @Valid RiderTransferOrderDTO transferOrderDTO) {
|
|
|
// 检查入参
|
|
|
checkTransferOrderParam(transferOrderDTO);
|
|
|
|
|
|
@@ -367,4 +368,47 @@ public class AppTbIndentController {
|
|
|
throw new SqxException("待分配骑手手机号和待分配骑手真实姓名不能同时为空");
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
+ //region 2024-09-12 A-jax 添加接口
|
|
|
+ //region 1、根据订单id查询跑腿订单的信息;
|
|
|
+ @Login
|
|
|
+ @GetMapping("selectTbIndentPage")
|
|
|
+ @ApiOperation("扫码或收单码查询跑腿订单列表(带分页")
|
|
|
+ public Result selectMemberPage(@RequestAttribute Long userId, Integer page, Integer limit, String acquireCode) {
|
|
|
+ //如果只有一条数据就看看数据是否能被当前骑手接
|
|
|
+ PageUtils datas = tbIndentService.selectIndentPage(page, limit, acquireCode);
|
|
|
+ if (datas.getTotalCount() == 1) {
|
|
|
+ //校验当前骑手是否能接单
|
|
|
+ Result checkData = tbIndentService.checkIndent(userId, acquireCode);
|
|
|
+ if(!checkData.get("code").equals("0")){
|
|
|
+ return Result.error("当前订单无法接单");
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return Result.success().put("data",datas);
|
|
|
+ }
|
|
|
+ //endregion
|
|
|
+
|
|
|
+ //region 2、根据订单id抢单(跑腿订单);
|
|
|
+ @Login
|
|
|
+ @PostMapping(value = "orderIndentReceiving")
|
|
|
+ @ApiOperation("骑手根据扫码或收单码接单")
|
|
|
+ public Result orderIndentReceiving(@RequestAttribute Long userId, String acquireCode) {
|
|
|
+
|
|
|
+ return tbIndentService.orderIndentReceiving(userId, acquireCode);
|
|
|
+ }
|
|
|
+ //endregion
|
|
|
+
|
|
|
+ //region 3、根据订单id完成跑腿订单。
|
|
|
+ @Login
|
|
|
+ @PostMapping(value = "orderRiderDelivery")
|
|
|
+ @ApiOperation("骑手根据扫码或收单码完成订单")
|
|
|
+ public Result orderRiderDelivery(@RequestAttribute Long userId, @Valid @RequestBody OrderRiderDeliveryDTO orderRiderDeliveryDTO) {
|
|
|
+
|
|
|
+ return tbIndentService.orderRiderDelivery(userId, orderRiderDeliveryDTO);
|
|
|
+ }
|
|
|
+ //endregion
|
|
|
+ //endregion
|
|
|
+
|
|
|
}
|