Commit 9f713476 authored by 季圣华's avatar 季圣华
Browse files

优化角色模块

parent fe99c356
...@@ -717,7 +717,7 @@ INSERT INTO `jsh_role` VALUES ('4', '管理员', '全部数据', null, null, nul ...@@ -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 ('10', '租户', '全部数据', null, '', null, '0');
INSERT INTO `jsh_role` VALUES ('16', '销售经理', '全部数据', null, 'ddd', '63', '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 ('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 -- Table structure for jsh_sequence
......
...@@ -58,7 +58,6 @@ ...@@ -58,7 +58,6 @@
<option value="全部数据">全部数据</option> <option value="全部数据">全部数据</option>
<option value="本机构数据">本机构数据</option> <option value="本机构数据">本机构数据</option>
<option value="个人数据">个人数据</option> <option value="个人数据">个人数据</option>
<option value="自定义数据">自定义数据</option>
</select> </select>
</td> </td>
</tr> </tr>
......
...@@ -22,6 +22,7 @@ ...@@ -22,6 +22,7 @@
<a id="btnAllCheck" class="easyui-linkbutton">全选</a>&nbsp; <a id="btnAllCheck" class="easyui-linkbutton">全选</a>&nbsp;
<a id="btnAllCancel" class="easyui-linkbutton">全取消</a>&nbsp; <a id="btnAllCancel" class="easyui-linkbutton">全取消</a>&nbsp;
<a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</a> <a id="btnOK" class="easyui-linkbutton" iconCls="icon-ok">保存</a>
<span>只有勾选了<b>编辑</b>按钮,才能进行新增、修改、删除操作</span>
</div> </div>
<div id="pushList"> <div id="pushList">
<!-- 数据显示table --> <!-- 数据显示table -->
......
...@@ -165,6 +165,10 @@ public class BusinessConstants { ...@@ -165,6 +165,10 @@ public class BusinessConstants {
*/ */
public static final String DEFAULT_MANAGER = "admin"; 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 { ...@@ -84,17 +84,7 @@ public class DepotHeadService {
public List<DepotHeadVo4List> select(String type, String subType, String roleType, String number, String beginTime, String endTime, 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 materialParam, String depotIds, int offset, int rows)throws Exception {
String handsPersonIds = ""; String [] handsPersonIdArray = getHandsPersonIdArray(roleType);
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(",");
}
List<DepotHeadVo4List> resList = new ArrayList<DepotHeadVo4List>(); List<DepotHeadVo4List> resList = new ArrayList<DepotHeadVo4List>();
List<DepotHeadVo4List> list=null; List<DepotHeadVo4List> list=null;
try{ try{
...@@ -134,24 +124,35 @@ public class DepotHeadService { ...@@ -134,24 +124,35 @@ public class DepotHeadService {
public Long countDepotHead(String type, String subType, String roleType,String number, String beginTime, String endTime, public Long countDepotHead(String type, String subType, String roleType,String number, String beginTime, String endTime,
String materialParam, String depotIds) throws Exception{ String materialParam, String depotIds) throws Exception{
String [] handsPersonIdArray = getHandsPersonIdArray(roleType);
Long result=null;
try{
result=depotHeadMapperEx.countsByDepotHead(type, subType, handsPersonIdArray, number, beginTime, endTime, materialParam, depotIds);
}catch(Exception e){
JshException.readFail(logger, e);
}
return result;
}
/**
* 根据角色类型获取经手人数组
* @param roleType
* @return
* @throws Exception
*/
private String[] getHandsPersonIdArray(String roleType) throws Exception {
String handsPersonIds = ""; String handsPersonIds = "";
User user = userService.getCurrentUser(); User user = userService.getCurrentUser();
if("个人数据".equals(roleType)) { if(BusinessConstants.ROLE_TYPE_PRIVATE.equals(roleType)) {
handsPersonIds = user.getId().toString(); handsPersonIds = user.getId().toString();
} else if("本机构数据".equals(roleType)) { } else if(BusinessConstants.ROLE_TYPE_THIS_ORG.equals(roleType)) {
handsPersonIds = orgaUserRelService.getUserIdListByUserId(user.getId()); handsPersonIds = orgaUserRelService.getUserIdListByUserId(user.getId());
} }
String [] handsPersonIdArray=null; String [] handsPersonIdArray=null;
if(StringUtil.isNotEmpty(handsPersonIds)){ if(StringUtil.isNotEmpty(handsPersonIds)){
handsPersonIdArray = handsPersonIds.split(","); handsPersonIdArray = handsPersonIds.split(",");
} }
Long result=null; return handsPersonIdArray;
try{
result=depotHeadMapperEx.countsByDepotHead(type, subType, handsPersonIdArray, number, beginTime, endTime, materialParam, depotIds);
}catch(Exception e){
JshException.readFail(logger, e);
}
return result;
} }
@Transactional(value = "transactionManager", rollbackFor = Exception.class) @Transactional(value = "transactionManager", rollbackFor = Exception.class)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment