FlucInBizBillHrManEditExtendHandler.java 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206
  1. package com.kingdee.eas.custom.wamke.web;
  2. //import java.sql.SQLException;
  3. //import java.text.SimpleDateFormat;
  4. //import java.util.Date;
  5. //import java.util.HashMap;
  6. //import java.util.Map;
  7. //
  8. //import javax.servlet.http.HttpServletRequest;
  9. //import javax.servlet.http.HttpServletResponse;
  10. //
  11. //import org.apache.log4j.Logger;
  12. //import org.apache.log4j.Priority;
  13. //import org.springframework.ui.ModelMap;
  14. //
  15. //import com.kingdee.bos.BOSException;
  16. //import com.kingdee.bos.Context;
  17. //import com.kingdee.eas.custom.wamke.syncdata.dto.MobileAttachDto;
  18. //import com.kingdee.eas.custom.wamke.syncdata.web.MobileEntryBillExtendEditHandler;
  19. //import com.kingdee.eas.framework.CoreBaseInfo;
  20. //import com.kingdee.eas.hr.affair.FlucInBizBillInfo;
  21. //import com.kingdee.eas.util.app.DbUtil;
  22. //import com.kingdee.jdbc.rowset.IRowSet;
  23. //import com.kingdee.shr.affair.web.handler.hrman.FlucInBizBillHrManEditHandler;
  24. //import com.kingdee.shr.base.syssetting.context.SHRContext;
  25. //import com.kingdee.shr.base.syssetting.exception.SHRWebException;
  26. public class FlucInBizBillHrManEditExtendHandler {
  27. //extends
  28. // FlucInBizBillHrManEditHandler
  29. // /**
  30. // * 跨公司调入单提交生效
  31. // */
  32. // @Override
  33. // public void submitEffectAction(HttpServletRequest request,
  34. // HttpServletResponse response, ModelMap modelMap)
  35. // throws SHRWebException {
  36. // super.submitEffectAction(request, response, modelMap);
  37. // CoreBaseInfo model = (CoreBaseInfo) request.getAttribute("dynamic_model");
  38. // //提交之后,判断是否为万净公司下的组织,再根据岗位更新工种
  39. // FlucInBizBillInfo billInfo = (FlucInBizBillInfo) model;
  40. //
  41. // try{
  42. // adjustWorkType(billInfo.getId().toString());
  43. // }
  44. // catch(Exception e){
  45. // logInfo("执行更新工种时发生了异常");
  46. // e.printStackTrace();
  47. // }
  48. // }
  49. //
  50. //// @Override
  51. //// protected void afterSubmit(HttpServletRequest request,
  52. //// HttpServletResponse response, CoreBaseInfo model)
  53. //// throws SHRWebException {
  54. ////
  55. //// super.afterSubmit(request, response, model);
  56. ////
  57. //// //提交之后,判断是否为万净公司下的组织,再根据岗位更新工种
  58. //// FlucInBizBillInfo billInfo = (FlucInBizBillInfo) model;
  59. //// adjustWorkType(billInfo.getId().toString());
  60. //// }
  61. //
  62. // /**
  63. // * 根据跨公司调动单ID进行员工新工种信息
  64. // * @param id
  65. // */
  66. // private void adjustWorkType(String id){
  67. // Map<String,String> info = isWjCompany(id,true);
  68. // if(info.get("pass").equals("true")){
  69. // String posId = info.get("posId");
  70. // String personId = info.get("personId");
  71. // String workId = getWorkCategoryIdByPosId(posId);
  72. // if(null==workId){
  73. // return;
  74. // }
  75. // updatePersonWorkType(personId,workId);
  76. // }
  77. // }
  78. //
  79. // /**
  80. // * 根据岗位ID获取对应匹配的工种ID
  81. // * @param posId
  82. // * @return
  83. // */
  84. // private String getWorkCategoryIdByPosId(String posId){
  85. // try{
  86. // String sql = " SELECT work_category_id fROM T_ORG_Position a "
  87. // + " INNER JOIN CT_WK_work_category_setting b ON(a.FName_l2 COLLATE Chinese_PRC_CI_AS = b.position_name) "
  88. // + " WHERE a.FID= '"+posId+"' ";
  89. // logInfo("根据岗位ID获取对应匹配的工种IDsql:"+sql);
  90. // Context ctx = SHRContext.getInstance().getContext();
  91. // IRowSet rowSet = DbUtil.executeQuery(ctx, sql);
  92. // while(rowSet.next()){
  93. // return rowSet.getString("work_category_id");
  94. // }
  95. // }
  96. // catch(Exception e){
  97. // logInfo("根据岗位ID获取对应匹配的工种ID时发生异常:"+e.getMessage());
  98. // e.printStackTrace();
  99. // return null;
  100. // }
  101. // return null;
  102. // }
  103. //
  104. // /**
  105. // * 根据岗位更新对应人员的工种
  106. // * @param personId
  107. // * @param personId
  108. // * @param workId
  109. // */
  110. // private void updatePersonWorkType(String personId, String workId){
  111. //
  112. // try{
  113. // Context ctx = SHRContext.getInstance().getContext();
  114. //
  115. // //更新人员表
  116. // String sql = "UPDATE T_BD_Person SET CFWORKCATEGORYID = '"+workId+"' WHERE FID = '"+personId+"'";
  117. // logInfo("根据岗位更新对应人员表的工种sql:"+sql);
  118. // DbUtil.execute(ctx, sql);
  119. //
  120. // //更新人员历史表
  121. // sql = "UPDATE T_BD_PersonHis SET CFWORKCATEGORYID = '"+workId+"' "
  122. // +" WHERE FNumber = ( SELECT TOP 1 FNumber FROM T_BD_Person WHERE FID = '"+personId+"' ) AND FLEFFDT >='2199-12-31'";
  123. // logInfo("根据岗位更新对应人员历史表的工种sql:"+sql);
  124. // DbUtil.execute(ctx, sql);
  125. // }
  126. // catch(Exception e){
  127. // logInfo("根据岗位更新对应人员表的工种字段发生异常:"+e.getMessage());
  128. // e.printStackTrace();
  129. // }
  130. // }
  131. //
  132. // /**
  133. // * 判断是否为万净公司下的人员
  134. // * @param id
  135. // * @param isSubmitEffect 是否提交生效
  136. // * @return
  137. // */
  138. // private Map<String,String> isWjCompany(String id, boolean isSubmitEffect) {
  139. // Map<String,String> result = new HashMap<String,String>();
  140. // result.put("pass","false");
  141. //
  142. // try{
  143. // String sql = "SELECT TOP 1 FADMINORGID, FPersonId, FPositionId, FBIZDATE FROM T_HR_FlucInBizBillEntry WHERE FBILLID = '"+id+"' ";
  144. // logInfo("执行跨公司调入单据数据sql:"+sql);
  145. // Context ctx = SHRContext.getInstance().getContext();
  146. // IRowSet rowSet = DbUtil.executeQuery(ctx, sql);
  147. // String adminId = null, posId = null, personId = null;
  148. // Date bizDate = null;
  149. // while (rowSet.next()) {
  150. // adminId = rowSet.getString("FADMINORGID");
  151. // posId = rowSet.getString("FPositionId");
  152. // personId = rowSet.getString("FPersonId");
  153. // bizDate = rowSet.getDate("FBIZDATE");
  154. // result.put("adminId",adminId);
  155. // result.put("posId",posId);
  156. // result.put("personId",personId);
  157. // break;
  158. // }
  159. //
  160. // if(adminId==null || adminId == ""){
  161. // result.put("pass","false");
  162. // return result;
  163. // }
  164. //
  165. // //如果为提交生效,则需要判断日期
  166. // if(isSubmitEffect){
  167. // //如果生效时间<=当前日期,则执行,否则直接返回(由定时器扫描再去变更)
  168. // SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
  169. // String bizDateStr = sdf.format(bizDate);
  170. // String currentDate = sdf.format(new Date());
  171. // if(bizDateStr.compareTo(currentDate)>0){
  172. // result.put("pass","false");
  173. // return result;
  174. // }
  175. // }
  176. //
  177. // sql = "SELECT TOP 1 FID FROM T_ORG_ADmin WHERE FId = '"+adminId+"' AND FLONGNUMBER LIKE '01!WKWY!50952375!%";
  178. // logInfo("执行查询是否为万净公司sql:"+sql);
  179. // IRowSet rowSetWj = DbUtil.executeQuery(ctx, sql);
  180. // while(rowSetWj.next()){
  181. // if(rowSetWj.getString("FID") != null && rowSetWj.getString("FID") != ""){
  182. // result.put("pass","true");
  183. // }
  184. // else{
  185. // result.put("pass","false");
  186. // }
  187. // break;
  188. // }
  189. // return result;
  190. // }
  191. // catch(Exception e ){
  192. // logInfo("判 断是否为万净公司数据时发生了异常:"+e.getMessage());
  193. // e.printStackTrace();
  194. // return result;
  195. // }
  196. // }
  197. //
  198. // private static Logger logger = Logger.getLogger(FlucInBizBillHrManEditExtendHandler.class);
  199. // private void logInfo(String msg) {
  200. // System.out.println(msg);
  201. // logger.log(Priority.INFO, msg);
  202. // }
  203. }