优化角色模块
This commit is contained in:
@@ -717,7 +717,7 @@ INSERT INTO `jsh_role` VALUES ('4', '管理员', '全部数据', null, null, nul
|
||||
INSERT INTO `jsh_role` VALUES ('10', '租户', '全部数据', null, '', null, '0');
|
||||
INSERT INTO `jsh_role` VALUES ('16', '销售经理', '全部数据', null, 'ddd', '63', '0');
|
||||
INSERT INTO `jsh_role` VALUES ('17', '销售代表', '个人数据', null, 'rrr', '63', '0');
|
||||
INSERT INTO `jsh_role` VALUES ('18', '角色abc', '自定义数据', null, '33333', '63', '0');
|
||||
INSERT INTO `jsh_role` VALUES ('18', '角色abc', '本机构数据', null, '33333', '63', '0');
|
||||
|
||||
-- ----------------------------
|
||||
-- Table structure for jsh_sequence
|
||||
|
||||
@@ -58,7 +58,6 @@
|
||||
<option value="全部数据">全部数据</option>
|
||||
<option value="本机构数据">本机构数据</option>
|
||||
<option value="个人数据">个人数据</option>
|
||||
<option value="自定义数据">自定义数据</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
<a id="btnAllCheck" class="easyui-linkbutton">全选</a>
|
||||
<a id="btnAllCancel" class="easyui-linkbutton">全取消</a>
|
||||
<a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
|
||||
<span>只有勾选了<b>编辑</b>按钮,才能进行新增、修改、删除操作</span>
|
||||
</div>
|
||||
<div id="pushList">
|
||||
<!-- 数据显示table -->
|
||||
|
||||
@@ -165,6 +165,10 @@ public class BusinessConstants {
|
||||
*/
|
||||
public static final String DEFAULT_MANAGER = "admin";
|
||||
|
||||
public static final String ROLE_TYPE_PRIVATE = "个人数据";
|
||||
|
||||
public static final String ROLE_TYPE_THIS_ORG = "本机构数据";
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -84,17 +84,7 @@ public class DepotHeadService {
|
||||
|
||||
public List<DepotHeadVo4List> select(String type, String subType, String roleType, String number, String beginTime, String endTime,
|
||||
String materialParam, String depotIds, int offset, int rows)throws Exception {
|
||||
String handsPersonIds = "";
|
||||
User user = userService.getCurrentUser();
|
||||
if("个人数据".equals(roleType)) {
|
||||
handsPersonIds = user.getId().toString();
|
||||
} else if("本机构数据".equals(roleType)) {
|
||||
handsPersonIds = orgaUserRelService.getUserIdListByUserId(user.getId());
|
||||
}
|
||||
String [] handsPersonIdArray=null;
|
||||
if(StringUtil.isNotEmpty(handsPersonIds)){
|
||||
handsPersonIdArray = handsPersonIds.split(",");
|
||||
}
|
||||
String [] handsPersonIdArray = getHandsPersonIdArray(roleType);
|
||||
List<DepotHeadVo4List> resList = new ArrayList<DepotHeadVo4List>();
|
||||
List<DepotHeadVo4List> list=null;
|
||||
try{
|
||||
@@ -134,17 +124,7 @@ public class DepotHeadService {
|
||||
|
||||
public Long countDepotHead(String type, String subType, String roleType,String number, String beginTime, String endTime,
|
||||
String materialParam, String depotIds) throws Exception{
|
||||
String handsPersonIds = "";
|
||||
User user = userService.getCurrentUser();
|
||||
if("个人数据".equals(roleType)) {
|
||||
handsPersonIds = user.getId().toString();
|
||||
} else if("本机构数据".equals(roleType)) {
|
||||
handsPersonIds = orgaUserRelService.getUserIdListByUserId(user.getId());
|
||||
}
|
||||
String [] handsPersonIdArray=null;
|
||||
if(StringUtil.isNotEmpty(handsPersonIds)){
|
||||
handsPersonIdArray = handsPersonIds.split(",");
|
||||
}
|
||||
String [] handsPersonIdArray = getHandsPersonIdArray(roleType);
|
||||
Long result=null;
|
||||
try{
|
||||
result=depotHeadMapperEx.countsByDepotHead(type, subType, handsPersonIdArray, number, beginTime, endTime, materialParam, depotIds);
|
||||
@@ -154,6 +134,27 @@ public class DepotHeadService {
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据角色类型获取经手人数组
|
||||
* @param roleType
|
||||
* @return
|
||||
* @throws Exception
|
||||
*/
|
||||
private String[] getHandsPersonIdArray(String roleType) throws Exception {
|
||||
String handsPersonIds = "";
|
||||
User user = userService.getCurrentUser();
|
||||
if(BusinessConstants.ROLE_TYPE_PRIVATE.equals(roleType)) {
|
||||
handsPersonIds = user.getId().toString();
|
||||
} else if(BusinessConstants.ROLE_TYPE_THIS_ORG.equals(roleType)) {
|
||||
handsPersonIds = orgaUserRelService.getUserIdListByUserId(user.getId());
|
||||
}
|
||||
String [] handsPersonIdArray=null;
|
||||
if(StringUtil.isNotEmpty(handsPersonIds)){
|
||||
handsPersonIdArray = handsPersonIds.split(",");
|
||||
}
|
||||
return handsPersonIdArray;
|
||||
}
|
||||
|
||||
@Transactional(value = "transactionManager", rollbackFor = Exception.class)
|
||||
public int insertDepotHead(String beanJson, HttpServletRequest request)throws Exception {
|
||||
DepotHead depotHead = JSONObject.parseObject(beanJson, DepotHead.class);
|
||||
|
||||
Reference in New Issue
Block a user