You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
75 lines
1.9 KiB
75 lines
1.9 KiB
package com.eco.plugin.xx.jbsync.utils; |
|
|
|
import com.fr.decision.webservice.bean.user.DepPostUpdateBean; |
|
import com.fr.decision.webservice.v10.user.PositionService; |
|
|
|
public class FRPostUtils { |
|
private static PositionService postService = null; |
|
|
|
static{ |
|
postService = PositionService.getInstance(); |
|
} |
|
/** |
|
* 获取职务Service |
|
* @return |
|
*/ |
|
public static PositionService getPositionService(){ |
|
return PositionService.getInstance(); |
|
} |
|
|
|
/** |
|
* 添加职务 |
|
* @param postName |
|
* @param description |
|
* @return 职务id |
|
* @throws Exception |
|
*/ |
|
public static String addPost(String postName,String description) throws Exception { |
|
String postId = postService.addPosition(postName,description); |
|
return postId; |
|
} |
|
|
|
/** |
|
* 删除职务 |
|
* @param postId |
|
* @throws Exception |
|
*/ |
|
public static void deletePost(String postId) throws Exception { |
|
postService.deletePosition(postId); |
|
} |
|
|
|
/** |
|
* 修改职务 |
|
* @param postId |
|
* @param postName |
|
* @param decription |
|
* @throws Exception |
|
*/ |
|
public static void updatePost(String postId,String postName,String decription) throws Exception { |
|
postService.updatePosition(postId,postName,decription); |
|
} |
|
|
|
/** |
|
* 添加或删除部门下的职务 |
|
* @param depId |
|
* @param addPost |
|
* @param removePost |
|
* @return 成功条数 |
|
* @throws Exception |
|
*/ |
|
public static int updateDepPost(String depId,String[] addPost, String[] removePost) throws Exception { |
|
DepPostUpdateBean dub = new DepPostUpdateBean(); |
|
|
|
if(addPost != null && addPost.length > 0){ |
|
dub.setAddPostIds(addPost); |
|
} |
|
|
|
if(removePost != null && removePost.length > 0){ |
|
dub.setRemovePostIds(removePost); |
|
} |
|
|
|
return postService.updateDepPositions(depId,dub); |
|
} |
|
|
|
|
|
}
|
|
|