PreventRepeatSubmit
This commit is contained in:
parent
e834d015d9
commit
9a723b103b
|
|
@ -3,6 +3,7 @@ package com.bonus.material.back.controller;
|
|||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -27,7 +28,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
|||
* 退料任务详细Controller
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-09-26
|
||||
* @date 2024-09-27
|
||||
*/
|
||||
@Api(tags = "退料任务详细接口")
|
||||
@RestController
|
||||
|
|
@ -54,6 +55,7 @@ public class BackApplyDetailsController extends BaseController
|
|||
* 导出退料任务详细列表
|
||||
*/
|
||||
@ApiOperation(value = "导出退料任务详细列表")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("back:details:export")
|
||||
@SysLog(title = "退料任务详细", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出退料任务详细")
|
||||
@PostMapping("/export")
|
||||
|
|
@ -79,6 +81,7 @@ public class BackApplyDetailsController extends BaseController
|
|||
* 新增退料任务详细
|
||||
*/
|
||||
@ApiOperation(value = "新增退料任务详细")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("back:details:add")
|
||||
@SysLog(title = "退料任务详细", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增退料任务详细")
|
||||
@PostMapping
|
||||
|
|
@ -91,6 +94,7 @@ public class BackApplyDetailsController extends BaseController
|
|||
* 修改退料任务详细
|
||||
*/
|
||||
@ApiOperation(value = "修改退料任务详细")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("back:details:edit")
|
||||
@SysLog(title = "退料任务详细", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改退料任务详细")
|
||||
@PutMapping
|
||||
|
|
@ -103,6 +107,7 @@ public class BackApplyDetailsController extends BaseController
|
|||
* 删除退料任务详细
|
||||
*/
|
||||
@ApiOperation(value = "删除退料任务详细")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("back:details:remove")
|
||||
@SysLog(title = "退料任务详细", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除退料任务详细")
|
||||
@DeleteMapping("/{ids}")
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.back.controller;
|
|||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -27,7 +28,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
|||
* 退料任务Controller
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-09-26
|
||||
* @date 2024-09-27
|
||||
*/
|
||||
@Api(tags = "退料任务接口")
|
||||
@RestController
|
||||
|
|
@ -54,6 +55,7 @@ public class BackApplyInfoController extends BaseController
|
|||
* 导出退料任务列表
|
||||
*/
|
||||
@ApiOperation(value = "导出退料任务列表")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("back:info:export")
|
||||
@SysLog(title = "退料任务", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出退料任务")
|
||||
@PostMapping("/export")
|
||||
|
|
@ -79,6 +81,7 @@ public class BackApplyInfoController extends BaseController
|
|||
* 新增退料任务
|
||||
*/
|
||||
@ApiOperation(value = "新增退料任务")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("back:info:add")
|
||||
@SysLog(title = "退料任务", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增退料任务")
|
||||
@PostMapping
|
||||
|
|
@ -91,6 +94,7 @@ public class BackApplyInfoController extends BaseController
|
|||
* 修改退料任务
|
||||
*/
|
||||
@ApiOperation(value = "修改退料任务")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("back:info:edit")
|
||||
@SysLog(title = "退料任务", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改退料任务")
|
||||
@PutMapping
|
||||
|
|
@ -103,6 +107,7 @@ public class BackApplyInfoController extends BaseController
|
|||
* 删除退料任务
|
||||
*/
|
||||
@ApiOperation(value = "删除退料任务")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("back:info:remove")
|
||||
@SysLog(title = "退料任务", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除退料任务")
|
||||
@DeleteMapping("/{ids}")
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.back.controller;
|
|||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import com.bonus.common.log.enums.OperaType;
|
||||
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
|
@ -27,7 +28,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
|||
* 退料核查Controller
|
||||
*
|
||||
* @author xsheng
|
||||
* @date 2024-09-26
|
||||
* @date 2024-09-27
|
||||
*/
|
||||
@Api(tags = "退料核查接口")
|
||||
@RestController
|
||||
|
|
@ -54,6 +55,7 @@ public class BackCheckDetailsController extends BaseController
|
|||
* 导出退料核查列表
|
||||
*/
|
||||
@ApiOperation(value = "导出退料核查列表")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("back:details:export")
|
||||
@SysLog(title = "退料核查", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出退料核查")
|
||||
@PostMapping("/export")
|
||||
|
|
@ -79,6 +81,7 @@ public class BackCheckDetailsController extends BaseController
|
|||
* 新增退料核查
|
||||
*/
|
||||
@ApiOperation(value = "新增退料核查")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("back:details:add")
|
||||
@SysLog(title = "退料核查", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增退料核查")
|
||||
@PostMapping
|
||||
|
|
@ -91,6 +94,7 @@ public class BackCheckDetailsController extends BaseController
|
|||
* 修改退料核查
|
||||
*/
|
||||
@ApiOperation(value = "修改退料核查")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("back:details:edit")
|
||||
@SysLog(title = "退料核查", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改退料核查")
|
||||
@PutMapping
|
||||
|
|
@ -103,6 +107,7 @@ public class BackCheckDetailsController extends BaseController
|
|||
* 删除退料核查
|
||||
*/
|
||||
@ApiOperation(value = "删除退料核查")
|
||||
@PreventRepeatSubmit
|
||||
@RequiresPermissions("back:details:remove")
|
||||
@SysLog(title = "退料核查", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除退料核查")
|
||||
@DeleteMapping("/{ids}")
|
||||
|
|
|
|||
|
|
@ -1,50 +0,0 @@
|
|||
package com.bonus.material.common.utils;
|
||||
|
||||
import com.bonus.common.core.web.domain.BaseEntity;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import com.bonus.system.api.domain.SysRole;
|
||||
import com.bonus.system.api.domain.SysUser;
|
||||
import com.bonus.system.api.model.LoginUser;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
public class CommonDataPermissionInfo {
|
||||
|
||||
public static BaseEntity backMissionInfo(String dataScope){
|
||||
BaseEntity entity = new BaseEntity();
|
||||
Set<Long> roleIds = new HashSet<>();
|
||||
LoginUser loginUser = SecurityUtils.getLoginUser();
|
||||
if (loginUser != null) {
|
||||
SysUser sysUser = loginUser.getSysUser();
|
||||
if (sysUser != null) {
|
||||
Long deptId = sysUser.getDeptId();
|
||||
entity.setNewUserId(sysUser.getUserId());
|
||||
List<SysRole> roles = sysUser.getRoles();
|
||||
if (roles != null) {
|
||||
entity.setNewdeptId(deptId);
|
||||
// 如果需要记录多个角色ID,可以使用Set或List
|
||||
for (SysRole role : roles) {
|
||||
roleIds.add(role.getRoleId());
|
||||
entity.setMissionSource(role.getDataScope());
|
||||
// 只在第一次迭代时设置dataScope,且dataScope不为空的情况下
|
||||
if (dataScope.isEmpty() && !"".equals(role.getDataScope())) {
|
||||
entity.setMissionSource(dataScope);
|
||||
break;
|
||||
}else if(roles.size()>1){
|
||||
entity.setMissionSource(4+"");
|
||||
}
|
||||
|
||||
// 设置角色ID集合
|
||||
entity.setNewrole(roleIds);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return entity;
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue