| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492 |
- //
- // Source code recreated from a .class file by IntelliJ IDEA
- // (powered by FernFlower decompiler)
- //
- package com.kingdee.eas.custom.lgl.service;
- import com.google.common.collect.Maps;
- import com.kingdee.bos.BOSException;
- import com.kingdee.bos.BOSObjectFactory;
- import com.kingdee.bos.Context;
- import com.kingdee.bos.bsf.service.app.IHRMsfService;
- import com.kingdee.bos.dao.IObjectPK;
- import com.kingdee.bos.dao.ormapping.ObjectUuidPK;
- import com.kingdee.bos.util.BOSObjectType;
- import com.kingdee.eas.basedata.person.PersonFactory;
- import com.kingdee.eas.basedata.person.PersonInfo;
- import com.kingdee.eas.common.EASBizException;
- import com.kingdee.eas.framework.CoreBaseCollection;
- import com.kingdee.eas.framework.ICoreBase;
- import com.kingdee.eas.hr.affair.EmpEnrollBizBillCollection;
- import com.kingdee.eas.hr.affair.EmpEnrollBizBillEntryCollection;
- import com.kingdee.eas.hr.affair.EmpEnrollBizBillEntryInfo;
- import com.kingdee.eas.hr.affair.EmpEnrollBizBillFactory;
- import com.kingdee.eas.hr.affair.EmpEnrollBizBillInfo;
- import com.kingdee.eas.hr.affair.EmpHireBizBillCollection;
- import com.kingdee.eas.hr.affair.EmpHireBizBillEntryInfo;
- import com.kingdee.eas.hr.affair.EmpHireBizBillFactory;
- import com.kingdee.eas.hr.affair.EmpHireBizBillInfo;
- import com.kingdee.eas.hr.affair.FluctuationBizBillCollection;
- import com.kingdee.eas.hr.affair.FluctuationBizBillEntryCollection;
- import com.kingdee.eas.hr.affair.FluctuationBizBillEntryInfo;
- import com.kingdee.eas.hr.affair.FluctuationBizBillFactory;
- import com.kingdee.eas.hr.affair.FluctuationBizBillInfo;
- import com.kingdee.eas.hr.affair.ResignBizBillCollection;
- import com.kingdee.eas.hr.affair.ResignBizBillFactory;
- import com.kingdee.eas.hr.affair.ResignBizBillInfo;
- import com.kingdee.eas.hr.base.ApproveTypeEnum;
- import com.kingdee.eas.hr.base.HRBillStateEnum;
- import com.kingdee.eas.util.app.DbUtil;
- import com.kingdee.jdbc.rowset.IRowSet;
- import java.sql.SQLException;
- import java.text.DateFormat;
- import java.text.ParseException;
- import java.text.SimpleDateFormat;
- import java.util.HashMap;
- import java.util.Map;
- import org.apache.commons.lang3.StringUtils;
- public class SubmitEffHrService implements IHRMsfService {
- public Object process(Context arg0, Map arg1) throws EASBizException, BOSException {
- String types = (String)arg1.get("types");
- String id = (String)arg1.get("id");
- Map<Object, Object> reurnMap = Maps.newHashMapWithExpectedSize(10);
- System.out.println("人事事务单据审批通过接口:" + arg1);
- String zwjb = (String)arg1.get("zwjb");
- String sapDep = (String)arg1.get("sapDep");
- String yybmbm = (String)arg1.get("yybmbm");
- String yybm = (String)arg1.get("yybm");
- if (StringUtils.isNotBlank(sapDep) && sapDep.indexOf("-") > 0) {
- String[] sapDeps = sapDep.split("-");
- if(sapDeps.length == 2){
- yybmbm = sapDeps[0];
- yybm = sapDeps[1];
- }else if(sapDeps.length == 1){
- yybmbm = sapDeps[0];
- }
- }
- String groupClass = (String)arg1.get("groupClass");
- String groupClassDetails = (String)arg1.get("groupClassDetails");
- String reimLevel = (String)arg1.get("reimLevel");
- String bpcbmfldm = (String)arg1.get("bpcbmfldm");
- String fyfl1 = (String)arg1.get("fyfl1");
- String fyfl2 = (String)arg1.get("fyfl2");
- String bmfl3 = (String)arg1.get("bmfl3");
- String bmfl4 = (String)arg1.get("bmfl4");
- if (StringUtils.isNotBlank(groupClass) && groupClass.indexOf("-") > 0) {
- String[] groupClasss = groupClass.split("-");
- if (groupClasss.length == 3) {
- fyfl1 = groupClasss[0];
- fyfl2 = groupClasss[1];
- bmfl3 = groupClasss[2];
- }else if(groupClasss.length == 2) {
- fyfl1 = groupClasss[0];
- fyfl2 = groupClasss[1];
- }else if(groupClasss.length == 1) {
- fyfl1 = groupClasss[0];
- }
- }
- if ("rz".equals(types)) {
- String probation = (String)arg1.get("probation");
- String yearBonus = (String)arg1.get("yearBonus");
- String becomeDate = (String)arg1.get("becomeDate");
- String becomeMon = (String)arg1.get("becomeMon");
- String compDate = (String)arg1.get("compDate");
- String bizDate = (String)arg1.get("bizDate");
- reurnMap = this.submitEffectRZ(arg0, id, becomeMon, compDate, probation, yearBonus, becomeDate, bizDate, zwjb, yybmbm, groupClass, reimLevel, yybm, bpcbmfldm, groupClassDetails, fyfl1, fyfl2, bmfl3, groupClassDetails);
- } else if ("lz".equals(types)) {
- String bizDate = (String)arg1.get("compDate");
- reurnMap = this.submitEffectLZ(arg0, id, bizDate);
- } else if ("zz".equals(types)) {
- String becomeMon = (String)arg1.get("becomeMon");
- String compDate = (String)arg1.get("compDate");
- reurnMap = this.submitEffectZZ(arg0, id, becomeMon, compDate);
- } else if ("DD".equals(types)) {
- String becomeMon = (String)arg1.get("becomeMon");
- String compDate = (String)arg1.get("compDate");
- reurnMap = this.submitEffectDD(arg0, id, becomeMon, compDate, zwjb, yybmbm, groupClass, reimLevel, yybm, bpcbmfldm, groupClassDetails, fyfl1, fyfl2, bmfl3, groupClassDetails);
- }
- return reurnMap;
- }
- public Map<Object, Object> submitEffectRZ(Context ctx, String id, String becomeMon, String compDate, String probation, String yearBonus, String becomeDate, String bizDate, String zwjb, String yybmbm, String groupClass, String reimLevel, String yybm, String bpcbmfldm, String groupClassDetails, String fyfl1, String fyfl2, String bmfl3, String bmfl4) {
- Map reurnMap = new HashMap();
- String msg = null;
- String fid = null;
- String fnumber = null;
- StringBuffer reason = new StringBuffer();
- String msgType = null;
- String personNumber = null;
- String txStr = null;
- new EmpEnrollBizBillCollection();
- EmpEnrollBizBillInfo enInfo = new EmpEnrollBizBillInfo();
- PersonInfo peInfo = new PersonInfo();
- try {
- EmpEnrollBizBillCollection enCol = EmpEnrollBizBillFactory.getLocalInstance(ctx).getEmpEnrollBizBillCollection(" where number='" + id + "'");
- if (enCol.size() > 0) {
- DateFormat format1 = new SimpleDateFormat("yyyy-MM-dd");
- enInfo = enCol.get(0);
- EmpEnrollBizBillEntryCollection enInfoCON = enInfo.getEntrys();
- for(int i = 0; i < enInfoCON.size(); ++i) {
- EmpEnrollBizBillEntryInfo enInfoEny = enInfoCON.get(i);
- enInfoEny.put("yybmbm", yybmbm);
- enInfoEny.put("groupClass", groupClass);
- new PersonInfo();
- if (zwjb != null && "" != zwjb) {
- ICoreBase coreBase = (ICoreBase)BOSObjectFactory.createBOSObject(ctx, new BOSObjectType("DCBAAD05"));
- CoreBaseCollection coreBaseColl = coreBase.getCollection(" where number = '" + zwjb + "'");
- if (coreBaseColl.size() > 0) {
- enInfoEny.put("zwjb", coreBaseColl.get(0));
- }
- }
- enInfoEny.put("reimLevel", reimLevel);
- enInfoEny.put("yybm", yybm);
- enInfoEny.put("bpcbmfldm", bpcbmfldm);
- enInfoEny.put("groupClassDetails", groupClassDetails);
- enInfoEny.put("fyfl1", fyfl1);
- enInfoEny.put("fyfl2", fyfl2);
- enInfoEny.put("bmfl3", bmfl3);
- enInfoEny.put("bmfl4", bmfl4);
- }
- EmpEnrollBizBillFactory.getLocalInstance(ctx).save(enInfo);
- if (probation != null && probation != "") {
- enInfo.getEntrys().get(0).setProbation(Integer.valueOf(probation));
- }
- if (bizDate != null && !"".equals(bizDate)) {
- enInfo.getEntrys().get(0).setBizDate(format1.parse(bizDate));
- }
- enInfo.getEntrys().get(0).setPlanFormalDate(format1.parse(becomeDate));
- EmpEnrollBizBillFactory.getLocalInstance(ctx).submitEffect(enInfo);
- String peSql = "SELECT FNUMBER FROM T_BD_PERSON WHERE FID = (SELECT FPERSONID FROM T_HR_EmpEnrollBizBillEntry where FBILLID = (select FID from T_HR_EmpEnrollBizBill where FNUMBER = '" + id + "'))";
- IRowSet peSet = DbUtil.executeQuery(ctx, peSql.toString());
- if (peSet.next()) {
- personNumber = peSet.getString("FNUMBER");
- peInfo = PersonFactory.getLocalInstance(ctx).getPersonCollection(" where number='" + personNumber + "'").get(0);
- }
- } else {
- reason.append("单据编码为:" + id + " 入职单不存在,请检查相关信息!");
- }
- } catch (BOSException e) {
- e.printStackTrace();
- reason.append(e.getMessage());
- } catch (EASBizException e) {
- e.printStackTrace();
- reason.append(e.getMessage());
- } catch (SQLException e) {
- e.printStackTrace();
- reason.append(e.getMessage());
- } catch (ParseException e) {
- e.printStackTrace();
- reason.append(e.getMessage());
- }
- if (reason.length() > 0) {
- msg = "失败";
- msgType = "0";
- } else {
- msg = "成功";
- msgType = "1";
- fnumber = id;
- fid = enInfo.getId().toString();
- EmpEnrollBizBillEntryInfo ebEnInfo = enInfo.getEntrys().get(0);
- if (org.apache.commons.lang.StringUtils.isNotBlank(becomeMon)) {
- String rzStr = "UPDATE T_HR_EmpEnrollBizBillEntry SET CFGz='" + becomeMon + "',FZDY11='" + compDate + "' WHERE FBILLID = '" + fid + "'";
- String nzStr = "UPDATE T_HR_EmpEnrollBizBillEntry SET CFNzjfaID=(SELECT FID FROM CT_MP_Nzjfa where fname_l2 = '" + yearBonus + "') WHERE FBILLID = '" + fid + "'";
- try {
- DbUtil.execute(ctx, rzStr);
- DbUtil.execute(ctx, nzStr);
- } catch (BOSException e) {
- e.printStackTrace();
- }
- }
- this.setPersonEx(ctx, ebEnInfo, peInfo.getNumber());
- }
- if (txStr != null) {
- reurnMap.put("reason", reason.toString() + "," + txStr);
- } else {
- reurnMap.put("reason", reason.toString());
- }
- reurnMap.put("personNumber", personNumber);
- reurnMap.put("msgType", msgType);
- reurnMap.put("msg", msg);
- reurnMap.put("fid", fid);
- reurnMap.put("fnumber", fnumber);
- return reurnMap;
- }
- public Map<Object, Object> submitEffectLZ(Context ctx, String id, String bizDate) {
- Map reurnMap = new HashMap();
- String msg = null;
- String fid = null;
- String fnumber = null;
- StringBuffer reason = new StringBuffer();
- String msgType = null;
- DateFormat format1 = new SimpleDateFormat("yyyy-MM-dd");
- ResignBizBillInfo rbInfo = new ResignBizBillInfo();
- new ResignBizBillCollection();
- try {
- ResignBizBillCollection rbCol = ResignBizBillFactory.getLocalInstance(ctx).getResignBizBillCollection(" where number = '" + id + "'");
- if (rbCol.size() > 0) {
- rbInfo = rbCol.get(0);
- if (org.apache.commons.lang.StringUtils.isNotBlank(bizDate)) {
- rbInfo.getEntrys().get(0).setBizDate(format1.parse(bizDate));
- }
- ResignBizBillFactory.getLocalInstance(ctx).submitEffect(rbInfo);
- } else {
- reason.append("单据编码为:" + id + " 离职单不存在,请检查相关信息!");
- }
- } catch (EASBizException e) {
- e.printStackTrace();
- reason.append(e.getMessage());
- } catch (BOSException e) {
- e.printStackTrace();
- reason.append(e.getMessage());
- } catch (ParseException e) {
- e.printStackTrace();
- reason.append("离职生效日期格式转化异常_yyyy-MM-dd," + e.getMessage());
- }
- if (reason.length() > 0) {
- msg = "失败";
- msgType = "0";
- } else {
- msg = "成功";
- msgType = "1";
- fnumber = id;
- fid = rbInfo.getId().toString();
- }
- reurnMap.put("reason", reason.toString());
- reurnMap.put("msgType", msgType);
- reurnMap.put("msg", msg);
- reurnMap.put("fid", fid);
- reurnMap.put("fnumber", fnumber);
- return reurnMap;
- }
- public Map<Object, Object> submitEffectZZ(Context ctx, String id, String becomeMon, String compDate) {
- Map reurnMap = new HashMap();
- String msg = null;
- String fid = null;
- String fnumber = null;
- StringBuffer reason = new StringBuffer();
- String msgType = null;
- String txStr = null;
- EmpHireBizBillInfo ehInfo = new EmpHireBizBillInfo();
- new EmpHireBizBillCollection();
- try {
- EmpHireBizBillCollection ehCol = EmpHireBizBillFactory.getLocalInstance(ctx).getEmpHireBizBillCollection(" where number = '" + id + "'");
- if (ehCol.size() > 0) {
- ehInfo = ehCol.get(0);
- if (ehInfo.getBillState() == null) {
- ehInfo.setBillState(HRBillStateEnum.SAVED);
- }
- ehInfo.setIsMultiEntry(Boolean.TRUE);
- ehInfo.setApproveType(ApproveTypeEnum.DIRECT);
- EmpHireBizBillFactory.getLocalInstance(ctx).submitEffect(ehInfo);
- } else {
- reason.append("单据编码为:" + id + " 转正单不存在,请检查相关信息!");
- }
- } catch (BOSException e) {
- e.printStackTrace();
- reason.append(e.getMessage());
- } catch (EASBizException e) {
- e.printStackTrace();
- reason.append(e.getMessage());
- }
- if (reason.length() > 0) {
- msg = "失败";
- msgType = "0";
- } else {
- msg = "成功";
- msgType = "1";
- fnumber = id;
- fid = ehInfo.getId().toString();
- EmpHireBizBillEntryInfo ehEnInfo = ehInfo.getEntrys().get(0);
- if (org.apache.commons.lang.StringUtils.isNotBlank(becomeMon)) {
- String zzStr = "UPDATE T_HR_EmpHireBizBillEntry SET CFZzhxz='" + becomeMon + "',FZDY11='" + compDate + "' WHERE FBillID = '" + fid + "'";
- try {
- DbUtil.execute(ctx, zzStr);
- } catch (BOSException e) {
- e.printStackTrace();
- }
- }
- }
- if (txStr != null) {
- reurnMap.put("reason", reason.toString() + "," + txStr);
- } else {
- reurnMap.put("reason", reason.toString());
- }
- reurnMap.put("msgType", msgType);
- reurnMap.put("msg", msg);
- reurnMap.put("fid", fid);
- reurnMap.put("fnumber", fnumber);
- return reurnMap;
- }
- public Map<Object, Object> submitEffectDD(Context ctx, String id, String becomeMon, String compDate, String zwjb, String yybmbm, String groupClass, String reimLevel, String yybm, String bpcbmfldm, String groupClassDetails, String fyfl1, String fyfl2, String bmfl3, String bmfl4) {
- Map reurnMap = new HashMap();
- String fids = null;
- String msg = null;
- String fid = null;
- String fnumber = null;
- String personNum = null;
- StringBuffer reason = new StringBuffer();
- String msgType = null;
- String txStr = null;
- FluctuationBizBillInfo fuInfo = new FluctuationBizBillInfo();
- new FluctuationBizBillCollection();
- try {
- FluctuationBizBillCollection fuCol = FluctuationBizBillFactory.getLocalInstance(ctx).getFluctuationBizBillCollection(" where number= '" + id + "'");
- if (fuCol.size() > 0) {
- fuInfo = fuCol.get(0);
- FluctuationBizBillEntryCollection enInfoCON = fuInfo.getEntrys();
- for(int i = 0; i < enInfoCON.size(); ++i) {
- FluctuationBizBillEntryInfo enInfoEny = enInfoCON.get(i);
- enInfoEny.put("yybmbm", yybmbm);
- enInfoEny.put("groupClass", groupClass);
- new PersonInfo();
- if (zwjb != null && "" != zwjb) {
- ICoreBase coreBase = (ICoreBase)BOSObjectFactory.createBOSObject(ctx, new BOSObjectType("DCBAAD05"));
- CoreBaseCollection coreBaseColl = coreBase.getCollection(" where number = '" + zwjb + "'");
- if (coreBaseColl.size() > 0) {
- enInfoEny.put("zwjb", coreBaseColl.get(0));
- }
- }
- enInfoEny.put("reimLevel", reimLevel);
- enInfoEny.put("yybm", yybm);
- enInfoEny.put("bpcbmfldm", bpcbmfldm);
- enInfoEny.put("groupClassDetails", groupClassDetails);
- enInfoEny.put("fyfl1", fyfl1);
- enInfoEny.put("fyfl2", fyfl2);
- enInfoEny.put("bmfl3", bmfl3);
- enInfoEny.put("bmfl4", bmfl4);
- }
- FluctuationBizBillFactory.getLocalInstance(ctx).save(fuInfo);
- IObjectPK pks = FluctuationBizBillFactory.getLocalInstance(ctx).submitEffect(fuInfo);
- fids = pks.toString();
- } else {
- reason.append("单据编码为:" + id + " 调动单不存在,请检查相关信息!");
- }
- } catch (EASBizException e) {
- e.printStackTrace();
- reason.append(e.getMessage());
- } catch (BOSException e) {
- e.printStackTrace();
- reason.append(e.getMessage());
- }
- if (reason.length() > 0) {
- msg = "失败";
- msgType = "0";
- } else {
- msg = "成功";
- msgType = "1";
- fnumber = id;
- fid = fuInfo.getId().toString();
- FluctuationBizBillEntryInfo fuEnInfo = fuInfo.getEntrys().get(0);
- try {
- PersonInfo peInfo = PersonFactory.getLocalInstance(ctx).getPersonInfo(new ObjectUuidPK(fuEnInfo.getPerson().getId()));
- personNum = peInfo.getNumber();
- if (org.apache.commons.lang.StringUtils.isNotBlank(becomeMon)) {
- String ddStr = "UPDATE T_HR_FluctuationBizBillEntry SET CFDdhgz2='" + becomeMon + "',FZDY11='" + compDate + "' WHERE FBillID = '" + fid + "'";
- DbUtil.execute(ctx, ddStr);
- }
- } catch (EASBizException e) {
- e.printStackTrace();
- } catch (BOSException e) {
- e.printStackTrace();
- }
- this.setPersonDDEx(ctx, fids, personNum);
- }
- if (txStr != null) {
- reurnMap.put("reason", reason.toString() + "," + txStr);
- } else {
- reurnMap.put("reason", reason.toString());
- }
- reurnMap.put("msgType", msgType);
- reurnMap.put("msg", msg);
- reurnMap.put("fid", fid);
- reurnMap.put("fnumber", fnumber);
- return reurnMap;
- }
- public void setPersonDDEx(Context ctx, String ids, String personNum) {
- String xjbmSql = "select CFXjbmID from T_HR_FluctuationBizBillEntry WHERE FBillID = '" + ids + "'";
- try {
- IRowSet xjbmSet = DbUtil.executeQuery(ctx, xjbmSql);
- if (xjbmSet.next() && org.apache.commons.lang.StringUtils.isNotBlank(xjbmSet.getString("CFXjbmID"))) {
- String xjbmPeSql = "UPDATE T_BD_PERSON SET CFXjbmID='" + xjbmSet.getString("CFXjbmID") + "' WHERE FNUMBER = '" + personNum + "'";
- DbUtil.execute(ctx, xjbmPeSql);
- }
- } catch (BOSException e) {
- e.printStackTrace();
- } catch (SQLException e) {
- e.printStackTrace();
- }
- }
- public void setPersonEx(Context ctx, EmpEnrollBizBillEntryInfo ebEnInfo, String number) {
- String seSql = "select FStandingID,CFXjbmID,CFNzjfaID from T_HR_EmpEnrollBizBillEntry where FID= '" + ebEnInfo.getId().toString() + "'";
- try {
- IRowSet seSet = DbUtil.executeQuery(ctx, seSql.toString());
- if (seSet.next()) {
- if (org.apache.commons.lang.StringUtils.isNotBlank(seSet.getString("CFXjbmID"))) {
- String xjbmSql = "UPDATE T_BD_PERSON SET CFXjbmID='" + seSet.getString("CFXjbmID") + "' WHERE FNUMBER = '" + number + "'";
- DbUtil.execute(ctx, xjbmSql);
- }
- if (org.apache.commons.lang.StringUtils.isNotBlank(seSet.getString("FStandingID"))) {
- String rankSql = "UPDATE T_BD_PERSON SET FSTANDINGID='" + seSet.getString("FStandingID") + "' WHERE FNUMBER = '" + number + "'";
- DbUtil.execute(ctx, rankSql);
- }
- if (org.apache.commons.lang.StringUtils.isNotBlank(seSet.getString("CFNzjfaID"))) {
- String nzSql = "UPDATE T_BD_PERSON SET CFNzjfaID='" + seSet.getString("CFNzjfaID") + "' WHERE FNUMBER = '" + number + "'";
- DbUtil.execute(ctx, nzSql);
- }
- }
- } catch (BOSException e) {
- e.printStackTrace();
- System.out.println(e.getMessage());
- } catch (SQLException e) {
- e.printStackTrace();
- System.out.println(e.getMessage());
- }
- }
- }
|