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 java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -27,7 +28,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
||||||
* 退料任务详细Controller
|
* 退料任务详细Controller
|
||||||
*
|
*
|
||||||
* @author xsheng
|
* @author xsheng
|
||||||
* @date 2024-09-26
|
* @date 2024-09-27
|
||||||
*/
|
*/
|
||||||
@Api(tags = "退料任务详细接口")
|
@Api(tags = "退料任务详细接口")
|
||||||
@RestController
|
@RestController
|
||||||
|
|
@ -54,6 +55,7 @@ public class BackApplyDetailsController extends BaseController
|
||||||
* 导出退料任务详细列表
|
* 导出退料任务详细列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "导出退料任务详细列表")
|
@ApiOperation(value = "导出退料任务详细列表")
|
||||||
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("back:details:export")
|
@RequiresPermissions("back:details:export")
|
||||||
@SysLog(title = "退料任务详细", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出退料任务详细")
|
@SysLog(title = "退料任务详细", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出退料任务详细")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
|
|
@ -79,6 +81,7 @@ public class BackApplyDetailsController extends BaseController
|
||||||
* 新增退料任务详细
|
* 新增退料任务详细
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "新增退料任务详细")
|
@ApiOperation(value = "新增退料任务详细")
|
||||||
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("back:details:add")
|
@RequiresPermissions("back:details:add")
|
||||||
@SysLog(title = "退料任务详细", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增退料任务详细")
|
@SysLog(title = "退料任务详细", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增退料任务详细")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
|
|
@ -91,6 +94,7 @@ public class BackApplyDetailsController extends BaseController
|
||||||
* 修改退料任务详细
|
* 修改退料任务详细
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "修改退料任务详细")
|
@ApiOperation(value = "修改退料任务详细")
|
||||||
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("back:details:edit")
|
@RequiresPermissions("back:details:edit")
|
||||||
@SysLog(title = "退料任务详细", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改退料任务详细")
|
@SysLog(title = "退料任务详细", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改退料任务详细")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
|
|
@ -103,6 +107,7 @@ public class BackApplyDetailsController extends BaseController
|
||||||
* 删除退料任务详细
|
* 删除退料任务详细
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "删除退料任务详细")
|
@ApiOperation(value = "删除退料任务详细")
|
||||||
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("back:details:remove")
|
@RequiresPermissions("back:details:remove")
|
||||||
@SysLog(title = "退料任务详细", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除退料任务详细")
|
@SysLog(title = "退料任务详细", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除退料任务详细")
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.back.controller;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -27,7 +28,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
||||||
* 退料任务Controller
|
* 退料任务Controller
|
||||||
*
|
*
|
||||||
* @author xsheng
|
* @author xsheng
|
||||||
* @date 2024-09-26
|
* @date 2024-09-27
|
||||||
*/
|
*/
|
||||||
@Api(tags = "退料任务接口")
|
@Api(tags = "退料任务接口")
|
||||||
@RestController
|
@RestController
|
||||||
|
|
@ -54,6 +55,7 @@ public class BackApplyInfoController extends BaseController
|
||||||
* 导出退料任务列表
|
* 导出退料任务列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "导出退料任务列表")
|
@ApiOperation(value = "导出退料任务列表")
|
||||||
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("back:info:export")
|
@RequiresPermissions("back:info:export")
|
||||||
@SysLog(title = "退料任务", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出退料任务")
|
@SysLog(title = "退料任务", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出退料任务")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
|
|
@ -79,6 +81,7 @@ public class BackApplyInfoController extends BaseController
|
||||||
* 新增退料任务
|
* 新增退料任务
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "新增退料任务")
|
@ApiOperation(value = "新增退料任务")
|
||||||
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("back:info:add")
|
@RequiresPermissions("back:info:add")
|
||||||
@SysLog(title = "退料任务", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增退料任务")
|
@SysLog(title = "退料任务", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增退料任务")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
|
|
@ -91,6 +94,7 @@ public class BackApplyInfoController extends BaseController
|
||||||
* 修改退料任务
|
* 修改退料任务
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "修改退料任务")
|
@ApiOperation(value = "修改退料任务")
|
||||||
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("back:info:edit")
|
@RequiresPermissions("back:info:edit")
|
||||||
@SysLog(title = "退料任务", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改退料任务")
|
@SysLog(title = "退料任务", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改退料任务")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
|
|
@ -103,6 +107,7 @@ public class BackApplyInfoController extends BaseController
|
||||||
* 删除退料任务
|
* 删除退料任务
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "删除退料任务")
|
@ApiOperation(value = "删除退料任务")
|
||||||
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("back:info:remove")
|
@RequiresPermissions("back:info:remove")
|
||||||
@SysLog(title = "退料任务", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除退料任务")
|
@SysLog(title = "退料任务", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除退料任务")
|
||||||
@DeleteMapping("/{ids}")
|
@DeleteMapping("/{ids}")
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ package com.bonus.material.back.controller;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import com.bonus.common.log.enums.OperaType;
|
import com.bonus.common.log.enums.OperaType;
|
||||||
|
import com.bonus.material.common.annotation.PreventRepeatSubmit;
|
||||||
import io.swagger.annotations.Api;
|
import io.swagger.annotations.Api;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
|
@ -27,7 +28,7 @@ import com.bonus.common.core.web.page.TableDataInfo;
|
||||||
* 退料核查Controller
|
* 退料核查Controller
|
||||||
*
|
*
|
||||||
* @author xsheng
|
* @author xsheng
|
||||||
* @date 2024-09-26
|
* @date 2024-09-27
|
||||||
*/
|
*/
|
||||||
@Api(tags = "退料核查接口")
|
@Api(tags = "退料核查接口")
|
||||||
@RestController
|
@RestController
|
||||||
|
|
@ -54,6 +55,7 @@ public class BackCheckDetailsController extends BaseController
|
||||||
* 导出退料核查列表
|
* 导出退料核查列表
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "导出退料核查列表")
|
@ApiOperation(value = "导出退料核查列表")
|
||||||
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("back:details:export")
|
@RequiresPermissions("back:details:export")
|
||||||
@SysLog(title = "退料核查", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出退料核查")
|
@SysLog(title = "退料核查", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出退料核查")
|
||||||
@PostMapping("/export")
|
@PostMapping("/export")
|
||||||
|
|
@ -79,6 +81,7 @@ public class BackCheckDetailsController extends BaseController
|
||||||
* 新增退料核查
|
* 新增退料核查
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "新增退料核查")
|
@ApiOperation(value = "新增退料核查")
|
||||||
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("back:details:add")
|
@RequiresPermissions("back:details:add")
|
||||||
@SysLog(title = "退料核查", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增退料核查")
|
@SysLog(title = "退料核查", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增退料核查")
|
||||||
@PostMapping
|
@PostMapping
|
||||||
|
|
@ -91,6 +94,7 @@ public class BackCheckDetailsController extends BaseController
|
||||||
* 修改退料核查
|
* 修改退料核查
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "修改退料核查")
|
@ApiOperation(value = "修改退料核查")
|
||||||
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("back:details:edit")
|
@RequiresPermissions("back:details:edit")
|
||||||
@SysLog(title = "退料核查", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改退料核查")
|
@SysLog(title = "退料核查", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改退料核查")
|
||||||
@PutMapping
|
@PutMapping
|
||||||
|
|
@ -103,6 +107,7 @@ public class BackCheckDetailsController extends BaseController
|
||||||
* 删除退料核查
|
* 删除退料核查
|
||||||
*/
|
*/
|
||||||
@ApiOperation(value = "删除退料核查")
|
@ApiOperation(value = "删除退料核查")
|
||||||
|
@PreventRepeatSubmit
|
||||||
@RequiresPermissions("back:details:remove")
|
@RequiresPermissions("back:details:remove")
|
||||||
@SysLog(title = "退料核查", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除退料核查")
|
@SysLog(title = "退料核查", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除退料核查")
|
||||||
@DeleteMapping("/{ids}")
|
@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