|
@@ -26,6 +26,8 @@ import org.springblade.core.mp.support.Query;
|
|
import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.api.R;
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.core.tool.utils.Func;
|
|
import org.springblade.meter.vo.ContractMaterialTreeVO;
|
|
import org.springblade.meter.vo.ContractMaterialTreeVO;
|
|
|
|
+import org.springblade.meter.vo.ContractMaterialVO2;
|
|
|
|
+import org.springblade.meter.vo.SyncMaterialVO;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.*;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -57,7 +59,8 @@ public class ContractMaterialController extends BladeController {
|
|
@ApiOperationSupport(order = 1)
|
|
@ApiOperationSupport(order = 1)
|
|
@ApiOperation(value = "新增或修改", notes = "传入contractMaterial")
|
|
@ApiOperation(value = "新增或修改", notes = "传入contractMaterial")
|
|
public R submit(@Valid @RequestBody ContractMaterial contractMaterial) {
|
|
public R submit(@Valid @RequestBody ContractMaterial contractMaterial) {
|
|
- return R.status(contractMaterialService.saveOrUpdate(contractMaterial));
|
|
|
|
|
|
+ contractMaterialService.addOrUpdate(contractMaterial);
|
|
|
|
+ return R.success("操作成功");
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -72,17 +75,42 @@ public class ContractMaterialController extends BladeController {
|
|
@ApiImplicitParam(name = "current", value = "当前页", required = true),
|
|
@ApiImplicitParam(name = "current", value = "当前页", required = true),
|
|
@ApiImplicitParam(name = "size", value = "每页数量", required = true)
|
|
@ApiImplicitParam(name = "size", value = "每页数量", required = true)
|
|
})
|
|
})
|
|
- public R<IPage<ContractMaterial>> list(ContractMaterial contractMaterial, Query query) {
|
|
|
|
- IPage<ContractMaterial> pages = contractMaterialService.page(Condition.getPage(query), Condition.getQueryWrapper(contractMaterial));
|
|
|
|
|
|
+ public R<IPage<ContractMaterialVO2>> list(ContractMaterial material, Query query) {
|
|
|
|
+ IPage<ContractMaterialVO2> pages = contractMaterialService.page2(material,query);
|
|
return R.data(pages);
|
|
return R.data(pages);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ @GetMapping("/getSyncData")
|
|
|
|
+ @ApiOperationSupport(order = 3)
|
|
|
|
+ @ApiOperation(value = "获取同步数据", notes = "传入项目id合同段id和材料编号")
|
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
|
+ @ApiImplicitParam(name = "projectId", value = "项目id", required = true),
|
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
|
|
|
|
+ @ApiImplicitParam(name = "materialNumber", value = "材料编号", required = true),
|
|
|
|
+ })
|
|
|
|
+ public R<List<SyncMaterialVO>> getSyncData(ContractMaterial material) {
|
|
|
|
+ List<SyncMaterialVO> list = contractMaterialService.getSyncData(material);
|
|
|
|
+ return R.data(list);
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ @GetMapping("/syncMaterial")
|
|
|
|
+ @ApiOperationSupport(order = 4)
|
|
|
|
+ @ApiOperation(value = "同步材料", notes = "传入材料id,和选中行id")
|
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
|
+ @ApiImplicitParam(name = "id", value = "材料id", required = true),
|
|
|
|
+ @ApiImplicitParam(name = "selectId", value = "选中行id", required = true),
|
|
|
|
+ })
|
|
|
|
+ public R<String> syncMaterial(Long id,Long selectId) {
|
|
|
|
+ contractMaterialService.syncMaterial(id,selectId);
|
|
|
|
+ return R.success("同步成功");
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
|
|
/**
|
|
/**
|
|
* 删除 合同材料表
|
|
* 删除 合同材料表
|
|
*/
|
|
*/
|
|
@PostMapping("/remove")
|
|
@PostMapping("/remove")
|
|
- @ApiOperationSupport(order = 4)
|
|
|
|
|
|
+ @ApiOperationSupport(order = 9)
|
|
@ApiOperation(value = "删除", notes = "传入ids")
|
|
@ApiOperation(value = "删除", notes = "传入ids")
|
|
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
return R.status(contractMaterialService.deleteLogic(Func.toLongList(ids)));
|
|
return R.status(contractMaterialService.deleteLogic(Func.toLongList(ids)));
|
|
@@ -92,7 +120,7 @@ public class ContractMaterialController extends BladeController {
|
|
* 材料树 合同材料表
|
|
* 材料树 合同材料表
|
|
*/
|
|
*/
|
|
@GetMapping("/materialTree")
|
|
@GetMapping("/materialTree")
|
|
- @ApiOperationSupport(order = 2)
|
|
|
|
|
|
+ @ApiOperationSupport(order = 10)
|
|
@ApiOperation(value = "材料树", notes = "传入合同id")
|
|
@ApiOperation(value = "材料树", notes = "传入合同id")
|
|
public R<List<ContractMaterialTreeVO>> materialTree(Long contractId) {
|
|
public R<List<ContractMaterialTreeVO>> materialTree(Long contractId) {
|
|
return R.data(contractMaterialService.materialTree(contractId));
|
|
return R.data(contractMaterialService.materialTree(contractId));
|