From 5bd5f3bcd6d2cb375feb0756505691b551339716 Mon Sep 17 00:00:00 2001 From: zhangfeng <1603559716@qq.com> Date: 星期五, 23 十二月 2022 08:55:23 +0800 Subject: [PATCH] Merge branch 'master' of https://sinanoaq.cn:8888/r/safePlatform-out into zf --- equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/SafeMaterialReceiveRecordsController.java | 46 ++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 46 insertions(+), 0 deletions(-) diff --git a/equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/SafeMaterialReceiveRecordsController.java b/equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/SafeMaterialReceiveRecordsController.java new file mode 100644 index 0000000..43f4b22 --- /dev/null +++ b/equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/SafeMaterialReceiveRecordsController.java @@ -0,0 +1,46 @@ +package com.gkhy.safePlatform.equipment.controller; + + +import com.gkhy.safePlatform.commons.co.ContextCacheUser; +import com.gkhy.safePlatform.commons.enums.ResultCodes; +import com.gkhy.safePlatform.commons.query.PageQuery; +import com.gkhy.safePlatform.commons.utils.PageUtils; +import com.gkhy.safePlatform.commons.vo.ResultVO; +import com.gkhy.safePlatform.commons.vo.SearchResultVO; +import com.gkhy.safePlatform.equipment.entity.MaterialReceiveRecordsBaseDO; +import com.gkhy.safePlatform.equipment.model.dto.req.MaterialReceiveRecordsBaseReq; +import com.gkhy.safePlatform.equipment.model.dto.req.MaterialReceiveRecordsQuery; +import com.gkhy.safePlatform.equipment.model.dto.resp.MaterialReceiveRecordsBaseDto; +import com.gkhy.safePlatform.equipment.service.MaterialReceiveRecordsService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.security.core.Authentication; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; + +import java.util.List; + + +@RestController +@RequestMapping("/equipment/material/record") +public class SafeMaterialReceiveRecordsController { + @Autowired + private MaterialReceiveRecordsService materialReceiveRecordsService; + + @RequestMapping("page/list") + public SearchResultVO<List<MaterialReceiveRecordsBaseDto>> list(Authentication authentication, @RequestBody PageQuery<MaterialReceiveRecordsQuery> pageQuery){ + ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); + PageUtils.checkCheck(pageQuery); + return materialReceiveRecordsService.listByPage(currentUser,pageQuery); + } + /** + * 归还物资 + */ + @RequestMapping("revert") + public ResultVO revertMaterial(Authentication authentication, @Validated @RequestBody MaterialReceiveRecordsBaseReq req){ + ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); + materialReceiveRecordsService.revertMaterial(currentUser,req); + return new ResultVO(ResultCodes.OK); + } +} -- Gitblit v1.9.2