|
@@ -59,7 +59,7 @@ import com.kingdee.bos.metadata.query.util.CompareType;
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 鎵╁睍鍛樺伐鑷�姪-鎴戣�鎻愭姤琛ㄥ崟handler
|
|
|
|
|
|
+ * 扩展员工自助-我要提报表单handler
|
|
*
|
|
*
|
|
* @author xiaoxin
|
|
* @author xiaoxin
|
|
*/
|
|
*/
|
|
@@ -70,7 +70,8 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
private SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 鑾峰彇寮€濮嬬粨鏉熸椂闂�
|
|
|
|
|
|
+ * 获取开始结束时间
|
|
|
|
+ * QW新增方法
|
|
*
|
|
*
|
|
* @param request
|
|
* @param request
|
|
* @param response
|
|
* @param response
|
|
@@ -86,41 +87,41 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
String hourlywage = request.getParameter("hourlywage");
|
|
String hourlywage = request.getParameter("hourlywage");
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
if (StringUtils.isEmpty(personId) || StringUtils.isEmpty(type)) {
|
|
if (StringUtils.isEmpty(personId) || StringUtils.isEmpty(type)) {
|
|
- throw new ShrWebBizException("鍛樺伐缂栫爜鎴栦换鑱岀被鍨嬩笉鑳戒负绌猴紒锛�");
|
|
|
|
|
|
+ throw new ShrWebBizException("员工编码或任职类型不能为空!!");
|
|
}
|
|
}
|
|
- //杩斿洖淇℃伅
|
|
|
|
|
|
+ //返回信息
|
|
Map map = new HashMap();
|
|
Map map = new HashMap();
|
|
- //鍛樺伐淇℃伅
|
|
|
|
|
|
+ //员工信息
|
|
IPerson iPerson = PersonFactory.getLocalInstance(ctx);
|
|
IPerson iPerson = PersonFactory.getLocalInstance(ctx);
|
|
IDynamicObject iDynamicObject = DynamicObjectFactory.getLocalInstance(ctx);
|
|
IDynamicObject iDynamicObject = DynamicObjectFactory.getLocalInstance(ctx);
|
|
try {
|
|
try {
|
|
PersonInfo personInfo = iPerson.getPersonInfo(new ObjectUuidPK(personId));
|
|
PersonInfo personInfo = iPerson.getPersonInfo(new ObjectUuidPK(personId));
|
|
- //涓昏�浠昏亴
|
|
|
|
|
|
+ //主要任职
|
|
if (type.equals("Full")) {
|
|
if (type.equals("Full")) {
|
|
- //EE23D375=鍏ㄨ亴鎴栧吋鑱�
|
|
|
|
|
|
+ //EE23D375=全职或兼职
|
|
DataBaseInfo ftorptInfo = (DataBaseInfo) personInfo.get("ftorpt");
|
|
DataBaseInfo ftorptInfo = (DataBaseInfo) personInfo.get("ftorpt");
|
|
if (ftorptInfo == null) {
|
|
if (ftorptInfo == null) {
|
|
- throw new ShrWebBizException("璇峰湪鍛樺伐淇℃伅缁存姢鍏ㄨ亴鎴栧吋鑱屽瓧娈碉紒锛�");
|
|
|
|
|
|
+ throw new ShrWebBizException("请在员工信息维护全职或兼职字段!!");
|
|
}
|
|
}
|
|
IObjectValue ftorpt = iDynamicObject.getValue(BOSObjectType.create("EE23D375"), new ObjectUuidPK(ftorptInfo.getId()));
|
|
IObjectValue ftorpt = iDynamicObject.getValue(BOSObjectType.create("EE23D375"), new ObjectUuidPK(ftorptInfo.getId()));
|
|
- //鍏ヨ亴鏃ユ湡
|
|
|
|
|
|
+ //入职日期
|
|
Date hireDate = personInfo.getHireDate();
|
|
Date hireDate = personInfo.getHireDate();
|
|
map.put("startDate", sdf.format(hireDate));
|
|
map.put("startDate", sdf.format(hireDate));
|
|
if (ftorpt.get("number").equals("FULL")) {
|
|
if (ftorpt.get("number").equals("FULL")) {
|
|
- //鍏ㄨ亴 鑾峰彇鍏ヨ亴鏃ユ湡浠ュ強鍚堝悓淇℃伅鏈€鏂扮殑缁撴潫鏃ユ湡 D8595360=鍚堝悓淇℃伅
|
|
|
|
- //鏌ヨ�鏉′欢
|
|
|
|
|
|
+ //全职 获取入职日期以及合同信息最新的结束日期 D8595360=合同信息
|
|
|
|
+ //查询条件
|
|
FilterInfo filterInfo = new FilterInfo();
|
|
FilterInfo filterInfo = new FilterInfo();
|
|
FilterItemCollection filterItems = filterInfo.getFilterItems();
|
|
FilterItemCollection filterItems = filterInfo.getFilterItems();
|
|
filterItems.add(new FilterItemInfo("person", personId));
|
|
filterItems.add(new FilterItemInfo("person", personId));
|
|
- //鎺掑簭
|
|
|
|
|
|
+ //排序
|
|
SorterItemCollection sc = new SorterItemCollection();
|
|
SorterItemCollection sc = new SorterItemCollection();
|
|
SorterItemInfo sorterItem = new SorterItemInfo("ExpiredDate");
|
|
SorterItemInfo sorterItem = new SorterItemInfo("ExpiredDate");
|
|
sorterItem.setSortType(SortType.DESCEND);
|
|
sorterItem.setSortType(SortType.DESCEND);
|
|
sc.add(sorterItem);
|
|
sc.add(sorterItem);
|
|
- //鎺掑簭鑾峰彇绗�竴鏉℃渶鏂扮殑鏁版嵁
|
|
|
|
|
|
+ //排序获取第一条最新的数据
|
|
EntityViewInfo entityViewInfo = EntityViewInfo.getInstance(filterInfo, null, sc);
|
|
EntityViewInfo entityViewInfo = EntityViewInfo.getInstance(filterInfo, null, sc);
|
|
IObjectCollection collection = iDynamicObject.getCollection(BOSObjectType.create("D8595360"), entityViewInfo);
|
|
IObjectCollection collection = iDynamicObject.getCollection(BOSObjectType.create("D8595360"), entityViewInfo);
|
|
- //缁撴潫鏃堕棿
|
|
|
|
|
|
+ //结束时间
|
|
Date expiredDate = null;
|
|
Date expiredDate = null;
|
|
if (collection.size() > 0) {
|
|
if (collection.size() > 0) {
|
|
IObjectValue pcontractinfo = collection.getObject(0);
|
|
IObjectValue pcontractinfo = collection.getObject(0);
|
|
@@ -129,15 +130,15 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
}
|
|
}
|
|
map.put("endDate", expiredDate == null ? "" : sdf.format(expiredDate));
|
|
map.put("endDate", expiredDate == null ? "" : sdf.format(expiredDate));
|
|
} else if (ftorpt.get("number").equals("PART")) {
|
|
} else if (ftorpt.get("number").equals("PART")) {
|
|
- //鍏艰亴 鑾峰彇鍏ヨ亴鏃ユ湡浠ュ強鍛樺伐淇℃伅鍏艰亴绫讳汉鍛樹换鑱岀粨鏉熸椂闂�
|
|
|
|
|
|
+ //兼职 获取入职日期以及员工信息兼职类人员任职结束时间
|
|
Date jobEndTime = (Date) personInfo.get("jobEndTime");
|
|
Date jobEndTime = (Date) personInfo.get("jobEndTime");
|
|
map.put("endDate", jobEndTime == null ? "" : sdf.format(jobEndTime));
|
|
map.put("endDate", jobEndTime == null ? "" : sdf.format(jobEndTime));
|
|
}
|
|
}
|
|
- } else if (type.equals("Part")) {//鍏艰亴浠昏亴
|
|
|
|
|
|
+ } else if (type.equals("Part")) {//兼职任职
|
|
if (StringUtils.isEmpty(adminOrgId) || StringUtils.isEmpty(positionId)) {
|
|
if (StringUtils.isEmpty(adminOrgId) || StringUtils.isEmpty(positionId)) {
|
|
- throw new ShrWebBizException("缁勭粐ID鎴栬亴浣岻D涓嶈兘涓虹┖锛侊紒");
|
|
|
|
|
|
+ throw new ShrWebBizException("组织ID或职位ID不能为空!!");
|
|
}
|
|
}
|
|
- //鍙戣柂妗f�浠昏亴鍒嗗綍
|
|
|
|
|
|
+ //发薪档案任职分录
|
|
ICmpEmpORelation iCmpEmpORelation = CmpEmpORelationFactory.getLocalInstance(ctx);
|
|
ICmpEmpORelation iCmpEmpORelation = CmpEmpORelationFactory.getLocalInstance(ctx);
|
|
FilterInfo filterInfo = new FilterInfo();
|
|
FilterInfo filterInfo = new FilterInfo();
|
|
FilterItemCollection filterItems = filterInfo.getFilterItems();
|
|
FilterItemCollection filterItems = filterInfo.getFilterItems();
|
|
@@ -145,20 +146,19 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
filterItems.add(new FilterItemInfo("empOrgRelation.adminOrg", adminOrgId));
|
|
filterItems.add(new FilterItemInfo("empOrgRelation.adminOrg", adminOrgId));
|
|
filterItems.add(new FilterItemInfo("empOrgRelation.position", positionId));
|
|
filterItems.add(new FilterItemInfo("empOrgRelation.position", positionId));
|
|
filterItems.add(new FilterItemInfo("empOrgRelation.hourlywage", StringUtils.isEmpty(hourlywage) ? null : hourlywage));
|
|
filterItems.add(new FilterItemInfo("empOrgRelation.hourlywage", StringUtils.isEmpty(hourlywage) ? null : hourlywage));
|
|
|
|
+ filterItems.add(new FilterItemInfo("leffectDate", "2199-12-31 00:00:00"));
|
|
EntityViewInfo entityViewInfo = EntityViewInfo.getInstance(filterInfo, null, null);
|
|
EntityViewInfo entityViewInfo = EntityViewInfo.getInstance(filterInfo, null, null);
|
|
- logger.error("鍙戣柂妗f�浠昏亴鍒嗗綍鏌ヨ�person:" + personInfo.getId().toString() + ";adminOrg:" + adminOrgId + "; position:" + positionId + "; hourlywage:" + hourlywage);
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+ logger.error("发薪档案任职分录查询person:" + personInfo.getId().toString() + ";adminOrg:" + adminOrgId + "; position:" + positionId + "; hourlywage:" + hourlywage);
|
|
CmpEmpORelationCollection cmpEmpORelationCollection = iCmpEmpORelation.getCmpEmpORelationCollection(entityViewInfo);
|
|
CmpEmpORelationCollection cmpEmpORelationCollection = iCmpEmpORelation.getCmpEmpORelationCollection(entityViewInfo);
|
|
- logger.error("鏌ヨ�鍒癈mpEmpORelationCollection鏁伴噺:" + cmpEmpORelationCollection.size());
|
|
|
|
- if (cmpEmpORelationCollection.size() > 1) {
|
|
|
|
- throw new ShrWebBizException("鍛樺伐浠昏亴淇℃伅鏁版嵁寮傚父锛岃�鎺掓煡鏄�惁瀛樺湪澶氭潯[浜哄憳銆佺粍缁囥€佽亴浣嶃€佹椂钖猐鏁版嵁锛侊紒");
|
|
|
|
- }
|
|
|
|
- if (null != cmpEmpORelationCollection && cmpEmpORelationCollection.size() == 1) {
|
|
|
|
|
|
+ logger.error("查询到CmpEmpORelationCollection数量:" + cmpEmpORelationCollection.size());
|
|
|
|
+ //if (cmpEmpORelationCollection.size() > 1) {
|
|
|
|
+ // throw new ShrWebBizException("员工任职信息数据异常,请排查是否存在多条[人员、组织、职位、时薪]数据!!");
|
|
|
|
+ //}
|
|
|
|
+ if (null != cmpEmpORelationCollection && cmpEmpORelationCollection.size() > 0) {
|
|
CmpEmpORelationInfo cmpEmpORelationInfo = cmpEmpORelationCollection.get(0);
|
|
CmpEmpORelationInfo cmpEmpORelationInfo = cmpEmpORelationCollection.get(0);
|
|
- //鐢熸晥鏃ユ湡
|
|
|
|
|
|
+ //生效日期
|
|
Date effectDate = cmpEmpORelationInfo.getEffectDate();
|
|
Date effectDate = cmpEmpORelationInfo.getEffectDate();
|
|
- //澶辨晥鏃ユ湡
|
|
|
|
|
|
+ //失效日期
|
|
Date leffectDate = cmpEmpORelationInfo.getLeffectDate();
|
|
Date leffectDate = cmpEmpORelationInfo.getLeffectDate();
|
|
map.put("startDate", sdf.format(effectDate));
|
|
map.put("startDate", sdf.format(effectDate));
|
|
map.put("endDate", sdf.format(leffectDate));
|
|
map.put("endDate", sdf.format(leffectDate));
|
|
@@ -224,7 +224,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
}
|
|
}
|
|
}
|
|
}
|
|
String sql = "select cfistakecheck,CFIsCurrentDepart from T_HR_SCalSubmitScheme where fid = '" + info.getSubmitScheme().getId().toString() + "'";
|
|
String sql = "select cfistakecheck,CFIsCurrentDepart from T_HR_SCalSubmitScheme where fid = '" + info.getSubmitScheme().getId().toString() + "'";
|
|
- //鏄�惁鍙備笌鏍¢獙
|
|
|
|
|
|
+ //是否参与校验
|
|
boolean isPlanCheck = false;
|
|
boolean isPlanCheck = false;
|
|
try {
|
|
try {
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
|
|
@@ -247,7 +247,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 鏍¢獙鑱屼綅涓嶅厑璁告彁浜ゆ硶瀹氳妭鍋囨棩閭eぉ
|
|
|
|
|
|
+ * 校验职位不允许提交法定节假日那天
|
|
*
|
|
*
|
|
* @param info
|
|
* @param info
|
|
* @throws ShrWebBizException
|
|
* @throws ShrWebBizException
|
|
@@ -261,7 +261,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
+ "and EXISTS (SELECT d.CFWORKMULTIPLE FROM T_HR_ATS_LegalHoliday c "
|
|
+ "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' "
|
|
+ "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)";
|
|
+ "and d.CFWORKMULTIPLE = '3' and d.FSTARTDATE <= a.feffectdate and d.FENDDATE >= a.feffectdate)";
|
|
- logger.error("鏌ヨ�鑱屼綅瀵瑰簲鏃ユ湡鏄�惁鍦ㄦ硶瀹氳妭鍋囨棩SQL锛�" + sql);
|
|
|
|
|
|
+ logger.error("查询职位对应日期是否在法定节假日SQL:" + sql);
|
|
try {
|
|
try {
|
|
boolean flag = false;
|
|
boolean flag = false;
|
|
String positionName = "";
|
|
String positionName = "";
|
|
@@ -281,7 +281,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 鏍¢獙璇ュ憳宸ユ湰鏈堢殑寮€濮嬫椂闂村拰缁撴潫鏃堕棿鏈夋病鏈夐噸鍙�
|
|
|
|
|
|
+ * 校验该员工本月的开始时间和结束时间有没有重叠
|
|
*
|
|
*
|
|
* @param info
|
|
* @param info
|
|
* @throws ShrWebBizException
|
|
* @throws ShrWebBizException
|
|
@@ -291,7 +291,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
|
|
String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
|
|
BatchSubmitShemeBillEntryCollection entryColl = info.getEntry();
|
|
BatchSubmitShemeBillEntryCollection entryColl = info.getEntry();
|
|
String billId = info.getId().toString();
|
|
String billId = info.getId().toString();
|
|
- logger.error("鍗曟嵁ID锛�" + billId);
|
|
|
|
|
|
+ logger.error("单据ID:" + billId);
|
|
Date effectDate = entryColl.get(0).getEffectDate();
|
|
Date effectDate = entryColl.get(0).getEffectDate();
|
|
Calendar calendar = Calendar.getInstance();
|
|
Calendar calendar = Calendar.getInstance();
|
|
calendar.setTime(effectDate);
|
|
calendar.setTime(effectDate);
|
|
@@ -310,7 +310,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
+ "and b.FEFFECTDATE >= '" + startDateStr + "' and b.FEFFECTDATE < '" + endDateStr + "' and a.FDATASOURCE = '1') b "
|
|
+ "and b.FEFFECTDATE >= '" + startDateStr + "' and b.FEFFECTDATE < '" + endDateStr + "' and a.FDATASOURCE = '1') b "
|
|
+ "where a.FBILLID = '" + billId + "' and a.cfstarttime < b.CFENDTIME "
|
|
+ "where a.FBILLID = '" + billId + "' and a.cfstarttime < b.CFENDTIME "
|
|
+ "and a.cfendtime > b.CFSTARTTIME";
|
|
+ "and a.cfendtime > b.CFSTARTTIME";
|
|
- logger.error("鏌ヨ�鏄�惁鏈夋椂闂存�閲嶅彔鏁版嵁SQL锛�" + sql);
|
|
|
|
|
|
+ logger.error("查询是否有时间段重叠数据SQL:" + sql);
|
|
try {
|
|
try {
|
|
IRowSet rowSet = DbUtil.executeQuery(ctx, sql);
|
|
IRowSet rowSet = DbUtil.executeQuery(ctx, sql);
|
|
String billNumber = "";
|
|
String billNumber = "";
|
|
@@ -330,7 +330,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 鏍¢獙鍛樺伐姣忔湀鎻愪氦宸ユ椂涓嶈兘瓒呰繃鏈€澶у伐鏃舵暟
|
|
|
|
|
|
+ * 校验员工每月提交工时不能超过最大工时数
|
|
*
|
|
*
|
|
* @param info
|
|
* @param info
|
|
* @throws ShrWebBizException
|
|
* @throws ShrWebBizException
|
|
@@ -340,9 +340,9 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
|
|
String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
|
|
BatchSubmitShemeBillEntryCollection entryColl = info.getEntry();
|
|
BatchSubmitShemeBillEntryCollection entryColl = info.getEntry();
|
|
- //涓婃湀宸ユ椂鏁�
|
|
|
|
|
|
+ //上月工时数
|
|
BigDecimal lastHours = BigDecimal.ZERO;
|
|
BigDecimal lastHours = BigDecimal.ZERO;
|
|
- //褰撴湀宸ユ椂鏁�
|
|
|
|
|
|
+ //当月工时数
|
|
BigDecimal currentHour = BigDecimal.ZERO;
|
|
BigDecimal currentHour = BigDecimal.ZERO;
|
|
Calendar calendar = Calendar.getInstance();
|
|
Calendar calendar = Calendar.getInstance();
|
|
int currentYear = calendar.get(Calendar.YEAR);
|
|
int currentYear = calendar.get(Calendar.YEAR);
|
|
@@ -363,7 +363,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
String paramSql = "SELECT FNUMBER,fname_l2 name FROM T_HR_SHRRSVITEM0 where fstate = '1' and FNUMBER = '1003'";
|
|
String paramSql = "SELECT FNUMBER,fname_l2 name FROM T_HR_SHRRSVITEM0 where fstate = '1' and FNUMBER = '1003'";
|
|
IRowSet paramRow = DbUtil.executeQuery(ctx, paramSql);
|
|
IRowSet paramRow = DbUtil.executeQuery(ctx, paramSql);
|
|
while (paramRow.next()) {
|
|
while (paramRow.next()) {
|
|
- //鏈€澶у伐鏃舵暟
|
|
|
|
|
|
+ //最大工时数
|
|
if (paramRow.getString("FNUMBER").equals("1003")) {
|
|
if (paramRow.getString("FNUMBER").equals("1003")) {
|
|
maxHour = paramRow.getObject("name") == null ? BigDecimal.ZERO : paramRow.getBigDecimal("name");
|
|
maxHour = paramRow.getObject("name") == null ? BigDecimal.ZERO : paramRow.getBigDecimal("name");
|
|
}
|
|
}
|
|
@@ -384,9 +384,9 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
totalHour = totalHour.add(lastHours);
|
|
totalHour = totalHour.add(lastHours);
|
|
|
|
|
|
BigDecimal adjustHour = BigDecimal.ZERO;
|
|
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";
|
|
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);
|
|
IRowSet adjustRow = DbUtil.executeQuery(ctx, adjustSql);
|
|
while (adjustRow.next()) {
|
|
while (adjustRow.next()) {
|
|
adjustHour = adjustRow.getObject("cfadjustinghours") == null ? BigDecimal.ZERO : adjustRow.getBigDecimal("cfadjustinghours");
|
|
adjustHour = adjustRow.getObject("cfadjustinghours") == null ? BigDecimal.ZERO : adjustRow.getBigDecimal("cfadjustinghours");
|
|
@@ -411,9 +411,9 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
totalHour = totalHour.add(lastHours);
|
|
totalHour = totalHour.add(lastHours);
|
|
|
|
|
|
BigDecimal adjustHour = BigDecimal.ZERO;
|
|
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";
|
|
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);
|
|
IRowSet adjustRow = DbUtil.executeQuery(ctx, adjustSql);
|
|
while (adjustRow.next()) {
|
|
while (adjustRow.next()) {
|
|
adjustHour = adjustRow.getObject("cfadjustinghours") == null ? BigDecimal.ZERO : adjustRow.getBigDecimal("cfadjustinghours");
|
|
adjustHour = adjustRow.getObject("cfadjustinghours") == null ? BigDecimal.ZERO : adjustRow.getBigDecimal("cfadjustinghours");
|
|
@@ -430,7 +430,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 鏍¢獙鍛樺伐璇ヨ亴浣嶆瘡涓�湀鍙�兘鎻愪氦涓€娆�
|
|
|
|
|
|
+ * 校验员工该职位每个月只能提交一次
|
|
*
|
|
*
|
|
* @param info
|
|
* @param info
|
|
* @throws ShrWebBizException
|
|
* @throws ShrWebBizException
|
|
@@ -439,9 +439,9 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
|
|
String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
|
|
BatchSubmitShemeBillEntryCollection entryColl = info.getEntry();
|
|
BatchSubmitShemeBillEntryCollection entryColl = info.getEntry();
|
|
- //鏄�惁鏈変笂鏈堝彂鐢熸棩鏈�
|
|
|
|
|
|
+ //是否有上月发生日期
|
|
boolean isLastMonth = false;
|
|
boolean isLastMonth = false;
|
|
- //鏄�惁鏈夊綋鏈堝彂鐢熸棩鏈�
|
|
|
|
|
|
+ //是否有当月发生日期
|
|
boolean isCurrentMonth = false;
|
|
boolean isCurrentMonth = false;
|
|
String positionId = "";
|
|
String positionId = "";
|
|
String superiorId = "";
|
|
String superiorId = "";
|
|
@@ -460,7 +460,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
positionId = entryInfo.getPosition().getId().toString();
|
|
positionId = entryInfo.getPosition().getId().toString();
|
|
superiorId = entryInfo.getString("superiorId");
|
|
superiorId = entryInfo.getString("superiorId");
|
|
}
|
|
}
|
|
- logger.error("鑱屼綅ID锛�" + positionId + ", 鐩存帴涓婄骇ID锛�" + superiorId);
|
|
|
|
|
|
+ logger.error("职位ID:" + positionId + ", 直接上级ID:" + superiorId);
|
|
|
|
|
|
try {
|
|
try {
|
|
if (isLastMonth) {
|
|
if (isLastMonth) {
|
|
@@ -472,12 +472,12 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
|
|
|
int count = 0;
|
|
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 + "'";
|
|
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);
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
|
|
while (iRowSet.next()) {
|
|
while (iRowSet.next()) {
|
|
count = iRowSet.getInt("count");
|
|
count = iRowSet.getInt("count");
|
|
}
|
|
}
|
|
- logger.error("鍛樺伐璇ヨ亴浣嶅綋鏈堟彁浜ゆ�鏁帮細" + count);
|
|
|
|
|
|
+ logger.error("员工该职位当月提交次数:" + count);
|
|
if (count > 0) {
|
|
if (count > 0) {
|
|
throw new ShrWebBizException("The employee submits the position once within a month");
|
|
throw new ShrWebBizException("The employee submits the position once within a month");
|
|
}
|
|
}
|
|
@@ -492,12 +492,12 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
|
|
|
int count = 0;
|
|
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 + "'";
|
|
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);
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
|
|
while (iRowSet.next()) {
|
|
while (iRowSet.next()) {
|
|
count = iRowSet.getInt("count");
|
|
count = iRowSet.getInt("count");
|
|
}
|
|
}
|
|
- logger.error("鍛樺伐璇ヨ亴浣嶅綋鏈堟彁浜ゆ�鏁帮細" + count);
|
|
|
|
|
|
+ logger.error("员工该职位当月提交次数:" + count);
|
|
if (count > 0) {
|
|
if (count > 0) {
|
|
throw new ShrWebBizException("The employee submits the position once within a month");
|
|
throw new ShrWebBizException("The employee submits the position once within a month");
|
|
}
|
|
}
|
|
@@ -510,7 +510,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 鏍¢獙XX鍙蜂箣鍚庝笉鍏佽�鎻愪氦
|
|
|
|
|
|
+ * 校验XX号之后不允许提交
|
|
*
|
|
*
|
|
* @param request
|
|
* @param request
|
|
* @param response
|
|
* @param response
|
|
@@ -546,7 +546,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 鏍规嵁浜哄憳id鑾峰彇瀹冪殑鐩村睘涓婄骇id鍜屾椂钖�
|
|
|
|
|
|
+ * 根据人员id获取它的直属上级id和时薪
|
|
*
|
|
*
|
|
* @param request
|
|
* @param request
|
|
* @param response
|
|
* @param response
|
|
@@ -579,7 +579,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 鑾峰彇褰撳墠鍛樺伐鐨勬渶鏂板叆鑱屾棩鏈�
|
|
|
|
|
|
+ * 获取当前员工的最新入职日期
|
|
*
|
|
*
|
|
* @param request
|
|
* @param request
|
|
* @param response
|
|
* @param response
|
|
@@ -609,7 +609,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 鏌ヨ�浜哄憳瀵瑰簲鑱屼綅鐨勬渶鏂扮殑鍚堝悓寮€濮嬪拰缁撴潫鏃ユ湡
|
|
|
|
|
|
+ * 查询人员对应职位的最新的合同开始和结束日期
|
|
*
|
|
*
|
|
* @param request
|
|
* @param request
|
|
* @param response
|
|
* @param response
|
|
@@ -617,31 +617,31 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
* @throws SHRWebException
|
|
* @throws SHRWebException
|
|
*/
|
|
*/
|
|
public void getContractDateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
|
|
public void getContractDateAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
|
|
- //鑱屼綅id
|
|
|
|
|
|
+ //职位id
|
|
String positionId = request.getParameter("positionId");
|
|
String positionId = request.getParameter("positionId");
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
String personId = ContextUtil.getCurrentUserInfo(ctx).getPerson().getId().toString();
|
|
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 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";
|
|
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 beginContractDate = null;
|
|
Date endContractDate = null;
|
|
Date endContractDate = null;
|
|
String contractType = "";
|
|
String contractType = "";
|
|
try {
|
|
try {
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
|
|
/*while(iRowSet.next()) {
|
|
/*while(iRowSet.next()) {
|
|
- //鍚堝悓寮€濮嬫棩鏈�
|
|
|
|
|
|
+ //合同开始日期
|
|
beginContractDate = iRowSet.getDate("cfcommencingdate");
|
|
beginContractDate = iRowSet.getDate("cfcommencingdate");
|
|
- //鍚堝悓缁撴潫鏃ユ湡
|
|
|
|
|
|
+ //合同结束日期
|
|
endContractDate = iRowSet.getDate("cfexpireddate");
|
|
endContractDate = iRowSet.getDate("cfexpireddate");
|
|
}*/
|
|
}*/
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
List<Map<String, Object>> list = new ArrayList<>();
|
|
while (iRowSet.next()) {
|
|
while (iRowSet.next()) {
|
|
- //鍚堝悓寮€濮嬫棩鏈�
|
|
|
|
|
|
+ //合同开始日期
|
|
Date beginDate = iRowSet.getDate("cfcommencingdate");
|
|
Date beginDate = iRowSet.getDate("cfcommencingdate");
|
|
- //鍚堝悓缁撴潫鏃ユ湡
|
|
|
|
|
|
+ //合同结束日期
|
|
Date endDate = iRowSet.getDate("cfexpireddate");
|
|
Date endDate = iRowSet.getDate("cfexpireddate");
|
|
- //鍚堝悓绫诲瀷
|
|
|
|
|
|
+ //合同类型
|
|
String type = iRowSet.getString("cftype");
|
|
String type = iRowSet.getString("cftype");
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
Map<String, Object> map = new HashMap<String, Object>();
|
|
map.put("beginDate", beginDate);
|
|
map.put("beginDate", beginDate);
|
|
@@ -656,7 +656,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
Date endDate = (Date) map.get("endDate");
|
|
Date endDate = (Date) map.get("endDate");
|
|
String type = (String) map.get("type");
|
|
String type = (String) map.get("type");
|
|
|
|
|
|
- //鑾峰彇杩炵画鏃堕棿娈电殑寮€濮嬫棩鏈熷拰缁撴潫鏃ユ湡锛屽�鏋滀腑闂村悎鍚岀被鍨嬪彂鐢熷彉鍔ㄦ垨鑰呮棩鏈熶腑鏂�紝鍒欓噸鏂拌�绠�
|
|
|
|
|
|
+ //获取连续时间段的开始日期和结束日期,如果中间合同类型发生变动或者日期中断,则重新计算
|
|
if (StringUtils.equals(contractType, type)) {
|
|
if (StringUtils.equals(contractType, type)) {
|
|
Calendar beginCalendar = Calendar.getInstance();
|
|
Calendar beginCalendar = Calendar.getInstance();
|
|
Calendar endCalendar = Calendar.getInstance();
|
|
Calendar endCalendar = Calendar.getInstance();
|
|
@@ -693,7 +693,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 鏍¢獙鏈堟彁浜ゆ€诲伐鏃朵笉鑳藉ぇ浜庢渶澶у伐鏃�(搴熷純)
|
|
|
|
|
|
+ * 校验月提交总工时不能大于最大工时(废弃)
|
|
*
|
|
*
|
|
* @param request
|
|
* @param request
|
|
* @param response
|
|
* @param response
|
|
@@ -720,7 +720,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')";
|
|
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);
|
|
IRowSet paramRow = DbUtil.executeQuery(ctx, paramSql);
|
|
while (paramRow.next()) {
|
|
while (paramRow.next()) {
|
|
- //鏈€澶у伐鏃舵暟
|
|
|
|
|
|
+ //最大工时数
|
|
if (paramRow.getString("FNUMBER").equals("1003")) {
|
|
if (paramRow.getString("FNUMBER").equals("1003")) {
|
|
maxHour = paramRow.getObject("name") == null ? BigDecimal.ZERO : paramRow.getBigDecimal("name");
|
|
maxHour = paramRow.getObject("name") == null ? BigDecimal.ZERO : paramRow.getBigDecimal("name");
|
|
}
|
|
}
|
|
@@ -728,7 +728,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
day = paramRow.getObject("name") == null ? 0 : paramRow.getInt("name");
|
|
day = paramRow.getObject("name") == null ? 0 : paramRow.getInt("name");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- //鏍¢獙XX鍙蜂箣鍚庝笉鍏佽�鎻愪氦
|
|
|
|
|
|
+ //校验XX号之后不允许提交
|
|
if (thisDay > day) {
|
|
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");
|
|
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);
|
|
JSONUtils.writeJson(response, modelMap);
|
|
@@ -744,7 +744,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
totalHour = totalHour.add(hours);
|
|
totalHour = totalHour.add(hours);
|
|
|
|
|
|
BigDecimal adjustHour = BigDecimal.ZERO;
|
|
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) + "'";
|
|
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);
|
|
IRowSet adjustRow = DbUtil.executeQuery(ctx, adjustSql);
|
|
while (adjustRow.next()) {
|
|
while (adjustRow.next()) {
|
|
@@ -764,7 +764,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 姹囨€诲垎褰曠殑宸ユ椂鍜岄噾棰濆埌鍗曞ご
|
|
|
|
|
|
+ * 汇总分录的工时和金额到单头
|
|
*
|
|
*
|
|
* @param request
|
|
* @param request
|
|
* @param response
|
|
* @param response
|
|
@@ -800,7 +800,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 鏍规嵁鎻愭姤鏃ユ湡鍒ゆ柇娉曞畾鑺傚亣鏃ュ拰浼戞伅鏃�
|
|
|
|
|
|
+ * 根据提报日期判断法定节假日和休息日
|
|
*
|
|
*
|
|
* @param request
|
|
* @param request
|
|
* @param response
|
|
* @param response
|
|
@@ -810,18 +810,18 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
public void workMultipleAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
|
|
public void workMultipleAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
String otDate = request.getParameter("otDate");
|
|
String otDate = request.getParameter("otDate");
|
|
- logger.error("鎻愭姤鏃ユ湡锛�" + otDate);
|
|
|
|
|
|
+ logger.error("提报日期:" + otDate);
|
|
Date parseDate = DateTimeUtils.parseDate(otDate, "yyyy-MM-dd");
|
|
Date parseDate = DateTimeUtils.parseDate(otDate, "yyyy-MM-dd");
|
|
otDate = DateTimeUtils.dateFormat(parseDate, "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 + "'";
|
|
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>();
|
|
Map<String, String> returnMap = new HashMap<String, String>();
|
|
try {
|
|
try {
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
|
|
boolean flag = false;
|
|
boolean flag = false;
|
|
while (iRowSet.next()) {
|
|
while (iRowSet.next()) {
|
|
if (StringUtils.equals(iRowSet.getString("CFWORKMULTIPLE"), "3")) {
|
|
if (StringUtils.equals(iRowSet.getString("CFWORKMULTIPLE"), "3")) {
|
|
- //娉曞畾鑺傚亣鏃ュ姞鐝�
|
|
|
|
|
|
+ //法定节假日加班
|
|
flag = true;
|
|
flag = true;
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -832,7 +832,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
calendar.setTime(parseDate);
|
|
calendar.setTime(parseDate);
|
|
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
|
|
int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK);
|
|
if (dayOfWeek == Calendar.SATURDAY || dayOfWeek == Calendar.SUNDAY) {
|
|
if (dayOfWeek == Calendar.SATURDAY || dayOfWeek == Calendar.SUNDAY) {
|
|
- //浼戞伅鏃ュ姞鐝�
|
|
|
|
|
|
+ //休息日加班
|
|
returnMap.put("returnType", "1");
|
|
returnMap.put("returnType", "1");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -845,7 +845,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 鏍规嵁浜哄憳妗f�鑾峰彇褰撴湀鏄�惁绂昏亴鎴栧吋鑱屽け鏁�
|
|
|
|
|
|
+ * 根据人员档案获取当月是否离职或兼职失效
|
|
*
|
|
*
|
|
* @param request
|
|
* @param request
|
|
* @param response
|
|
* @param response
|
|
@@ -861,21 +861,21 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
int currentMonth = calendar.get(Calendar.MONTH) + 1;
|
|
int currentMonth = calendar.get(Calendar.MONTH) + 1;
|
|
boolean flag = false;
|
|
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 + "'";
|
|
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 {
|
|
try {
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, cmpSql);
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, cmpSql);
|
|
- //浠昏亴绫诲瀷
|
|
|
|
|
|
+ //任职类型
|
|
String assignType = "";
|
|
String assignType = "";
|
|
- //鑱屼綅id
|
|
|
|
|
|
+ //职位id
|
|
String positionId = "";
|
|
String positionId = "";
|
|
while (iRowSet.next()) {
|
|
while (iRowSet.next()) {
|
|
assignType = iRowSet.getString("fassigntype");
|
|
assignType = iRowSet.getString("fassigntype");
|
|
positionId = iRowSet.getString("fpositionid");
|
|
positionId = iRowSet.getString("fpositionid");
|
|
}
|
|
}
|
|
- //涓昏�浠昏亴鏃�
|
|
|
|
|
|
+ //主要任职时
|
|
if (StringUtils.equals(assignType, "1")) {
|
|
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";
|
|
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);
|
|
IRowSet resignRow = DbUtil.executeQuery(ctx, resignSql);
|
|
int resignYear = 0;
|
|
int resignYear = 0;
|
|
int resignMonth = 0;
|
|
int resignMonth = 0;
|
|
@@ -888,7 +888,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
}
|
|
}
|
|
} else {
|
|
} 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";
|
|
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 leffdtYear = 0;
|
|
int leffdtMonth = 0;
|
|
int leffdtMonth = 0;
|
|
IRowSet empRow = DbUtil.executeQuery(ctx, empSql);
|
|
IRowSet empRow = DbUtil.executeQuery(ctx, empSql);
|
|
@@ -910,7 +910,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 鍛樺伐鍚屼竴鑱屼綅涓€涓�湀鍐呭彧鑳芥彁浜や竴娆�
|
|
|
|
|
|
+ * 员工同一职位一个月内只能提交一次
|
|
*
|
|
*
|
|
* @param request
|
|
* @param request
|
|
* @param response
|
|
* @param response
|
|
@@ -930,13 +930,13 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
|
|
|
|
int count = 0;
|
|
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 + "')";
|
|
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 {
|
|
try {
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
|
|
while (iRowSet.next()) {
|
|
while (iRowSet.next()) {
|
|
count = iRowSet.getInt("count");
|
|
count = iRowSet.getInt("count");
|
|
}
|
|
}
|
|
- logger.error("鍛樺伐璇ヨ亴浣嶅綋鏈堟彁浜ゆ�鏁帮細" + count);
|
|
|
|
|
|
+ logger.error("员工该职位当月提交次数:" + count);
|
|
} catch (BOSException e) {
|
|
} catch (BOSException e) {
|
|
e.printStackTrace();
|
|
e.printStackTrace();
|
|
} catch (SQLException e) {
|
|
} catch (SQLException e) {
|
|
@@ -947,7 +947,7 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
}
|
|
}
|
|
|
|
|
|
/**
|
|
/**
|
|
- * 鍒ゆ柇鏄�惁鍙備笌鏍¢獙
|
|
|
|
|
|
+ * 判断是否参与校验
|
|
*
|
|
*
|
|
* @param request
|
|
* @param request
|
|
* @param response
|
|
* @param response
|
|
@@ -956,15 +956,15 @@ public class BatchSubmitShemeBillMySubmissionEditHandlerEx extends BatchSubmitSh
|
|
*/
|
|
*/
|
|
public void isTakeCheckAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
|
|
public void isTakeCheckAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
- //鎻愭姤鏂规�ID
|
|
|
|
|
|
+ //提报方案ID
|
|
String calSchemeId = request.getParameter("calSchemeId");
|
|
String calSchemeId = request.getParameter("calSchemeId");
|
|
- logger.error("鎻愭姤鏂规�ID锛�" + calSchemeId);
|
|
|
|
- //鏄�惁鍙備笌鏍¢獙
|
|
|
|
|
|
+ logger.error("提报方案ID:" + calSchemeId);
|
|
|
|
+ //是否参与校验
|
|
boolean isPlanCheck = false;
|
|
boolean isPlanCheck = false;
|
|
- //褰撴湀绂昏亴澶勭悊
|
|
|
|
|
|
+ //当月离职处理
|
|
boolean isCurrentDepart = false;
|
|
boolean isCurrentDepart = false;
|
|
String sql = "select cfistakecheck,CFIsCurrentDepart from T_HR_SCalSubmitScheme where fid = '" + calSchemeId + "'";
|
|
String sql = "select cfistakecheck,CFIsCurrentDepart from T_HR_SCalSubmitScheme where fid = '" + calSchemeId + "'";
|
|
- logger.error("鏌ヨ�鎻愭姤鏂规�SQL锛�" + sql);
|
|
|
|
|
|
+ logger.error("查询提报方案SQL:" + sql);
|
|
try {
|
|
try {
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
|
|
IRowSet iRowSet = DbUtil.executeQuery(ctx, sql);
|
|
while (iRowSet.next()) {
|
|
while (iRowSet.next()) {
|