huanghongfa
2021-01-18 95e735e387d2202fdc17117d91839284d34db677
新增角色
6个文件已修改
4个文件已删除
303 ■■■■■ 已修改文件
springcloud_k8s_panzhihuazhihuishequ/.idea/workspace.xml 76 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/CommunityApi.java 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/user/MenuRoleVO.java 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/user/MenuRoleVO.class 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/common-1.0-SNAPSHOT.jar 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/maven-archiver/pom.properties 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst 75 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst 72 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/SystemManagementApi.java 58 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/RoleServiceImpl.java 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
springcloud_k8s_panzhihuazhihuishequ/.idea/workspace.xml
@@ -24,8 +24,15 @@
  <component name="ChangeListManager">
    <list default="true" id="8ba27629-3e5d-4f42-993e-d0c055bc9371" name="Default Changelist" comment="">
      <change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngStructOtherBuildVO.java" beforeDir="false" afterPath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/model/vos/community/ComMngStructOtherBuildVO.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityManagerApi.java" beforeDir="false" afterPath="$PROJECT_DIR$/community_backstage/src/main/java/com/panzhihua/community_backstage/api/CommunityManagerApi.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/CommunityApi.java" beforeDir="false" afterPath="$PROJECT_DIR$/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/CommunityApi.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/model/vos/user/MenuRoleVO.java" beforeDir="false" afterPath="$PROJECT_DIR$/common/src/main/java/com/panzhihua/common/model/vos/user/MenuRoleVO.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/model/vos/user/MenuRoleVO.class" beforeDir="false" afterPath="$PROJECT_DIR$/common/target/classes/com/panzhihua/common/model/vos/user/MenuRoleVO.class" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/common/target/common-1.0-SNAPSHOT.jar" beforeDir="false" />
      <change beforePath="$PROJECT_DIR$/common/target/maven-archiver/pom.properties" beforeDir="false" />
      <change beforePath="$PROJECT_DIR$/common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst" beforeDir="false" />
      <change beforePath="$PROJECT_DIR$/common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst" beforeDir="false" />
      <change beforePath="$PROJECT_DIR$/community_backstage/src/main/java/com/panzhihua/community_backstage/api/SystemManagementApi.java" beforeDir="false" afterPath="$PROJECT_DIR$/community_backstage/src/main/java/com/panzhihua/community_backstage/api/SystemManagementApi.java" afterDir="false" />
      <change beforePath="$PROJECT_DIR$/service_user/src/main/java/com/panzhihua/service_user/service/impl/RoleServiceImpl.java" beforeDir="false" afterPath="$PROJECT_DIR$/service_user/src/main/java/com/panzhihua/service_user/service/impl/RoleServiceImpl.java" afterDir="false" />
    </list>
    <option name="SHOW_DIALOG" value="false" />
    <option name="HIGHLIGHT_CONFLICTS" value="true" />
@@ -178,13 +185,15 @@
        <option name="Make" enabled="true" />
      </method>
    </configuration>
    <configuration default="true" type="ArquillianJUnit" factoryName="" nameIsGenerated="true">
    <configuration default="true" type="ArquillianTestNG" factoryName="" nameIsGenerated="true">
      <option name="arquillianRunConfiguration">
        <value>
          <option name="containerStateName" value="" />
        </value>
      </option>
      <option name="TEST_OBJECT" value="class" />
      <option name="TEST_OBJECT" value="CLASS" />
      <properties />
      <listeners />
      <method v="2">
        <option name="Make" enabled="true" />
      </method>
@@ -403,7 +412,8 @@
      <workItem from="1610859280054" duration="1991000" />
      <workItem from="1610930834137" duration="517000" />
      <workItem from="1610934956567" duration="1325000" />
      <workItem from="1610939265133" duration="6575000" />
      <workItem from="1610939265133" duration="8588000" />
      <workItem from="1610956684718" duration="2359000" />
    </task>
    <servers />
  </component>
