Bladeren bron

修改权限字符串

baolei 1 maand geleden
bovenliggende
commit
73bcb01f49

+ 7 - 7
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/business/prodInventory/controller/ProdInventoryController.java

@@ -34,7 +34,7 @@ public class ProdInventoryController extends BaseController {
     @Resource
     private IProdInventoryBillService prodInventoryBillService;
 
-    @RequiresPermissions("business:product:inventory:view")
+    @RequiresPermissions("business:prodInventory:view")
     @GetMapping("/inventory")
     public String prodInventory() {
         return prefix + "/prodInventory";
@@ -43,7 +43,7 @@ public class ProdInventoryController extends BaseController {
     /**
      * 查询商品库存列表
      */
-    @RequiresPermissions("business:prodInventory:list")
+    @RequiresPermissions("business:prodInventory:view")
     @PostMapping("/inventory/list")
     @ResponseBody
     public TableDataInfo inventoryList(ProdInventoryVo prodInventoryVo) {
@@ -55,7 +55,7 @@ public class ProdInventoryController extends BaseController {
         return getDataTable(list);
     }
 
-    @RequiresPermissions("business:product:inventory:view")
+    @RequiresPermissions("business:prodInventory:view")
     @GetMapping("/mercInventory/{mercId}")
     public String inventory(@PathVariable("mercId") Long mercId, ModelMap mmap) {
         mmap.put("mercId", mercId);
@@ -65,7 +65,7 @@ public class ProdInventoryController extends BaseController {
     /**
      * 查询商品库存列表
      */
-    @RequiresPermissions("business:prodInventory:list")
+    @RequiresPermissions("business:prodInventory:view")
     @PostMapping("/mercInventory/list")
     @ResponseBody
     public TableDataInfo mercInventoryList(ProdInventoryVo prodInventoryVo) {
@@ -77,7 +77,7 @@ public class ProdInventoryController extends BaseController {
     /**
      * 新增保存商品库存
      */
-    @RequiresPermissions("business:prodInventory:add")
+    @RequiresPermissions("business:prodInventory:edit")
     @Log(title = "商品库存", businessType = BusinessType.INSERT)
     @PostMapping("/mercInventory/add")
     @ResponseBody
@@ -88,7 +88,7 @@ public class ProdInventoryController extends BaseController {
     /**
      * 新增保存商品库存
      */
-    @RequiresPermissions("business:prodInventory:detail")
+    @RequiresPermissions("business:prodInventory:view")
     @GetMapping("/inventory/detail/{prodInventoryId}")
     public String detail(@PathVariable("prodInventoryId") Long prodInventoryId, ModelMap mmap) {
         mmap.put("prodInventoryId", prodInventoryId);
@@ -98,7 +98,7 @@ public class ProdInventoryController extends BaseController {
     /**
      * 新增保存商品库存
      */
-    @RequiresPermissions("business:prodInventory:detail")
+    @RequiresPermissions("business:prodInventory:view")
     @PostMapping("/inventory/detailList")
     @ResponseBody
     public TableDataInfo detailList(ProdInventoryBill prodInventoryBill) {

+ 1 - 1
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/merchant/controller/MerchantProdController.java

@@ -56,7 +56,7 @@ public class MerchantProdController extends BaseController {
     /**
      * 查询店铺商品列表
      */
-    @RequiresPermissions("master:merchant:prod:list")
+    @RequiresPermissions("master:merchant:prod:view")
     @PostMapping("/list")
     @ResponseBody
     public TableDataInfo list(MerchantProdVo merchantProdVo) {

+ 1 - 1
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/master/product/controller/ProdAttrPriceController.java

@@ -39,7 +39,7 @@ public class ProdAttrPriceController extends BaseController {
     @Resource
     private IProdAttrPriceVoService prodAttrPriceVoService;
 
-    @RequiresPermissions("master:product:prodAttrPrice:viewPrice")
+    @RequiresPermissions("master:product:prodAttrPrice:editPrice")
     @GetMapping()
     public String price(@RequestParam("mercProdId") Long mercProdId, ModelMap mMap) {
         MerchantProdVo merchantProdVo = merchantProdVoService.selectMerchantProdVoById(mercProdId);

+ 9 - 0
08.src/Xingxi/xingxi-admin/src/main/java/com/xingxi/web/controller/system/controller/SysUserController.java

@@ -1,5 +1,6 @@
 package com.xingxi.web.controller.system.controller;
 
+import java.util.Collections;
 import java.util.List;
 import java.util.stream.Collectors;
 
@@ -136,6 +137,9 @@ public class SysUserController extends BaseController {
         user.setPassword(passwordService.encryptPassword(user.getLoginName(), user.getPassword(), user.getSalt()));
         user.setPwdUpdateDate(DateUtils.getNowDate());
         user.setCreateUser(getLoginName());
+        if (StringUtils.isEmpty(user.getRoleIds())) {
+            user.setRoleIds(Collections.singletonList(user.getRoleId()).toArray(new Long[0]));
+        }
         return toAjax(userService.insertUser(user));
     }
 
@@ -187,6 +191,11 @@ public class SysUserController extends BaseController {
         }
         user.setUpdateUser(getLoginName());
         AuthorizationUtils.clearAllCachedAuthorizationInfo();
+
+        if (StringUtils.isEmpty(user.getRoleIds())) {
+            user.setRoleIds(Collections.singletonList(user.getRoleId()).toArray(new Long[0]));
+        }
+
         return toAjax(userService.updateUser(user));
     }
 

+ 1 - 0
08.src/Xingxi/xingxi-admin/src/main/resources/mapper/ProdAttrVoMapper.xml

@@ -41,6 +41,7 @@
         <where>
             <if test="prodId != null "> and m_prod_attr.prodId = #{prodId}</if>
             <if test="prodAttrId != null "> and m_prod_attr.prodAttrId = #{prodAttrId}</if>
+            <if test="prodName != null  and prodName != ''"> and m_prod.prodName like concat('%', #{prodName}, '%')</if>
             <if test="attrType != null "> and m_prod_attr.attrType = #{attrType}</if>
             <if test="attrName != null  and attrName != ''"> and m_prod_attr.attrName like concat('%', #{attrName}, '%')</if>
             <if test="delFlag != null  and delFlag != ''"> and m_prod_attr.delFlag = #{delFlag}</if>

+ 1 - 0
08.src/Xingxi/xingxi-admin/src/main/resources/templates/business/prodInventory/mercProdInventory.html

@@ -67,6 +67,7 @@
      </script>
     <script th:inline="javascript">
         var editFlag = [[${@permission.hasPermi('business:prodInventory:edit')}]];
+
         var prefix = ctx + "business/prodInventory";
 
         $(function() {

+ 1 - 1
08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/merchant/prod/merchantProd.html

@@ -59,7 +59,7 @@
     <script th:inline="javascript">
         var prefix = ctx + "master/merchant/prod";
         var removeFlag = [[${@permission.hasPermi('master:merchant:prod:remove')}]];
-        var editPriceFlag = [[${@permission.hasPermi('master:merchant:prod:editPrice')}]];
+        var editPriceFlag = [[${@permission.hasPermi('master:product:prodAttrPrice:editPrice')}]];
         var shelfFlag = [[${@permission.hasPermi('master:merchant:prod:shelf')}]];
         var shelfFlagDatas = [[${@dict.getType('shelf_flag')}]];
 

+ 3 - 2
08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/prod/add.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
 <head>
-    <th:block th:include="include :: header('新增推荐商品')" />
+    <th:block th:include="include :: header('新增商品')" />
     <th:block th:include="include :: select2-css" />
     <th:block th:include="include :: bootstrap-select-css" />
     <th:block th:include="include :: summernote-css" />
@@ -14,7 +14,7 @@
                     <label class="col-sm-3 control-label">商品分类:</label>
                     <div class="col-sm-8">
                         <select name="prodClassId" class="form-control" th:with="prodClasses=${@product.getProdClasses()}" >
-                            <option value="">所有</option>
+                            <option value="">请选择</option>
                             <option th:each="prodClass : ${prodClasses}" th:text="${prodClass.className}" th:value="${prodClass.prodClassId}"></option>
                         </select>
                     </div>
@@ -137,6 +137,7 @@
         // 富文本框
         $(".summernote").summernote({
             lang: 'zh-CN',
+            dialogsInBody: true,
             callbacks:{
                 onImageUpload: function (files) {
                     var fileSize = 0;

+ 2 - 1
08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/prod/edit.html

@@ -1,7 +1,7 @@
 <!DOCTYPE html>
 <html lang="zh" xmlns:th="http://www.thymeleaf.org" >
 <head>
-    <th:block th:include="include :: header('修改推荐商品')" />
+    <th:block th:include="include :: header('修改商品')" />
     <th:block th:include="include :: select2-css" />
     <th:block th:include="include :: bootstrap-select-css" />
     <th:block th:include="include :: summernote-css" />
@@ -147,6 +147,7 @@
 
         $(".summernote").summernote({
             lang: 'zh-CN',
+            dialogsInBody: true,
             callbacks:{
                 onImageUpload: function (files) {
                     var fileSize = 0;

+ 1 - 1
08.src/Xingxi/xingxi-admin/src/main/resources/templates/master/product/prod/prod.html

@@ -97,7 +97,7 @@
                 updateUrl: prefix + "/edit/{id}",
                 removeUrl: prefix + "/remove",
                 exportUrl: prefix + "/export",
-                modalName: "推荐商品",
+                modalName: "商品",
                 columns: [
                     {
                         field: 'prodName',

+ 2 - 2
08.src/Xingxi/xingxi-admin/src/main/resources/templates/system/user/add.html

@@ -117,8 +117,8 @@
                     <div class="form-group">
                         <label class="col-xs-2 control-label">角色:</label>
                         <div class="col-xs-10">
-                            <label th:each="role:${roles}" class="check-box">
-								<input name="role" type="checkbox" th:value="${role.roleId}" th:text="${role.roleName}" th:disabled="${role.status == '1'}">
+                            <label th:each="role:${roles}" class="radio-box">
+								<input name="roleId" type="radio" th:value="${role.roleId}" th:text="${role.roleName}" th:disabled="${role.status == '1'}">
 							</label>
                         </div>
                     </div>

+ 2 - 2
08.src/Xingxi/xingxi-admin/src/main/resources/templates/system/user/edit.html

@@ -103,8 +103,8 @@
                     <div class="form-group">
                         <label class="col-xs-2 control-label">角色:</label>
                         <div class="col-xs-10">
-                            <label th:each="role:${roles}" class="check-box">
-								<input name="role" type="checkbox" th:value="${role.roleId}" th:text="${role.roleName}" th:checked="${role.flag}" th:disabled="${role.status == '1'}">
+                            <label th:each="role:${roles}" class="radio-box">
+								<input name="roleId" type="radio" th:value="${role.roleId}" th:text="${role.roleName}" th:checked="${role.flag}" th:disabled="${role.status == '1'}">
 							</label>
                         </div>
                     </div>