|
@@ -1,16 +1,17 @@
|
|
package com.fjhx.controller.apply;
|
|
package com.fjhx.controller.apply;
|
|
|
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
-import org.springblade.core.tool.api.R;
|
|
|
|
import com.fjhx.entity.apply.ApplyPurchase;
|
|
import com.fjhx.entity.apply.ApplyPurchase;
|
|
import com.fjhx.params.apply.ApplyPurchaseVo;
|
|
import com.fjhx.params.apply.ApplyPurchaseVo;
|
|
import com.fjhx.service.apply.ApplyPurchaseService;
|
|
import com.fjhx.service.apply.ApplyPurchaseService;
|
|
|
|
+import org.springblade.core.tool.api.R;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.PostMapping;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestBody;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
|
|
+import java.util.List;
|
|
import java.util.Map;
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -22,35 +23,40 @@ import java.util.Map;
|
|
* @since 2022-11-28
|
|
* @since 2022-11-28
|
|
*/
|
|
*/
|
|
@RestController
|
|
@RestController
|
|
-@RequestMapping("/applyPurchase")
|
|
|
|
|
|
+@RequestMapping("/apply/purchase")
|
|
public class ApplyPurchaseController {
|
|
public class ApplyPurchaseController {
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
private ApplyPurchaseService applyPurchaseService;
|
|
private ApplyPurchaseService applyPurchaseService;
|
|
|
|
|
|
@PostMapping("/page")
|
|
@PostMapping("/page")
|
|
- public R page(@RequestBody Map<String, Object> condition){
|
|
|
|
|
|
+ public R page(@RequestBody Map<String, Object> condition) {
|
|
Page<ApplyPurchase> result = applyPurchaseService.getPage(condition);
|
|
Page<ApplyPurchase> result = applyPurchaseService.getPage(condition);
|
|
return R.success(result);
|
|
return R.success(result);
|
|
}
|
|
}
|
|
|
|
|
|
@PostMapping("/add")
|
|
@PostMapping("/add")
|
|
- public R add(@RequestBody ApplyPurchaseVo applyPurchaseVo){
|
|
|
|
- applyPurchaseService.add(applyPurchaseVo);
|
|
|
|
|
|
+ public R add(@RequestBody List<ApplyPurchase> list) {
|
|
|
|
+ applyPurchaseService.add(list);
|
|
return R.success();
|
|
return R.success();
|
|
}
|
|
}
|
|
|
|
|
|
@PostMapping("/edit")
|
|
@PostMapping("/edit")
|
|
- public R edit(@RequestBody ApplyPurchaseVo applyPurchaseVo){
|
|
|
|
|
|
+ public R edit(@RequestBody ApplyPurchaseVo applyPurchaseVo) {
|
|
applyPurchaseService.edit(applyPurchaseVo);
|
|
applyPurchaseService.edit(applyPurchaseVo);
|
|
return R.success();
|
|
return R.success();
|
|
}
|
|
}
|
|
|
|
|
|
@PostMapping("/delete")
|
|
@PostMapping("/delete")
|
|
- public R delete(@RequestBody ApplyPurchaseVo applyPurchaseVo){
|
|
|
|
|
|
+ public R delete(@RequestBody ApplyPurchaseVo applyPurchaseVo) {
|
|
applyPurchaseService.delete(applyPurchaseVo);
|
|
applyPurchaseService.delete(applyPurchaseVo);
|
|
return R.success();
|
|
return R.success();
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @PostMapping("/details")
|
|
|
|
+ public R details(@RequestBody ApplyPurchaseVo applyPurchaseVo) {
|
|
|
|
+ return R.success(applyPurchaseService.getById(applyPurchaseVo.getId()));
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|