@@ -455,54 +465,54 @@
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="549" y="167" key="FileChooserDialogImpl/0.0.1536.824@0.0.1536.824" timestamp="1610606590056" />
    <state width="1031" height="439" key="GridCell.Tab.0.bottom" timestamp="1610954587966">
    <state width="1031" height="439" key="GridCell.Tab.0.bottom" timestamp="1610959091349">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="439" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1610954587966" />
    <state width="1031" height="439" key="GridCell.Tab.0.center" timestamp="1610954587965">
    <state width="1031" height="439" key="GridCell.Tab.0.bottom/0.0.1536.824@0.0.1536.824" timestamp="1610959091349" />
    <state width="1031" height="439" key="GridCell.Tab.0.center" timestamp="1610959091349">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="439" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1610954587965" />
    <state width="1031" height="439" key="GridCell.Tab.0.left" timestamp="1610954587964">
    <state width="1031" height="439" key="GridCell.Tab.0.center/0.0.1536.824@0.0.1536.824" timestamp="1610959091349" />
    <state width="1031" height="439" key="GridCell.Tab.0.left" timestamp="1610959091348">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="439" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1610954587964" />
    <state width="1031" height="439" key="GridCell.Tab.0.right" timestamp="1610954587966">
    <state width="1031" height="439" key="GridCell.Tab.0.left/0.0.1536.824@0.0.1536.824" timestamp="1610959091348" />
    <state width="1031" height="439" key="GridCell.Tab.0.right" timestamp="1610959091349">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="439" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1610954587966" />
    <state width="1031" height="439" key="GridCell.Tab.1.bottom" timestamp="1610954587966">
    <state width="1031" height="439" key="GridCell.Tab.0.right/0.0.1536.824@0.0.1536.824" timestamp="1610959091349" />
    <state width="1031" height="439" key="GridCell.Tab.1.bottom" timestamp="1610959091349">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="439" key="GridCell.Tab.1.bottom/0.0.1536.824@0.0.1536.824" timestamp="1610954587966" />
    <state width="1031" height="439" key="GridCell.Tab.1.center" timestamp="1610954587966">
    <state width="1031" height="439" key="GridCell.Tab.1.bottom/0.0.1536.824@0.0.1536.824" timestamp="1610959091349" />
    <state width="1031" height="439" key="GridCell.Tab.1.center" timestamp="1610959091349">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="439" key="GridCell.Tab.1.center/0.0.1536.824@0.0.1536.824" timestamp="1610954587966" />
    <state width="1031" height="439" key="GridCell.Tab.1.left" timestamp="1610954587966">
    <state width="1031" height="439" key="GridCell.Tab.1.center/0.0.1536.824@0.0.1536.824" timestamp="1610959091349" />
    <state width="1031" height="439" key="GridCell.Tab.1.left" timestamp="1610959091349">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="439" key="GridCell.Tab.1.left/0.0.1536.824@0.0.1536.824" timestamp="1610954587966" />
    <state width="1031" height="439" key="GridCell.Tab.1.right" timestamp="1610954587966">
    <state width="1031" height="439" key="GridCell.Tab.1.left/0.0.1536.824@0.0.1536.824" timestamp="1610959091349" />
    <state width="1031" height="439" key="GridCell.Tab.1.right" timestamp="1610959091349">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="439" key="GridCell.Tab.1.right/0.0.1536.824@0.0.1536.824" timestamp="1610954587966" />
    <state width="1031" height="439" key="GridCell.Tab.2.bottom" timestamp="1610954587966">
    <state width="1031" height="439" key="GridCell.Tab.1.right/0.0.1536.824@0.0.1536.824" timestamp="1610959091349" />
    <state width="1031" height="439" key="GridCell.Tab.2.bottom" timestamp="1610959091349">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="439" key="GridCell.Tab.2.bottom/0.0.1536.824@0.0.1536.824" timestamp="1610954587966" />
    <state width="1031" height="439" key="GridCell.Tab.2.center" timestamp="1610954587966">
    <state width="1031" height="439" key="GridCell.Tab.2.bottom/0.0.1536.824@0.0.1536.824" timestamp="1610959091349" />
    <state width="1031" height="439" key="GridCell.Tab.2.center" timestamp="1610959091349">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="439" key="GridCell.Tab.2.center/0.0.1536.824@0.0.1536.824" timestamp="1610954587966" />
    <state width="1031" height="439" key="GridCell.Tab.2.left" timestamp="1610954587966">
    <state width="1031" height="439" key="GridCell.Tab.2.center/0.0.1536.824@0.0.1536.824" timestamp="1610959091349" />
    <state width="1031" height="439" key="GridCell.Tab.2.left" timestamp="1610959091349">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="439" key="GridCell.Tab.2.left/0.0.1536.824@0.0.1536.824" timestamp="1610954587966" />
    <state width="1031" height="439" key="GridCell.Tab.2.right" timestamp="1610954587966">
    <state width="1031" height="439" key="GridCell.Tab.2.left/0.0.1536.824@0.0.1536.824" timestamp="1610959091349" />
    <state width="1031" height="439" key="GridCell.Tab.2.right" timestamp="1610959091349">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="1031" height="439" key="GridCell.Tab.2.right/0.0.1536.824@0.0.1536.824" timestamp="1610954587966" />
    <state width="1031" height="439" key="GridCell.Tab.2.right/0.0.1536.824@0.0.1536.824" timestamp="1610959091349" />
    <state x="299" y="67" key="Maven.ArtifactSearchDialog" timestamp="1610611848124">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
