Browse Source

代码同步

gao.qiang 1 year ago
parent
commit
ff8b9e55bb

+ 1 - 1
business-service/src/main/java/com/ozs/service/entity/BaseRailwayManagement.java

@@ -57,7 +57,7 @@ public class BaseRailwayManagement extends BaseEntity implements Serializable ,C
     /**
      * 线路类型(普铁/高铁 )
      */
-    @Excel(name = "线路类型",readConverterExp = "1=高铁,2=普")
+    @Excel(name = "线路类型",readConverterExp = "1=高铁,2=普")
     private Integer railwayType;
 
     /**

+ 1 - 1
hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseCameraManagementController.java

@@ -248,7 +248,7 @@ public class BaseCameraManagementController extends BaseController {
      * @param accountManagementIds
      * @return
      */
-    @RequestMapping("/{accountManagementIds}")
+    @RequestMapping("/remove/{accountManagementIds}")
     @ApiOperation("删除相机台账管理信息")
     @Log(title = "相机台账管理", businessType = BusinessType.DELETE)
     @Transactional

+ 2 - 2
hazard-admin/src/main/java/com/ozs/web/controller/accountmanagment/BaseRailwayManagementController.java

@@ -104,7 +104,7 @@ public class BaseRailwayManagementController extends BaseController {
      * @param lineIds
      * @return
      */
-    @RequestMapping("/{lineIds}")
+    @RequestMapping("/remove/{lineIds}")
     @ApiOperation("删除线路管理表信息")
     @Log(title = "线路台账管理", businessType = BusinessType.DELETE)
     public AjaxResult removeLineManagement(@PathVariable List<Long> lineIds) {
@@ -300,7 +300,7 @@ public class BaseRailwayManagementController extends BaseController {
     @Log(title = "线路台账管理", businessType = BusinessType.SELECT)
     public AjaxResult query() {
         // List<BaseRailwayManagement> list = baseRailwayManagementService.list();
-        List<BaseRailwayManagement> list = baseRailwayManagementService.listRailway();
+        List<BaseRailwayManagement> list = baseRailwayManagementService.list();
         list.sort(new Comparator<BaseRailwayManagement>() {
             @Override
             public int compare(BaseRailwayManagement o1, BaseRailwayManagement o2) {

+ 3 - 3
hazard-admin/src/main/java/com/ozs/web/controller/system/SysDeptController.java

@@ -128,7 +128,7 @@ public class SysDeptController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:dept:edit')")
     @Log(title = "部门管理", businessType = BusinessType.UPDATE)
-    @RequestMapping
+    @RequestMapping("/edit")
     public AjaxResult edit(@Validated @RequestBody SysDept dept) {
         Long deptId = dept.getDeptId();
         //deptService.checkDeptDataScope(deptId);
@@ -146,7 +146,7 @@ public class SysDeptController extends BaseController {
         }
         SysDept sysDept = deptService.getOne(wq);
         if (ObjectUtils.isNotEmpty(sysDept)) {
-            return error("新增部门'" + dept.getDeptCode() + "'失败,部门编码已存在");
+            return error("修改部门'" + dept.getDeptCode() + "'失败,部门编码已存在");
         }
         dept.setUpdateBy(getUserId());
         return toAjax(deptService.updateDept(dept));
@@ -157,7 +157,7 @@ public class SysDeptController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:dept:remove')")
     @Log(title = "部门管理", businessType = BusinessType.DELETE)
-    @PostMapping("/{deptId}")
+    @RequestMapping("/remove/{deptId}")
     public AjaxResult remove(@PathVariable Long deptId) {
         if (deptService.hasChildByDeptId(deptId)) {
             return warn("存在下级部门,不允许删除");

+ 2 - 2
hazard-admin/src/main/java/com/ozs/web/controller/system/SysDictDataController.java

@@ -147,7 +147,7 @@ public class SysDictDataController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:dict:edit')")
     @Log(title = "字典数据", businessType = BusinessType.UPDATE)
-    @RequestMapping
+    @RequestMapping("/edit")
     public AjaxResult edit(@Validated @RequestBody SysDictData dict)
     {
         dict.setUpdateBy(getUsername());
@@ -162,7 +162,7 @@ public class SysDictDataController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:dict:remove')")
     @Log(title = "字典类型", businessType = BusinessType.DELETE)
-    @RequestMapping("/{dictCodes}")
+    @RequestMapping("remove/{dictCodes}")
     public AjaxResult remove(@PathVariable Long[] dictCodes)
     {
         dictDataService.deleteDictDataByIds(dictCodes);

+ 2 - 2
hazard-admin/src/main/java/com/ozs/web/controller/system/SysDictTypeController.java

@@ -125,7 +125,7 @@ public class SysDictTypeController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:dict:edit')")
     @Log(title = "字典类型", businessType = BusinessType.UPDATE)
-    @RequestMapping
+    @RequestMapping("/update")
     public AjaxResult edit(@Validated @RequestBody SysDictType dict)
     {
         if (UserConstants.NOT_UNIQUE.equals(dictTypeService.checkDictTypeUnique(dict))) {
@@ -143,7 +143,7 @@ public class SysDictTypeController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:dict:remove')")
     @Log(title = "字典类型", businessType = BusinessType.DELETE)
-    @PostMapping("/{dictIds}")
+    @RequestMapping("/remove/{dictIds}")
     public AjaxResult remove(@PathVariable Long[] dictIds)
     {
         dictTypeService.deleteDictTypeByIds(dictIds);

+ 2 - 2
hazard-admin/src/main/java/com/ozs/web/controller/system/SysMenuController.java

@@ -106,7 +106,7 @@ public class SysMenuController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:menu:edit')")
     @Log(title = "菜单管理", businessType = BusinessType.UPDATE)
-    @RequestMapping
+    @RequestMapping("/edit")
     public AjaxResult edit(@Validated @RequestBody SysMenu menu) {
         if (UserConstants.NOT_UNIQUE.equals(menuService.checkMenuNameUnique(menu))) {
             return error("修改菜单'" + menu.getMenuName() + "'失败,菜单名称已存在");
@@ -124,7 +124,7 @@ public class SysMenuController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:menu:remove')")
     @Log(title = "菜单管理", businessType = BusinessType.DELETE)
-    @PostMapping("/{menuId}")
+    @RequestMapping("/remove/{menuId}")
     public AjaxResult remove(@PathVariable("menuId") Long menuId) {
         if (menuService.hasChildByMenuId(menuId)) {
             return warn("存在子菜单,不允许删除");

+ 8 - 2
hazard-admin/src/main/java/com/ozs/web/controller/system/SysRoleController.java

@@ -16,6 +16,7 @@ import com.ozs.common.core.domain.entity.SysMenu;
 import com.ozs.common.core.domain.vo.SysDeptVo;
 import com.ozs.common.core.domain.vo.SysRoleRequestVo;
 import com.ozs.common.core.domain.vo.SysUserVo;
+import com.ozs.common.exception.ServiceException;
 import com.ozs.service.entity.BaseRailwayManagement;
 import com.ozs.service.entity.BaseUser;
 import com.ozs.service.service.BaseUserService;
@@ -162,7 +163,7 @@ public class SysRoleController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:role:edit')")
     @Log(title = "角色管理", businessType = BusinessType.UPDATE)
-    @RequestMapping
+    @RequestMapping("/edit")
     public AjaxResult edit(@Validated @RequestBody SysRole role) {
 //        roleService.checkRoleAllowed(role);
 //        roleService.checkRoleDataScope(role.getRoleId());
@@ -176,6 +177,11 @@ public class SysRoleController extends BaseController {
             }
             return error("超级管理员角色不能修改");
         } else {
+            if ("2".equals(role.getStatus())) {
+                if (roleService.countUserRoleByRoleId(role.getRoleId()) > 0) {
+                    throw new ServiceException(String.format("%1$s已分配,不能禁用", role.getRoleName()));
+                }
+            }
             if (UserConstants.NOT_UNIQUE.equals(roleService.checkRoleKeyUnique(role))) {
                 return error("修改角色'" + role.getRoleName() + "'失败,角色权限已存在");
             }
@@ -228,7 +234,7 @@ public class SysRoleController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:role:remove')")
     @Log(title = "角色管理", businessType = BusinessType.DELETE)
-    @RequestMapping("/{roleIds}")
+    @RequestMapping("remove/{roleIds}")
     public AjaxResult remove(@PathVariable Long[] roleIds) {
         return toAjax(roleService.deleteRoleByIds(roleIds));
     }

+ 3 - 3
hazard-admin/src/main/java/com/ozs/web/controller/system/SysUserController.java

@@ -271,8 +271,8 @@ public class SysUserController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:user:edit')")
     @Log(title = "用户管理", businessType = BusinessType.UPDATE)
-    @RequestMapping(value = "/edit", method = RequestMethod.PUT)
-    public AjaxResult edit(@Validated @RequestBody SysUser user) {
+    @PostMapping("/edit")
+    public AjaxResult edit(@RequestBody SysUser user) {
 //        userService.checkUserAllowed(user);
 //        userService.checkUserDataScope(user.getId());
         BaseUser baseUser = baseUserService.getUserById(user.getId());
@@ -324,7 +324,7 @@ public class SysUserController extends BaseController {
      */
     @PreAuthorize("@ss.hasPermi('system:user:remove')")
     @Log(title = "用户管理", businessType = BusinessType.DELETE)
-    @PostMapping("/{Ids}")
+    @RequestMapping("/remove/{Ids}")
     public AjaxResult remove(@PathVariable Long[] Ids) {
         if (ArrayUtils.contains(Ids, getId())) {
             return error("当前用户不能删除");