forked from sfms3.0/sfms3.0
5 changed files with 100 additions and 106 deletions
@ -0,0 +1,64 @@ |
|||
package com.win.module.wms.controller.purchasereceiptRecord; |
|||
|
|||
import com.win.framework.common.pojo.CommonResult; |
|||
import com.win.framework.common.pojo.CustomConditions; |
|||
import com.win.framework.common.pojo.PageResult; |
|||
import com.win.module.system.api.user.AdminUserApi; |
|||
import com.win.module.system.api.user.dto.AdminUserRespDTO; |
|||
import com.win.module.wms.controller.purchasereceiptRecord.vo.PurchaseshortageDetailPageReqVO; |
|||
import com.win.module.wms.controller.purchasereceiptRecord.vo.PurchaseshortageDetailRespVO; |
|||
import com.win.module.wms.convert.purchasereceiptRecord.PurchaseshortageDetailConvert; |
|||
import com.win.module.wms.dal.dataobject.purchasereceiptRecord.PurchaseshortageDetailDO; |
|||
import com.win.module.wms.service.purchasereceiptRecord.PurchaseshortageDetailService; |
|||
import io.swagger.v3.oas.annotations.Operation; |
|||
import io.swagger.v3.oas.annotations.tags.Tag; |
|||
import org.springframework.security.access.prepost.PreAuthorize; |
|||
import org.springframework.validation.annotation.Validated; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
import javax.annotation.Resource; |
|||
import javax.validation.Valid; |
|||
|
|||
import static com.win.framework.common.pojo.CommonResult.success; |
|||
|
|||
@Tag(name = "管理后台 - 采购收货缺货子") |
|||
@RestController |
|||
@RequestMapping("/wms/purchaseshortage-detail") |
|||
@Validated |
|||
public class PurchaseshortageDetailController { |
|||
|
|||
@Resource |
|||
private PurchaseshortageDetailService purchaseshortageDetailService; |
|||
|
|||
@Resource |
|||
private AdminUserApi userApi; |
|||
|
|||
@GetMapping("/page") |
|||
@Operation(summary = "获得采购收货记录子分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:purchaseshortage-detail:query')") |
|||
public CommonResult<PageResult<PurchaseshortageDetailRespVO>> getPurchaseshortageDetailPage(@Valid PurchaseshortageDetailPageReqVO pageVO) { |
|||
PageResult<PurchaseshortageDetailDO> pageResult = purchaseshortageDetailService.getPurchaseshortageDetailPage(pageVO); |
|||
PageResult<PurchaseshortageDetailRespVO> result = PurchaseshortageDetailConvert.INSTANCE.convertPage(pageResult); |
|||
for(PurchaseshortageDetailRespVO vo : result.getList()) { |
|||
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator())); |
|||
//后端创建个字段作为前端展示的虚拟字段
|
|||
vo.setCreator(user.getNickname()); |
|||
} |
|||
return success(result); |
|||
} |
|||
|
|||
@PostMapping("/senior") |
|||
@Operation(summary = "高级搜索获得采购收货记录子信息分页") |
|||
@PreAuthorize("@ss.hasPermission('wms:purchaseshortage-detail:query')") |
|||
public CommonResult<PageResult<PurchaseshortageDetailRespVO>> getPurchaseshortageDetailSenior(@Valid @RequestBody CustomConditions conditions) { |
|||
PageResult<PurchaseshortageDetailDO> pageResult = purchaseshortageDetailService.getPurchaseshortageDetailSenior(conditions); |
|||
PageResult<PurchaseshortageDetailRespVO> result = PurchaseshortageDetailConvert.INSTANCE.convertPage(pageResult); |
|||
for(PurchaseshortageDetailRespVO vo : result.getList()) { |
|||
AdminUserRespDTO user = userApi.getUser(Long.valueOf(vo.getCreator())); |
|||
//后端创建个字段作为前端展示的虚拟字段
|
|||
vo.setCreator(user.getNickname()); |
|||
} |
|||
return success(result); |
|||
} |
|||
|
|||
} |
Loading…
Reference in new issue