@@ -511,10 +521,10 @@
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="270" y="57" key="SettingsEditor/0.0.1536.824@0.0.1536.824" timestamp="1606120706449" />
    <state width="498" height="540" key="SwitcherDM" timestamp="1610605962843">
    <state width="498" height="540" key="SwitcherDM" timestamp="1610956123833">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state width="498" height="540" key="SwitcherDM/0.0.1536.824@0.0.1536.824" timestamp="1610605962843" />
    <state width="498" height="540" key="SwitcherDM/0.0.1536.824@0.0.1536.824" timestamp="1610956123833" />
    <state x="93" y="93" width="1350" height="638" key="com.intellij.history.integration.ui.views.DirectoryHistoryDialog" timestamp="1609398421992">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
@@ -523,10 +533,10 @@
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="93" y="93" width="1350" height="638" key="com.intellij.history.integration.ui.views.FileHistoryDialog/0.0.1536.824@0.0.1536.824" timestamp="1610939578806" />
    <state x="468" y="42" width="766" height="782" key="find.popup" timestamp="1610953760887">
    <state x="468" y="42" width="766" height="782" key="find.popup" timestamp="1610956110199">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
    <state x="468" y="42" width="766" height="782" key="find.popup/0.0.1536.824@0.0.1536.824" timestamp="1610953760887" />
    <state x="468" y="42" width="766" height="782" key="find.popup/0.0.1536.824@0.0.1536.824" timestamp="1610956110199" />
    <state width="600" height="428" key="javadoc.popup" timestamp="1610005781618">
      <screen x="0" y="0" width="1536" height="824" />
    </state>
