Browse Source

采购详情、实施详情修改

tags/24080901
WendyYang 7 months ago
parent
commit
057a7770d0
2 changed files with 6 additions and 2 deletions
  1. +3
    -0
      hz-pm-api/src/main/java/com/hz/pm/api/sys/controller/StagingController.java
  2. +3
    -2
      hz-pm-api/src/main/java/com/hz/pm/api/sys/manage/StagingManage.java

+ 3
- 0
hz-pm-api/src/main/java/com/hz/pm/api/sys/controller/StagingController.java View File

@@ -3,6 +3,7 @@ package com.hz.pm.api.sys.controller;
import com.hz.pm.api.sys.manage.StagingManage; import com.hz.pm.api.sys.manage.StagingManage;
import com.hz.pm.api.sys.model.dto.StagingDTO; import com.hz.pm.api.sys.model.dto.StagingDTO;
import com.hz.pm.api.sys.model.enumeration.StagingType; import com.hz.pm.api.sys.model.enumeration.StagingType;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor; import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
@@ -17,6 +18,7 @@ import javax.validation.Valid;
* @author WendyYang * @author WendyYang
* @since 2024-03-25 * @since 2024-03-25
*/ */
@Api(tags = "通用暂存控制器")
@RestController @RestController
@AllArgsConstructor @AllArgsConstructor
@RequestMapping("/api/v1/staging") @RequestMapping("/api/v1/staging")
@@ -30,6 +32,7 @@ public class StagingController {
stagingManage.save(staging); stagingManage.save(staging);
} }


@ApiOperation("获取暂存详情")
@GetMapping(value = {"/detail/{type}", "/detail/{type}/{bizId}"}) @GetMapping(value = {"/detail/{type}", "/detail/{type}/{bizId}"})
public StagingDTO detail(@PathVariable StagingType type, @PathVariable(required = false) String bizId) { public StagingDTO detail(@PathVariable StagingType type, @PathVariable(required = false) String bizId) {
return stagingManage.detail(type, bizId); return stagingManage.detail(type, bizId);


+ 3
- 2
hz-pm-api/src/main/java/com/hz/pm/api/sys/manage/StagingManage.java View File

@@ -44,7 +44,8 @@ public class StagingManage {
.eq(Staging::getType, type) .eq(Staging::getType, type)
.eq(Staging::getCreateBy, LoginUserUtil.getUserId()) .eq(Staging::getCreateBy, LoginUserUtil.getUserId())
.eq(StrUtil.isNotBlank(bizId), Staging::getBizId, bizId) .eq(StrUtil.isNotBlank(bizId), Staging::getBizId, bizId)
.orderByDesc(Staging::getCreateOn, Staging::getId)
.orderByDesc(Staging::getCreateOn)
.orderByDesc(Staging::getId)
.last(BizConst.LIMIT_1); .last(BizConst.LIMIT_1);
Staging staging = stagingService.getOne(query); Staging staging = stagingService.getOne(query);
if (staging == null) { if (staging == null) {
@@ -52,7 +53,7 @@ public class StagingManage {
} }
StagingDTO detail = new StagingDTO(); StagingDTO detail = new StagingDTO();
detail.setId(staging.getId()); detail.setId(staging.getId());
detail.setContent(staging.getType());
detail.setContent(staging.getContent());
detail.setType(StagingType.valueOf(staging.getType())); detail.setType(StagingType.valueOf(staging.getType()));
detail.setBizId(staging.getBizId()); detail.setBizId(staging.getBizId());
return detail; return detail;


Loading…
Cancel
Save