|
@@ -5,6 +5,11 @@ import com.caimei.modules.club.entity.Page;
|
|
|
import com.caimei.modules.order.entity.*;
|
|
|
import com.caimei.modules.order.service.*;
|
|
|
import com.caimei.utils.JsonModel;
|
|
|
+import com.caimei.utils.ResponseJson;
|
|
|
+import io.swagger.annotations.Api;
|
|
|
+import io.swagger.annotations.ApiImplicitParam;
|
|
|
+import io.swagger.annotations.ApiImplicitParams;
|
|
|
+import io.swagger.annotations.ApiOperation;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.junit.Assert;
|
|
@@ -12,9 +17,8 @@ import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
import java.util.*;
|
|
|
|
|
|
-/**
|
|
|
- * 组织订单
|
|
|
- */
|
|
|
+
|
|
|
+@Api(tags = "订单api")
|
|
|
@RestController
|
|
|
@RequiredArgsConstructor
|
|
|
@RequestMapping(value = "/order/organize")
|
|
@@ -30,8 +34,6 @@ public class OrganizeOrderController {
|
|
|
|
|
|
private final CmDiscernReceiptService cmDiscernReceiptService;
|
|
|
|
|
|
- private final NewShopOrderService newShopOrderService;
|
|
|
-
|
|
|
@ModelAttribute
|
|
|
public NewOrder getOrder(@RequestParam(required = false) String id) {
|
|
|
NewOrder entity = null;
|
|
@@ -44,10 +46,21 @@ public class OrganizeOrderController {
|
|
|
return entity;
|
|
|
}
|
|
|
|
|
|
+ @ApiOperation("更改收款状态")
|
|
|
+ @ApiImplicitParams({
|
|
|
+ @ApiImplicitParam(required = true, name = "orderId", value = "订单Id"),
|
|
|
+ @ApiImplicitParam(required = true, name = "amount", value = "本次收款金额"),
|
|
|
+ @ApiImplicitParam(required = true, name = "status", value = "订单收款状态 2部分收款 3已收款")
|
|
|
+ })
|
|
|
+ @GetMapping("/check/receipt")
|
|
|
+ public ResponseJson checkReceipt(Double amount, Integer status, Integer orderId) {
|
|
|
+ return newOrderService.checkReceipt(amount, status, orderId);
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
- * 订单列表
|
|
|
* 查询参数 :订单Id,订单编号,下单时间/终止时间,买家,收货人,订单状态,收款状态,发货状态,退款状态,待审核退款
|
|
|
*/
|
|
|
+ @ApiOperation("订单列表")
|
|
|
@GetMapping("orderList")
|
|
|
public JsonModel orderList(NewOrder order, Page page) {
|
|
|
Assert.assertNotNull("组织id不能为空!", order.getOrganizeId());
|
|
@@ -68,9 +81,7 @@ public class OrganizeOrderController {
|
|
|
return JsonModel.newInstance().success(orderPage);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 订单详情
|
|
|
- */
|
|
|
+ @ApiOperation("订单详情")
|
|
|
@GetMapping("detail")
|
|
|
public JsonModel detail(NewOrder order) {
|
|
|
Map<String, Object> map = new HashMap();
|
|
@@ -89,7 +100,7 @@ public class OrganizeOrderController {
|
|
|
order.setApplyReturnedPurchaseFlag("1");
|
|
|
}
|
|
|
//判断是否有在收款审核的订单
|
|
|
- List<Integer> ids = cmReceiptOrderRelationService.toAudit(order.getOrderId());
|
|
|
+ List<Integer> ids = cmReceiptOrderRelationService.toAudit(order);
|
|
|
if (ids != null && ids.size() > 0) {
|
|
|
order.setToAudit("1");
|
|
|
}
|
|
@@ -129,10 +140,7 @@ public class OrganizeOrderController {
|
|
|
return JsonModel.newInstance().success(map);
|
|
|
}
|
|
|
|
|
|
-
|
|
|
- /**
|
|
|
- * 收退款记录
|
|
|
- */
|
|
|
+ @ApiOperation("收退款记录")
|
|
|
@GetMapping(value = "toRefundRecord")
|
|
|
public JsonModel toRefundRecord(CmReturnedPurchase cmReturnedPurchase, String from) {
|
|
|
JsonModel jsonModel = JsonModel.newInstance();
|
|
@@ -156,9 +164,7 @@ public class OrganizeOrderController {
|
|
|
return jsonModel.success(map);
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 退款退货记录
|
|
|
- */
|
|
|
+ @ApiOperation("退款退货记录")
|
|
|
@GetMapping(value = "toRecturnRecordByOrderId")
|
|
|
public JsonModel toRecturnRecordByOrderId(CmReturnedPurchase cmReturnedPurchase) {
|
|
|
Map<String, Object> map = new HashMap();
|