From f95d05316d49bcdd31d022a11d0fc4fbafb040da Mon Sep 17 00:00:00 2001 From: cuilei <ray_tsu1@163.com> Date: 星期一, 08 九月 2025 11:40:01 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/master' --- src/main/java/org/jeecg/modules/lsw/controller/LswMaterialInboundController.java | 21 ++++++++++++++++----- 1 files changed, 16 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/jeecg/modules/lsw/controller/LswMaterialInboundController.java b/src/main/java/org/jeecg/modules/lsw/controller/LswMaterialInboundController.java index 003adb1..26cf4b4 100644 --- a/src/main/java/org/jeecg/modules/lsw/controller/LswMaterialInboundController.java +++ b/src/main/java/org/jeecg/modules/lsw/controller/LswMaterialInboundController.java @@ -6,11 +6,12 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; +import org.apache.shiro.SecurityUtils; import org.jeecg.common.api.vo.Result; import org.jeecg.common.aspect.annotation.AutoLog; import org.jeecg.common.system.base.controller.JeecgController; import org.jeecg.common.system.query.QueryGenerator; -import org.jeecg.modules.lsw.entity.LswMaterial; +import org.jeecg.common.system.vo.LoginUser; import org.jeecg.modules.lsw.entity.LswMaterialInbound; import org.jeecg.modules.lsw.service.ILswMaterialInboundService; import org.springframework.beans.factory.annotation.Autowired; @@ -30,7 +31,7 @@ */ @Api(tags="鐗╂枡鍏ュ簱鍗�") @RestController -@RequestMapping("/lswmaterialinbound/lswMaterialInbound") +@RequestMapping("/lsw/materialInbound") @Slf4j public class LswMaterialInboundController extends JeecgController<LswMaterialInbound, ILswMaterialInboundService> { @Autowired @@ -66,11 +67,21 @@ */ @AutoLog(value = "鐗╂枡鍏ュ簱鍗�-娣诲姞") @ApiOperation(value="鐗╂枡鍏ュ簱鍗�-娣诲姞", notes="鐗╂枡鍏ュ簱鍗�-娣诲姞") - //@RequiresPermissions("org.jeecg.modules:lsw_material_inbound:add") @PostMapping(value = "/add") public Result<String> add(@RequestBody LswMaterialInbound lswMaterialInbound) { - lswMaterialInboundService.save(lswMaterialInbound); - return Result.OK("娣诲姞鎴愬姛锛�"); + if(lswMaterialInbound == null){ + return Result.error("鍏ュ簱淇℃伅涓嶈兘涓虹┖锛�"); + } + LoginUser sysUser = (LoginUser) SecurityUtils.getSubject().getPrincipal(); + if(sysUser == null){ + return Result.error("鐢ㄦ埛淇℃伅鑾峰彇澶辫触锛�"); + } + lswMaterialInbound.setReceiver(sysUser.getUsername()); + boolean b = lswMaterialInboundService.inboundMaterial(lswMaterialInbound); + if(!b) { + return Result.error("鍏ュ簱澶辫触锛�"); + } + return Result.OK("鍏ュ簱鎴愬姛锛�"); } /** -- Gitblit v1.9.3