springcloud_k8s_panzhihuazhihuishequ/applets_backstage/src/main/java/com/panzhihua/applets_backstage/api/CommunityApi.java
@@ -34,7 +34,7 @@
    /**
     * 攀枝花地址json
     */
    private String panzhihuajson="{\"id\":256,\"city_name\":\"攀枝花市\",\"city_adcode\":510400,\"province_adcode\":510000,\"province_id\":23,\"district\":[{\"id\":2004,\"district_name\":\"仁和区\",\"district_adcode\":510411,\"city_adcode\":510400,\"city_id\":256,\"province_adcode\":510000,\"province_id\":23},{\"id\":2005,\"district_name\":\"米易县\",\"district_adcode\":510421,\"city_adcode\":510400,\"city_id\":256,\"province_adcode\":510000,\"province_id\":23},{\"id\":2006,\"district_name\":\"盐边县\",\"district_adcode\":510422,\"city_adcode\":510400,\"city_id\":256,\"province_adcode\":510000,\"province_id\":23}]}";
    private String panzhihuajson="[{\"district_name\":\"仁和区\",\"city_adcode\":510400,\"district_adcode\":510411,\"province_id\":23,\"id\":2004,\"province_adcode\":510000,\"city_id\":256},{\"district_name\":\"米易县\",\"city_adcode\":510400,\"district_adcode\":510421,\"province_id\":23,\"id\":2005,\"province_adcode\":510000,\"city_id\":256},{\"district_name\":\"盐边县\",\"city_adcode\":510400,\"district_adcode\":510422,\"province_id\":23,\"id\":2006,\"province_adcode\":510000,\"city_id\":256}]";
    @ApiOperation(value = "新增社区",response = ComActVO.class)
    @PostMapping("community")
@@ -84,7 +84,8 @@
    @ApiOperation(value = "所在地地址下拉列表")
    @PostMapping("listarea")
    public R listArea(){
       return R.ok(panzhihuajson);
        JSONObject jsonObject=JSONObject.parseObject(panzhihuajson);
       return R.ok(jsonObject);
    }
springcloud_k8s_panzhihuazhihuishequ/common/src/main/java/com/panzhihua/common/model/vos/user/MenuRoleVO.java
@@ -5,6 +5,7 @@
import lombok.Data;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.util.List;
@@ -15,16 +16,18 @@
 * @create: 2020-12-25 09:29
 **/
@Data
@ApiModel("设置角色权限")
@ApiModel("新增角色-设置角色权限")
public class MenuRoleVO {
    @ApiModelProperty("是否全选 1 是 0 否 ")
    @NotNull(message = "是否全选不能为空")
    private Integer isAll;
    @ApiModelProperty("所有菜单id集合")
    private List<Long> menuIds;
    @ApiModelProperty("被操作的角色id")
    @Min(value = 1,message = "角色id不能为空")
    @ApiModelProperty(value = "被操作的角色id",hidden = true)
    private Long roleId;
    @ApiModelProperty(value = "角色名字",required = true)
    @NotBlank(message = "角色名字不能为空")
    private String roleName;
    @ApiModelProperty(value = "所在社区",hidden = true)
    private Long communityId;
}
springcloud_k8s_panzhihuazhihuishequ/common/target/classes/com/panzhihua/common/model/vos/user/MenuRoleVO.class
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/common-1.0-SNAPSHOT.jar
Binary files differ
springcloud_k8s_panzhihuazhihuishequ/common/target/maven-archiver/pom.properties
File was deleted
springcloud_k8s_panzhihuazhihuishequ/common/target/maven-status/maven-compiler-plugin/compile/default-compile/createdFiles.lst
File was deleted
springcloud_k8s_panzhihuazhihuishequ/common/target/maven-status/maven-compiler-plugin/compile/default-compile/inputFiles.lst
File was deleted
springcloud_k8s_panzhihuazhihuishequ/community_backstage/src/main/java/com/panzhihua/community_backstage/api/SystemManagementApi.java
@@ -2,6 +2,7 @@
import com.panzhihua.common.controller.BaseController;
import com.panzhihua.common.interfaces.OperLog;
import com.panzhihua.common.model.vos.LoginUserInfoVO;
import com.panzhihua.common.model.vos.R;
import com.panzhihua.common.model.vos.SystemmanagementConfigVO;
import com.panzhihua.common.model.vos.community.ComMngStructBuildTypeVO;
@@ -88,22 +89,22 @@
        return userService.pageUserBackstage(administratorsUserVO);
    }
    @ApiOperation(value = "新增角色")
    @PostMapping("role")
    @OperLog(operModul = "角色管理",operType = 1)
    public R addRoleBackstage(@RequestBody RoleVO roleVO){
        String roleName = roleVO.getRoleName();
        if (ObjectUtils.isEmpty(roleName)) {
            return R.fail("角色名字不能为空");
        }
        roleVO.setCommunityId(this.getCommunityId());
        Long userId = this.getUserId();
        roleVO.setCreateBy(userId);
        roleVO.setStatus(0);
        HanyuPinyinHelper hanyuPinyinHelper = new HanyuPinyinHelper() ;
        roleVO.setRoleKey(hanyuPinyinHelper.toHanyuPinyin(roleName));
        return userService.addRoleBackstage(roleVO);
    }
