|
|
@@ -7,7 +7,6 @@ import java.util.ArrayList;
|
|
|
import java.util.Calendar;
|
|
|
import java.util.Date;
|
|
|
import java.util.HashMap;
|
|
|
-import java.util.LinkedHashMap;
|
|
|
import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@@ -25,10 +24,7 @@ import com.kingdee.eas.basedata.person.IPerson;
|
|
|
import com.kingdee.eas.basedata.person.PersonFactory;
|
|
|
import com.kingdee.eas.basedata.person.PersonInfo;
|
|
|
import com.kingdee.eas.framework.DataBaseInfo;
|
|
|
-import com.kingdee.shr.compensation.CmpEmpORelationCollection;
|
|
|
-import com.kingdee.shr.compensation.CmpEmpORelationFactory;
|
|
|
-import com.kingdee.shr.compensation.CmpEmpORelationInfo;
|
|
|
-import com.kingdee.shr.compensation.ICmpEmpORelation;
|
|
|
+import com.kingdee.eas.hr.affair.*;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.apache.log4j.Logger;
|
|
|
import org.springframework.ui.ModelMap;
|
|
|
@@ -55,24 +51,23 @@ import com.kingdee.shr.compensation.app.integrate.CalSubmitSchemeInfo;
|
|
|
import com.kingdee.shr.compensation.util.columnModel.CmpColumnModels;
|
|
|
import com.kingdee.shr.compensation.web.handler.integrate.BatchSubmitShemeBillMySubmissionEditHandler;
|
|
|
import com.kingdee.shr.customer.gtiit.util.DateTimeUtils;
|
|
|
-import com.kingdee.bos.metadata.query.util.CompareType;
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 鎵╁睍鍛樺伐鑷�姪-鎴戣�鎻愭姤琛ㄥ崟handler
|
|
|
+ * 扩展员工自助-我要提报表单handler
|
|
|
*
|
|
|
* @author xiaoxin
|
|
|
*/
|
|
|
public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitShemeBillMySubmissionEditHandler {
|
|
|
- private static Logger logger =
|
|
|
- Logger.getLogger("com.kingdee.shr.customer.gtiit.handler.BatchSubmitShemeBillMySubmissionEditHandlerEx");
|
|
|
+ private static Logger logger = Logger.getLogger("com.kingdee.shr.customer.gtiit.handler.BatchSubmitShemeBillMySubmissionEditHandlerEx");
|
|
|
|
|
|
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
/**
|
|
|
- * 鑾峰彇寮€濮嬬粨鏉熸椂闂�
|
|
|
- * 缃椾繆鏂板�鏂规硶
|
|
|
+ * 获取开始结束时间
|
|
|
+ * 罗俊新增方法
|
|
|
* 2025-07-10
|
|
|
+ *
|
|
|
* @param request
|
|
|
* @param response
|
|
|
* @param modelMap
|
|
|
@@ -82,46 +77,49 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
public void getDateTimeAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws BOSException, SHRWebException {
|
|
|
String personId = request.getParameter("personId");
|
|
|
String type = request.getParameter("type");
|
|
|
- String adminOrgId = request.getParameter("adminOrgId");
|
|
|
+ String id = request.getParameter("id");
|
|
|
+ String effectDate = request.getParameter("effectDate");
|
|
|
+ String leffectDate = request.getParameter("leffectDate");
|
|
|
+ String ptlmanagerName = request.getParameter("ptlmanagerName");
|
|
|
String positionId = request.getParameter("positionId");
|
|
|
String hourlywage = request.getParameter("hourlywage");
|
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
|
if (StringUtils.isEmpty(personId) || StringUtils.isEmpty(type)) {
|
|
|
- throw new ShrWebBizException("鍛樺伐缂栫爜鎴栦换鑱岀被鍨嬩笉鑳戒负绌猴紒锛�");
|
|
|
+ throw new ShrWebBizException("员工编码或任职类型不能为空!!");
|
|
|
}
|
|
|
- //杩斿洖淇℃伅
|
|
|
+ //返回信息
|
|
|
Map map = new HashMap();
|
|
|
- //鍛樺伐淇℃伅
|
|
|
+ //员工信息
|
|
|
IPerson iPerson = PersonFactory.getLocalInstance(ctx);
|
|
|
IDynamicObject iDynamicObject = DynamicObjectFactory.getLocalInstance(ctx);
|
|
|
try {
|
|
|
PersonInfo personInfo = iPerson.getPersonInfo(new ObjectUuidPK(personId));
|
|
|
- //涓昏�浠昏亴
|
|
|
+ //主要任职
|
|
|
if (type.equals("Full")) {
|
|
|
- //EE23D375=鍏ㄨ亴鎴栧吋鑱�
|
|
|
+ //EE23D375=全职或兼职
|
|
|
DataBaseInfo ftorptInfo = (DataBaseInfo) personInfo.get("ftorpt");
|
|
|
if (ftorptInfo == null) {
|
|
|
- throw new ShrWebBizException("璇峰湪鍛樺伐淇℃伅缁存姢鍏ㄨ亴鎴栧吋鑱屽瓧娈碉紒锛�");
|
|
|
+ throw new ShrWebBizException("请在员工信息维护全职或兼职字段!!");
|
|
|
}
|
|
|
IObjectValue ftorpt = iDynamicObject.getValue(BOSObjectType.create("EE23D375"), new ObjectUuidPK(ftorptInfo.getId()));
|
|
|
- //鍏ヨ亴鏃ユ湡
|
|
|
+ //入职日期
|
|
|
Date hireDate = personInfo.getHireDate();
|
|
|
map.put("startDate", sdf.format(hireDate));
|
|
|
if (ftorpt.get("number").equals("FULL")) {
|
|
|
- //鍏ㄨ亴 鑾峰彇鍏ヨ亴鏃ユ湡浠ュ強鍚堝悓淇℃伅鏈€鏂扮殑缁撴潫鏃ユ湡 D8595360=鍚堝悓淇℃伅
|
|
|
- //鏌ヨ�鏉′欢
|
|
|
+ //全职 获取入职日期以及合同信息最新的结束日期 D8595360=合同信息
|
|
|
+ //查询条件
|
|
|
FilterInfo filterInfo = new FilterInfo();
|
|
|
FilterItemCollection filterItems = filterInfo.getFilterItems();
|
|
|
filterItems.add(new FilterItemInfo("person", personId));
|
|
|
- //鎺掑簭
|
|
|
+ //排序
|
|
|
SorterItemCollection sc = new SorterItemCollection();
|
|
|
SorterItemInfo sorterItem = new SorterItemInfo("ExpiredDate");
|
|
|
sorterItem.setSortType(SortType.DESCEND);
|
|
|
sc.add(sorterItem);
|
|
|
- //鎺掑簭鑾峰彇绗�竴鏉℃渶鏂扮殑鏁版嵁
|
|
|
+ //排序获取第一条最新的数据
|
|
|
EntityViewInfo entityViewInfo = EntityViewInfo.getInstance(filterInfo, null, sc);
|
|
|
IObjectCollection collection = iDynamicObject.getCollection(BOSObjectType.create("D8595360"), entityViewInfo);
|
|
|
- //缁撴潫鏃堕棿
|
|
|
+ //结束时间
|
|
|
Date expiredDate = null;
|
|
|
if (collection.size() > 0) {
|
|
|
IObjectValue pcontractinfo = collection.getObject(0);
|
|
|
@@ -130,38 +128,56 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
}
|
|
|
map.put("endDate", expiredDate == null ? "" : sdf.format(expiredDate));
|
|
|
} else if (ftorpt.get("number").equals("PART")) {
|
|
|
- //鍏艰亴 鑾峰彇鍏ヨ亴鏃ユ湡浠ュ強鍛樺伐淇℃伅鍏艰亴绫讳汉鍛樹换鑱岀粨鏉熸椂闂�
|
|
|
+ //兼职 获取入职日期以及员工信息兼职类人员任职结束时间
|
|
|
Date jobEndTime = (Date) personInfo.get("jobEndTime");
|
|
|
map.put("endDate", jobEndTime == null ? "" : sdf.format(jobEndTime));
|
|
|
}
|
|
|
- } else if (type.equals("Part")) {//鍏艰亴浠昏亴
|
|
|
- if (StringUtils.isEmpty(adminOrgId) || StringUtils.isEmpty(positionId)) {
|
|
|
- throw new ShrWebBizException("缁勭粐ID鎴栬亴浣岻D涓嶈兘涓虹┖锛侊紒");
|
|
|
+ } else if (type.equals("Part")) {//兼职任职
|
|
|
+ if (StringUtils.isEmpty(id)) {
|
|
|
+ throw new ShrWebBizException("人员任职信息Id不能为空!!");
|
|
|
}
|
|
|
- //鍙戣柂妗f�浠昏亴鍒嗗綍
|
|
|
- ICmpEmpORelation iCmpEmpORelation = CmpEmpORelationFactory.getLocalInstance(ctx);
|
|
|
+ //兼职单
|
|
|
+ IPluralityAddBizBillEntry iPluralityAddBizBillEntry = PluralityAddBizBillEntryFactory.getLocalInstance(ctx);
|
|
|
FilterInfo filterInfo = new FilterInfo();
|
|
|
FilterItemCollection filterItems = filterInfo.getFilterItems();
|
|
|
- filterItems.add(new FilterItemInfo("empOrgRelation.person", personInfo.getId().toString()));
|
|
|
- filterItems.add(new FilterItemInfo("empOrgRelation.adminOrg", adminOrgId));
|
|
|
- filterItems.add(new FilterItemInfo("empOrgRelation.position", positionId));
|
|
|
- filterItems.add(new FilterItemInfo("empOrgRelation.hourlywage", StringUtils.isEmpty(hourlywage) ? null : hourlywage));
|
|
|
- filterItems.add(new FilterItemInfo("leffectDate", "2199-12-31 00:00:00"));
|
|
|
+ filterItems.add(new FilterItemInfo("person.id", personId));
|
|
|
+ filterItems.add(new FilterItemInfo("bizDate", DateTimeUtils.parseDate(effectDate)));
|
|
|
+ filterItems.add(new FilterItemInfo("ptlmanager.name", ptlmanagerName));
|
|
|
+ filterItems.add(new FilterItemInfo("position.id", positionId));
|
|
|
+ filterItems.add(new FilterItemInfo("pthwage", hourlywage));
|
|
|
+ filterItems.add(new FilterItemInfo("bill.billState", 3));
|
|
|
EntityViewInfo entityViewInfo = EntityViewInfo.getInstance(filterInfo, null, null);
|
|
|
- logger.error("鍙戣柂妗f�浠昏亴鍒嗗綍鏌ヨ�person:" + personInfo.getId().toString() + ";adminOrg:" + adminOrgId + "; position:" + positionId + "; hourlywage:" + hourlywage);
|
|
|
- CmpEmpORelationCollection cmpEmpORelationCollection = iCmpEmpORelation.getCmpEmpORelationCollection(entityViewInfo);
|
|
|
- logger.error("鏌ヨ�鍒癈mpEmpORelationCollection鏁伴噺:" + cmpEmpORelationCollection.size());
|
|
|
- //if (cmpEmpORelationCollection.size() > 1) {
|
|
|
- // throw new ShrWebBizException("鍛樺伐浠昏亴淇℃伅鏁版嵁寮傚父锛岃�鎺掓煡鏄�惁瀛樺湪澶氭潯[浜哄憳銆佺粍缁囥€佽亴浣嶃€佹椂钖猐鏁版嵁锛侊紒");
|
|
|
- //}
|
|
|
- if (null != cmpEmpORelationCollection && cmpEmpORelationCollection.size() > 0) {
|
|
|
- CmpEmpORelationInfo cmpEmpORelationInfo = cmpEmpORelationCollection.get(0);
|
|
|
- //鐢熸晥鏃ユ湡
|
|
|
- Date effectDate = cmpEmpORelationInfo.getEffectDate();
|
|
|
- //澶辨晥鏃ユ湡
|
|
|
- Date leffectDate = cmpEmpORelationInfo.getLeffectDate();
|
|
|
- map.put("startDate", sdf.format(effectDate));
|
|
|
- map.put("endDate", sdf.format(leffectDate));
|
|
|
+ System.out.println("查询兼职单信息SQL:" + entityViewInfo.getFilter().toSql());
|
|
|
+ logger.error("查询兼职单信息SQL:" + entityViewInfo.getFilter().toSql());
|
|
|
+ PluralityAddBizBillEntryCollection pluralityAddBizBillEntryCollection = iPluralityAddBizBillEntry.getPluralityAddBizBillEntryCollection(entityViewInfo);
|
|
|
+ System.out.println("pluralityAddBizBillEntryCollection:" + pluralityAddBizBillEntryCollection.size());
|
|
|
+ map.put("startDate", effectDate);
|
|
|
+ if (pluralityAddBizBillEntryCollection.size() > 0) {
|
|
|
+ PluralityAddBizBillEntryInfo pluralityAddBizBillEntryInfo = pluralityAddBizBillEntryCollection.get(0);
|
|
|
+ Date bizDate = null;
|
|
|
+ //查询单据是否存在兼职终止单
|
|
|
+ IPluralityDelBizBillEntry iPluralityDelBizBillEntry = PluralityDelBizBillEntryFactory.getLocalInstance(ctx);
|
|
|
+ FilterInfo filterInfo2 = new FilterInfo();
|
|
|
+ FilterItemCollection filterItems2 = filterInfo.getFilterItems();
|
|
|
+ filterItems2.add(new FilterItemInfo("person.id", personId));
|
|
|
+ filterItems2.add(new FilterItemInfo("beginDate", DateTimeUtils.parseDate(effectDate)));
|
|
|
+ filterItems2.add(new FilterItemInfo("ptlmanager.name", ptlmanagerName));
|
|
|
+ filterItems2.add(new FilterItemInfo("position.id", positionId));
|
|
|
+ filterItems2.add(new FilterItemInfo("pthwage", hourlywage));
|
|
|
+ filterItems2.add(new FilterItemInfo("bill.billState", 3));
|
|
|
+ EntityViewInfo entityViewInfo2 = EntityViewInfo.getInstance(filterInfo, null, null);
|
|
|
+ PluralityDelBizBillEntryCollection pluralityDelBizBillEntryCollection = iPluralityDelBizBillEntry.getPluralityDelBizBillEntryCollection(entityViewInfo2);
|
|
|
+ //判断是否存在兼职终止单 存在获取兼职终止单结束日期 不存在获取兼职单结束日期
|
|
|
+ if (pluralityDelBizBillEntryCollection.size() > 0) {
|
|
|
+ PluralityDelBizBillEntryInfo pluralityDelBizBillEntryInfo = pluralityDelBizBillEntryCollection.get(0);
|
|
|
+ bizDate = pluralityDelBizBillEntryInfo.getBizDate();
|
|
|
+ } else {
|
|
|
+ bizDate = pluralityAddBizBillEntryInfo.getEndDate();
|
|
|
+ }
|
|
|
+ map.put("endDate", sdf.format(bizDate));
|
|
|
+ } else {
|
|
|
+ throw new ShrWebBizException("未查询到兼职单信息!!");
|
|
|
+ //map.put("endDate", leffectDate);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
@@ -174,8 +190,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public String getEditGridColModelAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
|
|
|
- throws SHRWebException {
|
|
|
+ public String getEditGridColModelAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
|
|
|
String submitSchemeId = request.getParameter("submitSchemeId");
|
|
|
if (StringUtils.isEmpty(submitSchemeId)) {
|
|
|
JSONUtils.writeJson(response, modelMap);
|
|
|
@@ -209,8 +224,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
- protected void beforeSubmit(HttpServletRequest request, HttpServletResponse response, CoreBaseInfo model)
|
|
|
- throws SHRWebException {
|
|
|
+ protected void beforeSubmit(HttpServletRequest request, HttpServletResponse response, CoreBaseInfo model) throws SHRWebException {
|
|
|
super.beforeSubmit(request, response, model);
|
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
|
BatchSubmitShemeBillInfo info = (BatchSubmitShemeBillInfo) model;
|
|
|
@@ -224,7 +238,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
}
|
|
|
}
|
|
|
String sql = "select cfistakecheck,CFIsCurrentDepart from T_HR_SCalSubmitScheme where fid = '" + info.getSubmitScheme().getId().toString() + "'";
|
|
|
- //鏄�惁鍙備笌鏍¢獙
|
|
|
+ //是否参与校验
|
|
|
boolean isPlanCheck = false;
|
|
|
try {
|
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
|
|
|
@@ -247,7 +261,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 鏍¢獙鑱屼綅涓嶅厑璁告彁浜ゆ硶瀹氳妭鍋囨棩閭eぉ
|
|
|
+ * 校验职位不允许提交法定节假日那天
|
|
|
*
|
|
|
* @param info
|
|
|
* @throws ShrWebBizException
|
|
|
@@ -255,13 +269,8 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
public void checkPosition(BatchSubmitShemeBillInfo info) throws ShrWebBizException {
|
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
|
String billId = info.getId().toString();
|
|
|
- String sql = "select b.FNAME_L1 from T_HR_SchemeBillEntry a left join T_ORG_Position b on a.FPOSITIONID = b.FID "
|
|
|
- + "where a.FBILLID = '" + billId + "' "
|
|
|
- + "and b.FNAME_L1 = (SELECT fname_l2 FROM T_HR_SHRRSVITEM0 where fstate = '1' and FNUMBER = '1007') "
|
|
|
- + "and EXISTS (SELECT d.CFWORKMULTIPLE FROM T_HR_ATS_LegalHoliday c "
|
|
|
- + "left join T_HR_ATS_LegalHolidayItem d on c.fid = d.FGROUPID where c.FSTATE = '1' "
|
|
|
- + "and d.CFWORKMULTIPLE = '3' and d.FSTARTDATE <= a.feffectdate and d.FENDDATE >= a.feffectdate)";
|
|
|
- logger.error("鏌ヨ�鑱屼綅瀵瑰簲鏃ユ湡鏄�惁鍦ㄦ硶瀹氳妭鍋囨棩SQL锛�" + sql);
|
|
|
+ String sql = "select b.FNAME_L1 from T_HR_SchemeBillEntry a left join T_ORG_Position b on a.FPOSITIONID = b.FID " + "where a.FBILLID = '" + billId + "' " + "and b.FNAME_L1 = (SELECT fname_l2 FROM T_HR_SHRRSVITEM0 where fstate = '1' and FNUMBER = '1007') " + "and EXISTS (SELECT d.CFWORKMULTIPLE FROM T_HR_ATS_LegalHoliday c " + "left join T_HR_ATS_LegalHolidayItem d on c.fid = d.FGROUPID where c.FSTATE = '1' " + "and d.CFWORKMULTIPLE = '3' and d.FSTARTDATE <= a.feffectdate and d.FENDDATE >= a.feffectdate)";
|
|
|
+ logger.error("查询职位对应日期是否在法定节假日SQL:" + sql);
|
|
|
try {
|
|
|
boolean flag = false;
|
|
|
String positionName = "";
|
|
|
@@ -281,7 +290,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 鏍¢獙璇ュ憳宸ユ湰鏈堢殑寮€濮嬫椂闂村拰缁撴潫鏃堕棿鏈夋病鏈夐噸鍙�
|
|
|
+ * 校验该员工本月的开始时间和结束时间有没有重叠
|
|
|
*
|
|
|
* @param info
|
|
|
* @throws ShrWebBizException
|
|
|
@@ -291,7 +300,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
|
|
|
BatchSubmitShemeBillEntryCollection entryColl = info.getEntry();
|
|
|
String billId = info.getId().toString();
|
|
|
- logger.error("鍗曟嵁ID锛�" + billId);
|
|
|
+ logger.error("单据ID:" + billId);
|
|
|
Date effectDate = entryColl.get(0).getEffectDate();
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
calendar.setTime(effectDate);
|
|
|
@@ -303,14 +312,8 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
String endDateStr = DateTimeUtils.dateFormat(endDate, "yyyy-MM-dd");
|
|
|
|
|
|
boolean flag = false;
|
|
|
- String sql = "SELECT a.*,b.billNumber FROM T_HR_SchemeBillEntry a , "
|
|
|
- + "(SELECT a.fnumber billNumber,b.* FROM T_HR_SBatchSubmitShemeBill a "
|
|
|
- + "left join T_HR_SchemeBillEntry b on a.fid = b.fbillid "
|
|
|
- + "where a.FBILLSTATE in ('1','2','3') and b.FPERSONID = '" + personId + "' "
|
|
|
- + "and b.FEFFECTDATE >= '" + startDateStr + "' and b.FEFFECTDATE < '" + endDateStr + "' and a.FDATASOURCE = '1') b "
|
|
|
- + "where a.FBILLID = '" + billId + "' and a.cfstarttime < b.CFENDTIME "
|
|
|
- + "and a.cfendtime > b.CFSTARTTIME";
|
|
|
- logger.error("鏌ヨ�鏄�惁鏈夋椂闂存�閲嶅彔鏁版嵁SQL锛�" + sql);
|
|
|
+ String sql = "SELECT a.*,b.billNumber FROM T_HR_SchemeBillEntry a , " + "(SELECT a.fnumber billNumber,b.* FROM T_HR_SBatchSubmitShemeBill a " + "left join T_HR_SchemeBillEntry b on a.fid = b.fbillid " + "where a.FBILLSTATE in ('1','2','3') and b.FPERSONID = '" + personId + "' " + "and b.FEFFECTDATE >= '" + startDateStr + "' and b.FEFFECTDATE < '" + endDateStr + "' and a.FDATASOURCE = '1') b " + "where a.FBILLID = '" + billId + "' and a.cfstarttime < b.CFENDTIME " + "and a.cfendtime > b.CFSTARTTIME";
|
|
|
+ logger.error("查询是否有时间段重叠数据SQL:" + sql);
|
|
|
try {
|
|
|
IRowSet rowSet = DbUtil.executeQuery(ctx, sql);
|
|
|
String billNumber = "";
|
|
|
@@ -330,7 +333,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 鏍¢獙鍛樺伐姣忔湀鎻愪氦宸ユ椂涓嶈兘瓒呰繃鏈€澶у伐鏃舵暟
|
|
|
+ * 校验员工每月提交工时不能超过最大工时数
|
|
|
*
|
|
|
* @param info
|
|
|
* @throws ShrWebBizException
|
|
|
@@ -340,9 +343,9 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
|
|
|
BatchSubmitShemeBillEntryCollection entryColl = info.getEntry();
|
|
|
- //涓婃湀宸ユ椂鏁�
|
|
|
+ //上月工时数
|
|
|
BigDecimal lastHours = BigDecimal.ZERO;
|
|
|
- //褰撴湀宸ユ椂鏁�
|
|
|
+ //当月工时数
|
|
|
BigDecimal currentHour = BigDecimal.ZERO;
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
int currentYear = calendar.get(Calendar.YEAR);
|
|
|
@@ -363,7 +366,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
String paramSql = "SELECT FNUMBER,fname_l2 name FROM T_HR_SHRRSVITEM0 where fstate = '1' and FNUMBER = '1003'";
|
|
|
IRowSet paramRow = DbUtil.executeQuery(ctx, paramSql);
|
|
|
while (paramRow.next()) {
|
|
|
- //鏈€澶у伐鏃舵暟
|
|
|
+ //最大工时数
|
|
|
if (paramRow.getString("FNUMBER").equals("1003")) {
|
|
|
maxHour = paramRow.getObject("name") == null ? BigDecimal.ZERO : paramRow.getBigDecimal("name");
|
|
|
}
|
|
|
@@ -384,9 +387,9 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
totalHour = totalHour.add(lastHours);
|
|
|
|
|
|
BigDecimal adjustHour = BigDecimal.ZERO;
|
|
|
- //鑾峰彇璋冩暣宸ユ椂鏁�
|
|
|
+ //获取调整工时数
|
|
|
String adjustSql = "/*dialect*/SELECT cfadjustinghours FROM CT_MP_Ptworkinghours where fpersonid='" + personId + "' and DATE_TRUNC('month', cfeffectivedate)<='" + sdf.format(startDate) + "' and cfenddate>='" + sdf.format(startDate) + "' order by FLastUpdateTime desc limit 1";
|
|
|
- logger.error("鑾峰彇璋冩暣宸ユ椂SQL锛�" + adjustSql);
|
|
|
+ logger.error("获取调整工时SQL:" + adjustSql);
|
|
|
IRowSet adjustRow = DbUtil.executeQuery(ctx, adjustSql);
|
|
|
while (adjustRow.next()) {
|
|
|
adjustHour = adjustRow.getObject("cfadjustinghours") == null ? BigDecimal.ZERO : adjustRow.getBigDecimal("cfadjustinghours");
|
|
|
@@ -411,9 +414,9 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
totalHour = totalHour.add(lastHours);
|
|
|
|
|
|
BigDecimal adjustHour = BigDecimal.ZERO;
|
|
|
- //鑾峰彇璋冩暣宸ユ椂鏁�
|
|
|
+ //获取调整工时数
|
|
|
String adjustSql = "/*dialect*/SELECT cfadjustinghours FROM CT_MP_Ptworkinghours where fpersonid='" + personId + "' and DATE_TRUNC('month', cfeffectivedate)<='" + sdf.format(startDate) + "' and cfenddate>='" + sdf.format(startDate) + "' order by FLastUpdateTime desc limit 1";
|
|
|
- logger.error("鑾峰彇璋冩暣宸ユ椂SQL锛�" + adjustSql);
|
|
|
+ logger.error("获取调整工时SQL:" + adjustSql);
|
|
|
IRowSet adjustRow = DbUtil.executeQuery(ctx, adjustSql);
|
|
|
while (adjustRow.next()) {
|
|
|
adjustHour = adjustRow.getObject("cfadjustinghours") == null ? BigDecimal.ZERO : adjustRow.getBigDecimal("cfadjustinghours");
|
|
|
@@ -430,7 +433,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 鏍¢獙鍛樺伐璇ヨ亴浣嶆瘡涓�湀鍙�兘鎻愪氦涓€娆�
|
|
|
+ * 校验员工该职位每个月只能提交一次
|
|
|
*
|
|
|
* @param info
|
|
|
* @throws ShrWebBizException
|
|
|
@@ -439,9 +442,9 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
|
String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
|
|
|
BatchSubmitShemeBillEntryCollection entryColl = info.getEntry();
|
|
|
- //鏄�惁鏈変笂鏈堝彂鐢熸棩鏈�
|
|
|
+ //是否有上月发生日期
|
|
|
boolean isLastMonth = false;
|
|
|
- //鏄�惁鏈夊綋鏈堝彂鐢熸棩鏈�
|
|
|
+ //是否有当月发生日期
|
|
|
boolean isCurrentMonth = false;
|
|
|
String positionId = "";
|
|
|
String superiorId = "";
|
|
|
@@ -460,7 +463,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
positionId = entryInfo.getPosition().getId().toString();
|
|
|
superiorId = entryInfo.getString("superiorId");
|
|
|
}
|
|
|
- logger.error("鑱屼綅ID锛�" + positionId + ", 鐩存帴涓婄骇ID锛�" + superiorId);
|
|
|
+ logger.error("职位ID:" + positionId + ", 直接上级ID:" + superiorId);
|
|
|
|
|
|
try {
|
|
|
if (isLastMonth) {
|
|
|
@@ -472,12 +475,12 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
|
|
|
int count = 0;
|
|
|
String sql = "select count(1) count from T_HR_SBatchSubmitShemeBill a left join T_HR_SchemeBillEntry b on a.fid=b.fbillid where b.FPERSONID = '" + personId + "' and b.FPOSITIONID = '" + positionId + "' and b.CFSuperiorID = '" + superiorId + "' and a.fbillstate in ('1','2','3') and a.fdatasource = '1' and b.FEFFECTDATE >= '" + startDate + "' and b.FEFFECTDATE < '" + endDate + "'";
|
|
|
- logger.error("鏌ヨ�鍛樺伐璇ヨ亴浣嶅綋鏈堟彁浜ゆ�鏁癝QL锛�" + sql);
|
|
|
+ logger.error("查询员工该职位当月提交次数SQL:" + sql);
|
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
|
|
|
while (iRowSet.next()) {
|
|
|
count = iRowSet.getInt("count");
|
|
|
}
|
|
|
- logger.error("鍛樺伐璇ヨ亴浣嶅綋鏈堟彁浜ゆ�鏁帮細" + count);
|
|
|
+ logger.error("员工该职位当月提交次数:" + count);
|
|
|
if (count > 0) {
|
|
|
throw new ShrWebBizException("The employee submits the position once within a month");
|
|
|
}
|
|
|
@@ -492,12 +495,12 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
|
|
|
int count = 0;
|
|
|
String sql = "select count(1) count from T_HR_SBatchSubmitShemeBill a left join T_HR_SchemeBillEntry b on a.fid=b.fbillid where b.FPERSONID = '" + personId + "' and b.FPOSITIONID = '" + positionId + "' and b.CFSuperiorID = '" + superiorId + "' and a.fbillstate in ('1','2','3') and a.fdatasource = '1' and b.FEFFECTDATE >= '" + startDate + "' and b.FEFFECTDATE < '" + endDate + "'";
|
|
|
- logger.error("鏌ヨ�鍛樺伐璇ヨ亴浣嶅綋鏈堟彁浜ゆ�鏁癝QL锛�" + sql);
|
|
|
+ logger.error("查询员工该职位当月提交次数SQL:" + sql);
|
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
|
|
|
while (iRowSet.next()) {
|
|
|
count = iRowSet.getInt("count");
|
|
|
}
|
|
|
- logger.error("鍛樺伐璇ヨ亴浣嶅綋鏈堟彁浜ゆ�鏁帮細" + count);
|
|
|
+ logger.error("员工该职位当月提交次数:" + count);
|
|
|
if (count > 0) {
|
|
|
throw new ShrWebBizException("The employee submits the position once within a month");
|
|
|
}
|
|
|
@@ -510,15 +513,14 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 鏍¢獙XX鍙蜂箣鍚庝笉鍏佽�鎻愪氦
|
|
|
+ * 校验XX号之后不允许提交
|
|
|
*
|
|
|
* @param request
|
|
|
* @param response
|
|
|
* @param modelMap
|
|
|
* @throws SHRWebException
|
|
|
*/
|
|
|
- public void checkSumbitDateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
|
|
|
- throws SHRWebException {
|
|
|
+ public void checkSumbitDateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
|
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
|
int day = 0;
|
|
|
Calendar calendar = Calendar.getInstance();
|
|
|
@@ -546,7 +548,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
|
|
|
|
|
|
/**
|
|
|
- * 鏍规嵁浜哄憳id鑾峰彇瀹冪殑鐩村睘涓婄骇id鍜屾椂钖�
|
|
|
+ * 根据人员id获取它的直属上级id和时薪
|
|
|
*
|
|
|
* @param request
|
|
|
* @param response
|
|
|
@@ -554,8 +556,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
* @return
|
|
|
* @throws SHRWebException
|
|
|
*/
|
|
|
- public String getPersonCareerDataAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
|
|
|
- throws SHRWebException {
|
|
|
+ public String getPersonCareerDataAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
|
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
|
String personId = request.getParameter("personId");
|
|
|
String parentId = "";
|
|
|
@@ -579,7 +580,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 鑾峰彇褰撳墠鍛樺伐鐨勬渶鏂板叆鑱屾棩鏈�
|
|
|
+ * 获取当前员工的最新入职日期
|
|
|
*
|
|
|
* @param request
|
|
|
* @param response
|
|
|
@@ -587,8 +588,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
* @return
|
|
|
* @throws SHRWebException
|
|
|
*/
|
|
|
- public String getInductionDateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
|
|
|
- throws SHRWebException {
|
|
|
+ public String getInductionDateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
|
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
|
String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
|
|
|
String sql = "select b.fenterdate from (SELECT FPERSONID,max(FEFFDT) as maxDate FROM T_HR_EmpLaborRelationHis group by fpersonid) a left join T_HR_EmpLaborRelationHis b on a.fpersonid=b.fpersonid and a.maxdate=b.FEFFDT where a.fpersonid='" + personId + "'";
|
|
|
@@ -609,7 +609,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 鏌ヨ�浜哄憳瀵瑰簲鑱屼綅鐨勬渶鏂扮殑鍚堝悓寮€濮嬪拰缁撴潫鏃ユ湡
|
|
|
+ * 查询人员对应职位的最新的合同开始和结束日期
|
|
|
*
|
|
|
* @param request
|
|
|
* @param response
|
|
|
@@ -617,31 +617,31 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
* @throws SHRWebException
|
|
|
*/
|
|
|
public void getContractDateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
|
|
|
- //鑱屼綅id
|
|
|
+ //职位id
|
|
|
String positionId = request.getParameter("positionId");
|
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
|
String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
|
|
|
// String sql = "SELECT b.cfcommencingdate,b.cfexpireddate FROM (SELECT max(cfcommencingdate) maxdate,fpersonid,cfpositionid FROM CT_MP_Pcontractinfo group by fpersonid,cfpositionid) a left join CT_MP_Pcontractinfo b on a.maxdate=b.cfcommencingdate and a.fpersonid=b.fpersonid and a.cfpositionid=b.cfpositionid where a.fpersonid='"+personId+"' and a.cfpositionid='"+positionId+"' and b.cftype!='1'";
|
|
|
String sql = "SELECT cfcommencingdate,cfexpireddate,cftype FROM CT_MP_Pcontractinfo where fpersonid='" + personId + "' and cfpositionid='" + positionId + "' order by cfcommencingdate asc";
|
|
|
- logger.error("鏌ヨ�鍚堝悓淇℃伅SQL锛�" + sql);
|
|
|
+ logger.error("查询合同信息SQL:" + sql);
|
|
|
Date beginContractDate = null;
|
|
|
Date endContractDate = null;
|
|
|
String contractType = "";
|
|
|
try {
|
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
|
|
|
/*while(iRowSet.next()) {
|
|
|
- //鍚堝悓寮€濮嬫棩鏈�
|
|
|
+ //合同开始日期
|
|
|
beginContractDate = iRowSet.getDate("cfcommencingdate");
|
|
|
- //鍚堝悓缁撴潫鏃ユ湡
|
|
|
+ //合同结束日期
|
|
|
endContractDate = iRowSet.getDate("cfexpireddate");
|
|
|
}*/
|
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
|
while (iRowSet.next()) {
|
|
|
- //鍚堝悓寮€濮嬫棩鏈�
|
|
|
+ //合同开始日期
|
|
|
Date beginDate = iRowSet.getDate("cfcommencingdate");
|
|
|
- //鍚堝悓缁撴潫鏃ユ湡
|
|
|
+ //合同结束日期
|
|
|
Date endDate = iRowSet.getDate("cfexpireddate");
|
|
|
- //鍚堝悓绫诲瀷
|
|
|
+ //合同类型
|
|
|
String type = iRowSet.getString("cftype");
|
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
|
map.put("beginDate", beginDate);
|
|
|
@@ -656,7 +656,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
Date endDate = (Date) map.get("endDate");
|
|
|
String type = (String) map.get("type");
|
|
|
|
|
|
- //鑾峰彇杩炵画鏃堕棿娈电殑寮€濮嬫棩鏈熷拰缁撴潫鏃ユ湡锛屽�鏋滀腑闂村悎鍚岀被鍨嬪彂鐢熷彉鍔ㄦ垨鑰呮棩鏈熶腑鏂�紝鍒欓噸鏂拌�绠�
|
|
|
+ //获取连续时间段的开始日期和结束日期,如果中间合同类型发生变动或者日期中断,则重新计算
|
|
|
if (StringUtils.equals(contractType, type)) {
|
|
|
Calendar beginCalendar = Calendar.getInstance();
|
|
|
Calendar endCalendar = Calendar.getInstance();
|
|
|
@@ -693,7 +693,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 鏍¢獙鏈堟彁浜ゆ€诲伐鏃朵笉鑳藉ぇ浜庢渶澶у伐鏃�(搴熷純)
|
|
|
+ * 校验月提交总工时不能大于最大工时(废弃)
|
|
|
*
|
|
|
* @param request
|
|
|
* @param response
|
|
|
@@ -701,8 +701,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
* @return
|
|
|
* @throws SHRWebException
|
|
|
*/
|
|
|
- public String checkEscalationDateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap)
|
|
|
- throws SHRWebException {
|
|
|
+ public String checkEscalationDateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
|
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
|
String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
|
|
|
BigDecimal hours = new BigDecimal(request.getParameter("hours"));
|
|
|
@@ -720,7 +719,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
String paramSql = "SELECT FNUMBER,fname_l2 name FROM T_HR_SHRRSVITEM0 where fstate = '1' and (FNUMBER = '1003' or FNUMBER = '1004')";
|
|
|
IRowSet paramRow = DbUtil.executeQuery(ctx, paramSql);
|
|
|
while (paramRow.next()) {
|
|
|
- //鏈€澶у伐鏃舵暟
|
|
|
+ //最大工时数
|
|
|
if (paramRow.getString("FNUMBER").equals("1003")) {
|
|
|
maxHour = paramRow.getObject("name") == null ? BigDecimal.ZERO : paramRow.getBigDecimal("name");
|
|
|
}
|
|
|
@@ -728,7 +727,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
day = paramRow.getObject("name") == null ? 0 : paramRow.getInt("name");
|
|
|
}
|
|
|
}
|
|
|
- //鏍¢獙XX鍙蜂箣鍚庝笉鍏佽�鎻愪氦
|
|
|
+ //校验XX号之后不允许提交
|
|
|
if (thisDay > day) {
|
|
|
modelMap.put("resultMessage", "It is not allowed to submit the previous month's work hours after the " + day + "th of each month");
|
|
|
JSONUtils.writeJson(response, modelMap);
|
|
|
@@ -744,7 +743,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
totalHour = totalHour.add(hours);
|
|
|
|
|
|
BigDecimal adjustHour = BigDecimal.ZERO;
|
|
|
- //鑾峰彇璋冩暣宸ユ椂鏁�
|
|
|
+ //获取调整工时数
|
|
|
String adjustSql = "SELECT cfadjustinghours FROM CT_MP_Ptworkinghours where fpersonid='" + personId + "' and cfeffectivedate>='" + sdf.format(stratDate) + "' and cfeffectivedate<'" + sdf.format(endDate) + "'";
|
|
|
IRowSet adjustRow = DbUtil.executeQuery(ctx, adjustSql);
|
|
|
while (adjustRow.next()) {
|
|
|
@@ -764,7 +763,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 姹囨€诲垎褰曠殑宸ユ椂鍜岄噾棰濆埌鍗曞ご
|
|
|
+ * 汇总分录的工时和金额到单头
|
|
|
*
|
|
|
* @param request
|
|
|
* @param response
|
|
|
@@ -800,7 +799,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 鏍规嵁鎻愭姤鏃ユ湡鍒ゆ柇娉曞畾鑺傚亣鏃ュ拰浼戞伅鏃�
|
|
|
+ * 根据提报日期判断法定节假日和休息日
|
|
|
*
|
|
|
* @param request
|
|
|
* @param response
|
|
|
@@ -810,18 +809,18 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
public void workMultipleAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
|
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
|
String otDate = request.getParameter("otDate");
|
|
|
- logger.error("鎻愭姤鏃ユ湡锛�" + otDate);
|
|
|
+ logger.error("提报日期:" + otDate);
|
|
|
Date parseDate = DateTimeUtils.parseDate(otDate, "yyyy-MM-dd");
|
|
|
otDate = DateTimeUtils.dateFormat(parseDate, "yyyy-MM-dd");
|
|
|
String sql = "SELECT b.CFWORKMULTIPLE FROM T_HR_ATS_LegalHoliday a left join T_HR_ATS_LegalHolidayItem b on a.fid = b.FGROUPID where a.FSTATE = '1' and b.FSTARTDATE <= '" + otDate + "' and b.FENDDATE >= '" + otDate + "'";
|
|
|
- logger.error("鏌ヨ�鍔犵彮绫诲瀷SQL锛�" + sql);
|
|
|
+ logger.error("查询加班类型SQL:" + sql);
|
|
|
Map<String, String> returnMap = new HashMap<String, String>();
|
|
|
try {
|
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
|
|
|
boolean flag = false;
|
|
|
while (iRowSet.next()) {
|
|
|
if (StringUtils.equals(iRowSet.getString("CFWORKMULTIPLE"), "3")) {
|
|
|
- //娉曞畾鑺傚亣鏃ュ姞鐝�
|
|
|
+ //法定节假日加班
|
|
|
flag = true;
|
|
|
}
|
|
|
}
|
|
|
@@ -832,7 +831,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
calendar.setTime(parseDate);
|
|
|
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
|
|
|
if (dayOfWeek == Calendar.SATURDAY || dayOfWeek == Calendar.SUNDAY) {
|
|
|
- //浼戞伅鏃ュ姞鐝�
|
|
|
+ //休息日加班
|
|
|
returnMap.put("returnType", "1");
|
|
|
}
|
|
|
}
|
|
|
@@ -844,8 +843,9 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
JSONUtils.writeJson(response, returnMap);
|
|
|
}
|
|
|
|
|
|
+
|
|
|
/**
|
|
|
- * 鏍规嵁浜哄憳妗f�鑾峰彇褰撴湀鏄�惁绂昏亴鎴栧吋鑱屽け鏁�
|
|
|
+ * 根据人员档案获取当月是否离职或兼职失效
|
|
|
*
|
|
|
* @param request
|
|
|
* @param response
|
|
|
@@ -861,25 +861,24 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
int currentMonth = calendar.get(Calendar.MONTH) + 1;
|
|
|
boolean flag = false;
|
|
|
String cmpSql = "select b.fassigntype,b.fpositionid from T_HR_SCmpEmpORelation a left join T_HR_EmpOrgRelation b on a.FEMPORGRELATIONID = b.fid where a.fid ='" + cmpOrgRelationId + "'";
|
|
|
- logger.error("鏌ヨ�鍛樺伐妗f�淇℃伅SQL锛�" + cmpSql);
|
|
|
+ logger.error("查询员工档案信息SQL:" + cmpSql);
|
|
|
try {
|
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, cmpSql);
|
|
|
- //浠昏亴绫诲瀷
|
|
|
+ //任职类型
|
|
|
String assignType = "";
|
|
|
- //鑱屼綅id
|
|
|
+ //职位id
|
|
|
String positionId = "";
|
|
|
while (iRowSet.next()) {
|
|
|
assignType = iRowSet.getString("fassigntype");
|
|
|
positionId = iRowSet.getString("fpositionid");
|
|
|
}
|
|
|
- //涓昏�浠昏亴鏃�
|
|
|
+ //主要任职时
|
|
|
if (StringUtils.equals(assignType, "1")) {
|
|
|
String resignSql = "select year(b.FBIZDATE) year,month(b.FBIZDATE) month from T_HR_ResignBizBill a left join T_HR_ResignBizBillentry b on a.fid=b.fbillid where b.FPERSONID ='" + personId + "' and a.FBILLSTATE = '3' order by b.FBIZDATE desc";
|
|
|
- logger.error("鏌ヨ�鍛樺伐绂昏亴鍗昐QL锛�" + resignSql);
|
|
|
+ logger.error("查询员工离职单SQL:" + resignSql);
|
|
|
IRowSet resignRow = DbUtil.executeQuery(ctx, resignSql);
|
|
|
int resignYear = 0;
|
|
|
int resignMonth = 0;
|
|
|
- //coyle 202507 鏀圭敤if
|
|
|
if (resignRow.next()) {
|
|
|
resignYear = resignRow.getInt("year");
|
|
|
resignMonth = resignRow.getInt("month");
|
|
|
@@ -889,11 +888,10 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
}
|
|
|
} else {
|
|
|
String empSql = "select top 1 year(fleffdt) year,month(fleffdt) month from T_HR_EmpOrgRelation where fpositionid = '" + positionId + "' and fpersonid='" + personId + "' order by feffdt desc";
|
|
|
- logger.error("鏌ヨ�鍛樺伐鍏艰亴SQL锛�" + empSql);
|
|
|
+ logger.error("查询员工兼职SQL:" + empSql);
|
|
|
int leffdtYear = 0;
|
|
|
int leffdtMonth = 0;
|
|
|
IRowSet empRow = DbUtil.executeQuery(ctx, empSql);
|
|
|
- //coyle 202507 鏀圭敤if
|
|
|
if (empRow.next()) {
|
|
|
leffdtYear = empRow.getInt("year");
|
|
|
leffdtMonth = empRow.getInt("month");
|
|
|
@@ -912,7 +910,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 鍛樺伐鍚屼竴鑱屼綅涓€涓�湀鍐呭彧鑳芥彁浜や竴娆�
|
|
|
+ * 员工同一职位一个月内只能提交一次
|
|
|
*
|
|
|
* @param request
|
|
|
* @param response
|
|
|
@@ -932,13 +930,13 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
|
|
|
int count = 0;
|
|
|
String sql = "SELECT count(1) count FROM T_HR_SBatchSubmitShemeBill where fid in (select distinct a.fid from T_HR_SBatchSubmitShemeBill a left join T_HR_SchemeBillEntry b on a.fid=b.fbillid where a.FPROPOSERID = '" + personId + "' and b.FPOSITIONID = '" + positionId + "' and a.fbillstate in ('1','2','3') and a.fdatasource = '1' and a.FSUBMITTIME >= '" + startDate + "' and a.FSUBMITTIME < '" + endDate + "')";
|
|
|
- logger.error("鏌ヨ�鍛樺伐璇ヨ亴浣嶅綋鏈堟彁浜ゆ�鏁癝QL锛�" + sql);
|
|
|
+ logger.error("查询员工该职位当月提交次数SQL:" + sql);
|
|
|
try {
|
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
|
|
|
while (iRowSet.next()) {
|
|
|
count = iRowSet.getInt("count");
|
|
|
}
|
|
|
- logger.error("鍛樺伐璇ヨ亴浣嶅綋鏈堟彁浜ゆ�鏁帮細" + count);
|
|
|
+ logger.error("员工该职位当月提交次数:" + count);
|
|
|
} catch (BOSException e) {
|
|
|
e.printStackTrace();
|
|
|
} catch (SQLException e) {
|
|
|
@@ -949,7 +947,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
- * 鍒ゆ柇鏄�惁鍙備笌鏍¢獙
|
|
|
+ * 判断是否参与校验
|
|
|
*
|
|
|
* @param request
|
|
|
* @param response
|
|
|
@@ -958,15 +956,15 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
*/
|
|
|
public void isTakeCheckAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
|
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
|
- //鎻愭姤鏂规�ID
|
|
|
+ //提报方案ID
|
|
|
String calSchemeId = request.getParameter("calSchemeId");
|
|
|
- logger.error("鎻愭姤鏂规�ID锛�" + calSchemeId);
|
|
|
- //鏄�惁鍙備笌鏍¢獙
|
|
|
+ logger.error("提报方案ID:" + calSchemeId);
|
|
|
+ //是否参与校验
|
|
|
boolean isPlanCheck = false;
|
|
|
- //褰撴湀绂昏亴澶勭悊
|
|
|
+ //当月离职处理
|
|
|
boolean isCurrentDepart = false;
|
|
|
String sql = "select cfistakecheck,CFIsCurrentDepart from T_HR_SCalSubmitScheme where fid = '" + calSchemeId + "'";
|
|
|
- logger.error("鏌ヨ�鎻愭姤鏂规�SQL锛�" + sql);
|
|
|
+ logger.error("查询提报方案SQL:" + sql);
|
|
|
try {
|
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
|
|
|
while (iRowSet.next()) {
|