|
@@ -3,6 +3,7 @@ package com.fjhx.controller.purchase;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.fjhx.entity.apply.ApplyPurchase;
|
|
|
import com.fjhx.entity.purchase.Purchase;
|
|
|
+import com.fjhx.enums.purchase.PurchaseStatusEnum;
|
|
|
import com.fjhx.service.purchase.PurchaseService;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -29,7 +30,19 @@ public class PurchaseController {
|
|
|
private PurchaseService purchaseService;
|
|
|
|
|
|
/**
|
|
|
- * 待发货列表
|
|
|
+ * 待采购列表
|
|
|
+ *
|
|
|
+ * @param condition 查询条件
|
|
|
+ * @return
|
|
|
+ */
|
|
|
+ @PostMapping("/stay/purchase/page")
|
|
|
+ public R stayPurchasePage(@RequestBody Map<String, Object> condition) {
|
|
|
+ Page<ApplyPurchase> result = purchaseService.stayPurchasePage(condition);
|
|
|
+ return R.success(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 已采购列表
|
|
|
*
|
|
|
* @param condition 查询条件
|
|
|
* @return
|
|
@@ -41,26 +54,26 @@ public class PurchaseController {
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 待采购列表
|
|
|
+ * 取消
|
|
|
*
|
|
|
- * @param condition 查询条件
|
|
|
+ * @param entity
|
|
|
* @return
|
|
|
*/
|
|
|
- @PostMapping("/stay/purchase/page")
|
|
|
- public R stayPurchasePage(@RequestBody Map<String, Object> condition) {
|
|
|
- Page<ApplyPurchase> result = purchaseService.stayPurchasePage(condition);
|
|
|
- return R.success(result);
|
|
|
+ @PostMapping("/cancel")
|
|
|
+ public R cancel(@RequestBody Purchase entity) {
|
|
|
+ purchaseService.cancelOrEnd(entity.getId(), PurchaseStatusEnum.STATUS_99.getKey());
|
|
|
+ return R.success();
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 完成
|
|
|
+ * 结束
|
|
|
*
|
|
|
* @param entity
|
|
|
* @return
|
|
|
*/
|
|
|
- @PostMapping("/complete")
|
|
|
- public R complete(@RequestBody Purchase entity) {
|
|
|
- purchaseService.complete(entity.getId());
|
|
|
+ @PostMapping("/end")
|
|
|
+ public R end(@RequestBody Purchase entity) {
|
|
|
+ purchaseService.cancelOrEnd(entity.getId(), PurchaseStatusEnum.STATUS_50.getKey());
|
|
|
return R.success();
|
|
|
}
|
|
|
}
|