//    @ApiOperation(value = "新增角色")
//    @PostMapping("role")
//    @OperLog(operModul = "角色管理",operType = 1)
//    public R addRoleBackstage(@RequestBody RoleVO roleVO){
//        String roleName = roleVO.getRoleName();
//        if (ObjectUtils.isEmpty(roleName)) {
//            return R.fail("角色名字不能为空");
//        }
//        roleVO.setCommunityId(this.getCommunityId());
//        Long userId = this.getUserId();
//        roleVO.setCreateBy(userId);
//        roleVO.setStatus(0);
//        HanyuPinyinHelper hanyuPinyinHelper = new HanyuPinyinHelper() ;
//        roleVO.setRoleKey(hanyuPinyinHelper.toHanyuPinyin(roleName));
//        return userService.addRoleBackstage(roleVO);
//    }
    @ApiOperation(value = "删除角色")
    @DeleteMapping("role")
@@ -123,11 +124,32 @@
        return userService.listMenuBackstage(communityId);
    }
    @ApiOperation(value = "设置角色的权限")
    @ApiOperation(value = "新增角色-设置角色的权限")
    @PutMapping("menu")
    @OperLog(operModul = "角色管理",operType = 2)
    public R putMenuRole(@RequestBody @Validated MenuRoleVO menuRoleVO){
        return userService.putMenuRole(menuRoleVO);
        RoleVO roleVO=new RoleVO();
        String roleName = menuRoleVO.getRoleName();
        if (ObjectUtils.isEmpty(roleName)) {
            return R.fail("角色名字不能为空");
        }
        LoginUserInfoVO loginUserInfo = this.getLoginUserInfo();
        Long userId = loginUserInfo.getUserId();
        Long communityId = loginUserInfo.getCommunityId();
        roleVO.setRoleName(roleName);
        roleVO.setCommunityId(communityId);
        roleVO.setCreateBy(userId);
        roleVO.setStatus(0);
        HanyuPinyinHelper hanyuPinyinHelper = new HanyuPinyinHelper() ;
        roleVO.setRoleKey(hanyuPinyinHelper.toHanyuPinyin(roleName));
        R r = userService.addRoleBackstage(roleVO);
        if (R.isOk(r)) {
            Long roleId =Long.parseLong(r.getData().toString());
            menuRoleVO.setRoleId(roleId);
            menuRoleVO.setCommunityId(communityId);
            return userService.putMenuRole(menuRoleVO);
        }
       return r;
    }
springcloud_k8s_panzhihuazhihuishequ/service_user/src/main/java/com/panzhihua/service_user/service/impl/RoleServiceImpl.java
@@ -132,7 +132,8 @@
            }
        }
        if (insert>0) {
            return R.ok();
            SysRoleDO roleDO = roleDAO.selectOne(new QueryWrapper<SysRoleDO>().lambda().eq(SysRoleDO::getRoleKey, roleVO.getRoleKey()).eq(SysRoleDO::getCommunityId, roleVO.getCommunityId()));
            return R.ok(roleDO.getRoleId());
        }
        return R.fail();
    }