From 20fece55233ec20ac8b289151162a255a8ef09d1 Mon Sep 17 00:00:00 2001 From: zhangfeng <1603559716@qq.com> Date: 星期一, 16 一月 2023 08:35:05 +0800 Subject: [PATCH] 安全物资和设备优化 --- equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/SafeMaterialDetailController.java | 43 +++++++++++++++++++++++-------------------- 1 files changed, 23 insertions(+), 20 deletions(-) diff --git a/equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/SafeMaterialDetailController.java b/equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/SafeMaterialDetailController.java index 2f399c1..bc58e55 100644 --- a/equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/SafeMaterialDetailController.java +++ b/equipment/equipment-service/src/main/java/com/gkhy/safePlatform/equipment/controller/SafeMaterialDetailController.java @@ -1,6 +1,7 @@ package com.gkhy.safePlatform.equipment.controller; import com.alibaba.fastjson.JSONObject; +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.vo.ResultVO; @@ -46,15 +47,7 @@ public ResultVO update(Authentication authentication,@Validated @RequestBody SafeMaterialDetailReq req){ return safeMaterialDetailService.update(req); } - /** - * 单独出入库 - * @param authentication - * @return - */ - @PostMapping(value = "/single/delivery0rReceipt") - public ResultVO singleDdelivery0rReceipt(Authentication authentication, @Validated @RequestBody SafeMaterialDetailReq req){ - return safeMaterialDetailService.singleDdelivery0rReceipt(req); - } + /** * 单独出库 @@ -63,7 +56,9 @@ */ @PostMapping(value = "/single/delivery") public ResultVO singleDelivery(Authentication authentication, @Validated @RequestBody SafeMaterialDetailReq req){ - return safeMaterialDetailService.singleDelivery(req); + ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); + safeMaterialDetailService.singleDelivery(currentUser,req); + return new ResultVO(ResultCodes.OK); } /** @@ -73,8 +68,10 @@ */ @PostMapping(value = "/single/receipt") public ResultVO singleReceipt(Authentication authentication,@RequestBody JSONObject jsonObject){ + ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); Long id = jsonObject.getLong("id"); - return safeMaterialDetailService.singleReceipt(id); + safeMaterialDetailService.singleReceipt(id,currentUser); + return new ResultVO(ResultCodes.OK); } /** * 批量出库 - 根据ids @@ -83,8 +80,9 @@ */ @PostMapping(value = "/batch/delivery/ids") public ResultVO deliveryBatchByIds(Authentication authentication, @Validated @RequestBody MterialDeliveryReq req){ - - return safeMaterialDetailService.deliveryBatchByIds(req); + ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); + safeMaterialDetailService.deliveryBatchByIds(req,currentUser); + return new ResultVO(ResultCodes.OK); } /** * 批量出库 @@ -93,15 +91,18 @@ */ @PostMapping(value = "/batch/delivery/random") public ResultVO deliveryBatchRandom(Authentication authentication,@Validated @RequestBody MterialRandomDeliveryReq req){ - return safeMaterialDetailService.deliveryBatchRandom(req); + ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); + safeMaterialDetailService.deliveryBatchBySmId(req,currentUser); + return new ResultVO(ResultCodes.OK); } /** * 批量重新入库 */ @PostMapping(value = "/batch/receipt") - public ResultVO receiptBatch(Authentication authentication, @RequestBody Long[] ids){ - return safeMaterialDetailService.receiptBatch(ids); + public ResultVO receiptBatch(Authentication authentication ,@Validated @RequestBody ParamForm paramForm){ + ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); + return safeMaterialDetailService.receiptBatch(paramForm); } /** * 删除-单条 @@ -120,8 +121,9 @@ * @return */ @PostMapping(value = "/deleteBatch") - public ResultVO deleteBatch(Authentication authentication,@RequestBody Long[] ids){ - return safeMaterialDetailService.deleteBatch(ids); + public ResultVO deleteBatch(Authentication authentication,@Validated @RequestBody ParamForm paramForm){ + ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); + return safeMaterialDetailService.deleteBatch(currentUser,paramForm); } @@ -132,7 +134,8 @@ */ @PostMapping(value = "/page/list") public SearchResultVO<List<SafeMaterialDetailDto>> listByPage(Authentication authentication, @RequestBody PageQuery<SafeMatetrialDetailQuery> pageQuery){ - return safeMaterialDetailService.listByPage(pageQuery); + ContextCacheUser currentUser = (ContextCacheUser) authentication.getPrincipal(); + return safeMaterialDetailService.listByPage(currentUser,pageQuery); } /** @@ -155,7 +158,7 @@ safeMaterialDetailService.deliveryBatchSpw(req); return new ResultVO<>(ResultCodes.OK); } - /* *//** + /** * 根据rfid获去数据 * @param authentication * @return -- Gitblit v1.9.2