|
@@ -19,14 +19,15 @@ package org.springblade.meter.controller;
|
|
|
import io.swagger.annotations.*;
|
|
|
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
|
|
|
import lombok.AllArgsConstructor;
|
|
|
+
|
|
|
import javax.validation.Valid;
|
|
|
|
|
|
-import org.springblade.core.mp.support.Condition;
|
|
|
import org.springblade.core.mp.support.Query;
|
|
|
import org.springblade.core.tool.api.R;
|
|
|
import org.springblade.core.tool.utils.Func;
|
|
|
import org.springblade.meter.dto.MiddleMeterApplyDTO;
|
|
|
import org.springblade.meter.vo.*;
|
|
|
+import org.springframework.jdbc.core.JdbcTemplate;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
@@ -35,7 +36,6 @@ import org.springblade.meter.service.IMiddleMeterApplyService;
|
|
|
import org.springblade.core.boot.ctrl.BladeController;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
-import java.time.LocalDate;
|
|
|
import java.util.List;
|
|
|
|
|
|
/**
|
|
@@ -50,180 +50,181 @@ import java.util.List;
|
|
|
@Api(value = "中间计量申请表", tags = "中间计量申请表接口")
|
|
|
public class MiddleMeterApplyController extends BladeController {
|
|
|
|
|
|
- private final IMiddleMeterApplyService middleMeterApplyService;
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 添加清单
|
|
|
- */
|
|
|
- @GetMapping("/addFormList")
|
|
|
- @ApiOperationSupport(order = 1)
|
|
|
- @ApiOperation(value = "添加清单", notes = "传入节点id合同段id和已经存在的清单id,逗号分隔.返回清单集合")
|
|
|
- @ApiImplicitParams(value = {
|
|
|
- @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
|
|
|
- @ApiImplicitParam(name = "nodeId", value = "节点id", required = true),
|
|
|
- @ApiImplicitParam(name = "ids", value = "已经存在的清单id,逗号分隔", required = true),
|
|
|
- @ApiImplicitParam(name = "contractPeriodId", value = "合同计量期id", required = true),
|
|
|
- @ApiImplicitParam(name = "id", value = "中间计量申请的id", required = true)
|
|
|
- })
|
|
|
- public R<List<ResolveInventoryVO>> addFormList(Long id,Long contractId ,Long contractPeriodId, Long nodeId ,String ids) {
|
|
|
- List<ResolveInventoryVO> vos = middleMeterApplyService.addFormList(id,contractId,contractPeriodId,nodeId,ids);
|
|
|
- return R.data(vos);
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
- /**
|
|
|
- * 添加分解清单
|
|
|
- */
|
|
|
- @GetMapping("/addResolveForm")
|
|
|
- @ApiOperationSupport(order = 2)
|
|
|
- @ApiOperation(value = "添加分解清单", notes = "传入选中的行的id,逗号分隔.返回计量清单列表")
|
|
|
- @ApiImplicitParams(value = {
|
|
|
- @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
|
|
|
- @ApiImplicitParam(name = "nodeId", value = "节点id", required = true),
|
|
|
- @ApiImplicitParam(name = "ids", value = "传入选中的行的id,逗号分隔", required = true)
|
|
|
- })
|
|
|
- public R<List<MeterInventoryVO>> addResolveForm(Long contractId ,Long nodeId ,String ids) {
|
|
|
- List<MeterInventoryVO> vos = middleMeterApplyService.addResolveForm(contractId,nodeId,ids);
|
|
|
- return R.data(vos);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取当前节点工程划分
|
|
|
- */
|
|
|
- @GetMapping("/getNodeDivide")
|
|
|
- @ApiOperationSupport(order = 3)
|
|
|
- @ApiOperation(value = "获取当前节点工程划分", notes = "传入节点id")
|
|
|
- public R<String> getNodeDivide(Long nodeId) {
|
|
|
- return R.data(middleMeterApplyService.getNodeDivide(nodeId));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取当前节点变更令
|
|
|
- */
|
|
|
- @GetMapping("/getNodeToken")
|
|
|
- @ApiOperationSupport(order = 4)
|
|
|
- @ApiOperation(value = "获取变更编号,附件", notes = "传入合同id,节点id,和所有清单id逗号拼接,业务日期")
|
|
|
- @ApiImplicitParams(value = {
|
|
|
- @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
|
|
|
- @ApiImplicitParam(name = "nodeId", value = "节点id", required = true),
|
|
|
- @ApiImplicitParam(name = "formIds", value = "所有计量清单id,逗号分隔", required = true),
|
|
|
- @ApiImplicitParam(name = "businessDate", value = "业务日期", required = true)
|
|
|
- })
|
|
|
- public R<MiddleMeterTokenVO> getNodeToken(Long contractId,Long nodeId, String formIds, String businessDate) {
|
|
|
- return R.data(middleMeterApplyService.getNodeToken(contractId,nodeId,formIds,businessDate));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 新增 中间计量申请表
|
|
|
- */
|
|
|
- @PostMapping("/add")
|
|
|
- @ApiOperationSupport(order = 5)
|
|
|
- @ApiOperation(value = "新增", notes = "传入middleMeterApplyDTO")
|
|
|
- public R save(@Valid @RequestBody MiddleMeterApplyDTO dto) {
|
|
|
- middleMeterApplyService.add(dto);
|
|
|
- return R.success("新增成功");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取详情
|
|
|
- */
|
|
|
- @GetMapping("/detail")
|
|
|
- @ApiOperationSupport(order = 6)
|
|
|
- @ApiOperation(value = "获取详情", notes = "传入id,返回详情,修改时回显")
|
|
|
- @ApiImplicitParams(value = {
|
|
|
- @ApiImplicitParam(name = "id", value = "计量申请id", required = true),
|
|
|
- })
|
|
|
- public R<MiddleMeterApplyVO> detail(Long id) {
|
|
|
- MiddleMeterApplyVO vo = middleMeterApplyService.detail(id);
|
|
|
- return R.data(vo);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 修改 中间计量申请表
|
|
|
- */
|
|
|
- @PostMapping("/update")
|
|
|
- @ApiOperationSupport(order = 7)
|
|
|
- @ApiOperation(value = "修改", notes = "传入middleMeterApplyDTO")
|
|
|
- public R update(@Valid @RequestBody MiddleMeterApplyDTO dto) {
|
|
|
- middleMeterApplyService.update2(dto);
|
|
|
- return R.success("修改成功");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 分页 中间计量申请表
|
|
|
- */
|
|
|
- @GetMapping("/page")
|
|
|
- @ApiOperationSupport(order = 8)
|
|
|
- @ApiOperation(value = "分页", notes = "传合同id,节点id,计量期id和分页信息")
|
|
|
- @ApiImplicitParams(value = {
|
|
|
- @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
|
|
|
- @ApiImplicitParam(name = "contractUnitId", value = "节点id", required = true),
|
|
|
- @ApiImplicitParam(name = "contractPeriodId", value = "合同计量期id", required = true),
|
|
|
- @ApiImplicitParam(name = "type", value = "类型1按部位排序2按时间排序", required = true)
|
|
|
- })
|
|
|
- public R<IPage<MiddleMeterApplyVO>> list(MiddleMeterApply middleMeterApply, Query query,Integer type) {
|
|
|
- IPage<MiddleMeterApplyVO> pages = middleMeterApplyService.page2(middleMeterApply,query,type);
|
|
|
- return R.data(pages);
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 删除 中间计量申请表
|
|
|
- */
|
|
|
- @PostMapping("/remove")
|
|
|
- @ApiOperationSupport(order = 9)
|
|
|
- @ApiOperation(value = "逻辑删除", notes = "传入ids")
|
|
|
- public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
|
- middleMeterApplyService.delete(Func.toLongList(ids));
|
|
|
- return R.success("删除成功");
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 清单明细
|
|
|
- */
|
|
|
- @GetMapping("/formDetail")
|
|
|
- @ApiOperationSupport(order = 10)
|
|
|
- @ApiOperation(value = "清单明细", notes = "传入合同id,合同计量期id,返回值包含展开明细")
|
|
|
- @ApiImplicitParams(value = {
|
|
|
- @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
|
|
|
- @ApiImplicitParam(name = "contractPeriodId", value = "合同计量期id", required = true)
|
|
|
- })
|
|
|
- public R<List<MeterInventoryDetailVO>> formDetail(MiddleMeterApply middleMeterApply) {
|
|
|
- return R.data(middleMeterApplyService.formDetail(middleMeterApply));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取计量单编号
|
|
|
- */
|
|
|
- @GetMapping("/getMeterNumber")
|
|
|
- @ApiOperationSupport(order = 11)
|
|
|
- @ApiOperation(value = "获取计量单编号", notes = "传入合同id,合同计量期id,返回值为计量单编号")
|
|
|
- @ApiImplicitParams(value = {
|
|
|
- @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
|
|
|
- @ApiImplicitParam(name = "contractPeriodId", value = "合同计量期id", required = true)
|
|
|
- })
|
|
|
- public R<String> getMeterNumber(MiddleMeterApply middleMeterApply) {
|
|
|
- return R.data(middleMeterApplyService.getMeterNumber(middleMeterApply));
|
|
|
- }
|
|
|
-
|
|
|
- /**
|
|
|
- * 获取本期计量总金额
|
|
|
- */
|
|
|
- @GetMapping("/getCurrentMeterMoney")
|
|
|
- @ApiOperationSupport(order = 12)
|
|
|
- @ApiOperation(value = "获取本期计量总金额", notes = "传入合同id,合同计量期id,返回值为总金额")
|
|
|
- @ApiImplicitParams(value = {
|
|
|
- @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
|
|
|
- @ApiImplicitParam(name = "contractPeriodId", value = "合同计量期id", required = true)
|
|
|
- })
|
|
|
- public R<BigDecimal> getCurrentMeterMoney(MiddleMeterApply middleMeterApply) {
|
|
|
- return R.data(middleMeterApplyService.getCurrentMeterMoney(middleMeterApply));
|
|
|
- }
|
|
|
-
|
|
|
- @GetMapping("/test")
|
|
|
- public R<String> test() {
|
|
|
- return R.data(middleMeterApplyService.test());
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
+ private final IMiddleMeterApplyService middleMeterApplyService;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加清单
|
|
|
+ */
|
|
|
+ @GetMapping("/addFormList")
|
|
|
+ @ApiOperationSupport(order = 1)
|
|
|
+ @ApiOperation(value = "添加清单", notes = "传入节点id合同段id和已经存在的清单id,逗号分隔.返回清单集合")
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
|
|
|
+ @ApiImplicitParam(name = "nodeId", value = "节点id", required = true),
|
|
|
+ @ApiImplicitParam(name = "ids", value = "已经存在的清单id,逗号分隔", required = true),
|
|
|
+ @ApiImplicitParam(name = "contractPeriodId", value = "合同计量期id", required = true),
|
|
|
+ @ApiImplicitParam(name = "id", value = "中间计量申请的id", required = true),
|
|
|
+ @ApiImplicitParam(name = "taskId", value = "任务id(任务查看时传入)")
|
|
|
+ })
|
|
|
+ public R<List<ResolveInventoryVO>> addFormList(Long id, Long contractId, Long contractPeriodId, Long nodeId, String ids, String taskId) {
|
|
|
+ List<ResolveInventoryVO> vos = middleMeterApplyService.addFormList(id, contractId, contractPeriodId, nodeId, ids, taskId);
|
|
|
+ return R.data(vos);
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 添加分解清单
|
|
|
+ */
|
|
|
+ @GetMapping("/addResolveForm")
|
|
|
+ @ApiOperationSupport(order = 2)
|
|
|
+ @ApiOperation(value = "添加分解清单", notes = "传入选中的行的id,逗号分隔.返回计量清单列表")
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
|
|
|
+ @ApiImplicitParam(name = "nodeId", value = "节点id", required = true),
|
|
|
+ @ApiImplicitParam(name = "ids", value = "传入选中的行的id,逗号分隔", required = true)
|
|
|
+ })
|
|
|
+ public R<List<MeterInventoryVO>> addResolveForm(Long contractId, Long nodeId, String ids) {
|
|
|
+ List<MeterInventoryVO> vos = middleMeterApplyService.addResolveForm(contractId, nodeId, ids);
|
|
|
+ return R.data(vos);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取当前节点工程划分
|
|
|
+ */
|
|
|
+ @GetMapping("/getNodeDivide")
|
|
|
+ @ApiOperationSupport(order = 3)
|
|
|
+ @ApiOperation(value = "获取当前节点工程划分", notes = "传入节点id")
|
|
|
+ public R<String> getNodeDivide(Long nodeId) {
|
|
|
+ return R.data(middleMeterApplyService.getNodeDivide(nodeId));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取当前节点变更令
|
|
|
+ */
|
|
|
+ @GetMapping("/getNodeToken")
|
|
|
+ @ApiOperationSupport(order = 4)
|
|
|
+ @ApiOperation(value = "获取变更编号,附件", notes = "传入合同id,节点id,和所有清单id逗号拼接,业务日期")
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
|
|
|
+ @ApiImplicitParam(name = "nodeId", value = "节点id", required = true),
|
|
|
+ @ApiImplicitParam(name = "formIds", value = "所有计量清单id,逗号分隔", required = true),
|
|
|
+ @ApiImplicitParam(name = "businessDate", value = "业务日期", required = true)
|
|
|
+ })
|
|
|
+ public R<MiddleMeterTokenVO> getNodeToken(Long contractId, Long nodeId, String formIds, String businessDate) {
|
|
|
+ return R.data(middleMeterApplyService.getNodeToken(contractId, nodeId, formIds, businessDate));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 新增 中间计量申请表
|
|
|
+ */
|
|
|
+ @PostMapping("/add")
|
|
|
+ @ApiOperationSupport(order = 5)
|
|
|
+ @ApiOperation(value = "新增", notes = "传入middleMeterApplyDTO")
|
|
|
+ public R save(@Valid @RequestBody MiddleMeterApplyDTO dto) {
|
|
|
+ middleMeterApplyService.add(dto);
|
|
|
+ return R.success("新增成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取详情
|
|
|
+ */
|
|
|
+ @GetMapping("/detail")
|
|
|
+ @ApiOperationSupport(order = 6)
|
|
|
+ @ApiOperation(value = "获取详情", notes = "传入id,返回详情,修改时回显")
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
+ @ApiImplicitParam(name = "id", value = "计量申请id", required = true),
|
|
|
+ })
|
|
|
+ public R<MiddleMeterApplyVO> detail(Long id) {
|
|
|
+ MiddleMeterApplyVO vo = middleMeterApplyService.detail(id);
|
|
|
+ return R.data(vo);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 修改 中间计量申请表
|
|
|
+ */
|
|
|
+ @PostMapping("/update")
|
|
|
+ @ApiOperationSupport(order = 7)
|
|
|
+ @ApiOperation(value = "修改", notes = "传入middleMeterApplyDTO")
|
|
|
+ public R update(@Valid @RequestBody MiddleMeterApplyDTO dto) {
|
|
|
+ middleMeterApplyService.update2(dto);
|
|
|
+ return R.success("修改成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 分页 中间计量申请表
|
|
|
+ */
|
|
|
+ @GetMapping("/page")
|
|
|
+ @ApiOperationSupport(order = 8)
|
|
|
+ @ApiOperation(value = "分页", notes = "传合同id,节点id,计量期id和分页信息")
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
|
|
|
+ @ApiImplicitParam(name = "contractUnitId", value = "节点id", required = true),
|
|
|
+ @ApiImplicitParam(name = "contractPeriodId", value = "合同计量期id", required = true),
|
|
|
+ @ApiImplicitParam(name = "type", value = "类型1按部位排序2按时间排序", required = true)
|
|
|
+ })
|
|
|
+ public R<IPage<MiddleMeterApplyVO>> list(MiddleMeterApply middleMeterApply, Query query, Integer type) {
|
|
|
+ IPage<MiddleMeterApplyVO> pages = middleMeterApplyService.page2(middleMeterApply, query, type);
|
|
|
+ return R.data(pages);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 删除 中间计量申请表
|
|
|
+ */
|
|
|
+ @PostMapping("/remove")
|
|
|
+ @ApiOperationSupport(order = 9)
|
|
|
+ @ApiOperation(value = "逻辑删除", notes = "传入ids")
|
|
|
+ public R remove(@ApiParam(value = "主键集合", required = true) @RequestParam String ids) {
|
|
|
+ middleMeterApplyService.delete(Func.toLongList(ids));
|
|
|
+ return R.success("删除成功");
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 清单明细
|
|
|
+ */
|
|
|
+ @GetMapping("/formDetail")
|
|
|
+ @ApiOperationSupport(order = 10)
|
|
|
+ @ApiOperation(value = "清单明细", notes = "传入合同id,合同计量期id,返回值包含展开明细")
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
|
|
|
+ @ApiImplicitParam(name = "contractPeriodId", value = "合同计量期id", required = true)
|
|
|
+ })
|
|
|
+ public R<List<MeterInventoryDetailVO>> formDetail(MiddleMeterApply middleMeterApply) {
|
|
|
+ return R.data(middleMeterApplyService.formDetail(middleMeterApply));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取计量单编号
|
|
|
+ */
|
|
|
+ @GetMapping("/getMeterNumber")
|
|
|
+ @ApiOperationSupport(order = 11)
|
|
|
+ @ApiOperation(value = "获取计量单编号", notes = "传入合同id,合同计量期id,返回值为计量单编号")
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
|
|
|
+ @ApiImplicitParam(name = "contractPeriodId", value = "合同计量期id", required = true)
|
|
|
+ })
|
|
|
+ public R<String> getMeterNumber(MiddleMeterApply middleMeterApply) {
|
|
|
+ return R.data(middleMeterApplyService.getMeterNumber(middleMeterApply));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取本期计量总金额
|
|
|
+ */
|
|
|
+ @GetMapping("/getCurrentMeterMoney")
|
|
|
+ @ApiOperationSupport(order = 12)
|
|
|
+ @ApiOperation(value = "获取本期计量总金额", notes = "传入合同id,合同计量期id,返回值为总金额")
|
|
|
+ @ApiImplicitParams(value = {
|
|
|
+ @ApiImplicitParam(name = "contractId", value = "合同id", required = true),
|
|
|
+ @ApiImplicitParam(name = "contractPeriodId", value = "合同计量期id", required = true)
|
|
|
+ })
|
|
|
+ public R<BigDecimal> getCurrentMeterMoney(MiddleMeterApply middleMeterApply) {
|
|
|
+ return R.data(middleMeterApplyService.getCurrentMeterMoney(middleMeterApply));
|
|
|
+ }
|
|
|
+
|
|
|
+ @GetMapping("/test")
|
|
|
+ public R<String> test() {
|
|
|
+ return R.data(middleMeterApplyService.test());
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
}
|