|
@@ -30,6 +30,7 @@ import ruisi.com.ruisiehr.service.IHRVacationInfoServer;
|
|
|
import javax.annotation.Resource;
|
|
|
import java.net.URISyntaxException;
|
|
|
import java.sql.Timestamp;
|
|
|
+import java.text.DecimalFormat;
|
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDateTime;
|
|
@@ -77,8 +78,23 @@ public class HRVacationInfoServiceImpl implements IHRVacationInfoServer {
|
|
|
.formInstanceId(formInstanceId)
|
|
|
.build(), YDConf.FORM_QUERY.retrieve_id);
|
|
|
Map formData =ddrNewL.getFormData();
|
|
|
- msg = saveVacationInfo("saveLeaveBill",formData, onlyCheck);
|
|
|
- break;
|
|
|
+ if (formData.get("textField_luuvaham").equals("RS052")) {
|
|
|
+ //单独写一个哺乳假的校验。
|
|
|
+ //请假校验的时候把请假时长回写到Portal
|
|
|
+ //请假结束的时候把HR生成的单据编号回写到Portal
|
|
|
+ //1、截止日期不能超过子女出生日期的一年 2、起始时间需是产假结束日期的后一天3、附件必传
|
|
|
+ if (onlyCheck.equals(CheckStatusConstans.Check_go)) {
|
|
|
+
|
|
|
+ //生成哺乳假请假单
|
|
|
+ msg = saveBreastfeed(formData);
|
|
|
+ }else if(onlyCheck.equals(CheckStatusConstans.Check_stop)){
|
|
|
+ //校验
|
|
|
+ msg = checkBreastfeed(formData);
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ msg = saveVacationInfo("saveLeaveBill",formData, onlyCheck);
|
|
|
+ }
|
|
|
+ break;
|
|
|
// 出差
|
|
|
case "496":
|
|
|
DDR_New ddrNewT = ydClient.queryData(YDParam.builder()
|
|
@@ -149,6 +165,23 @@ public class HRVacationInfoServiceImpl implements IHRVacationInfoServer {
|
|
|
// endTime = UtilDateTime.formatLocal(LocalDateTime.parse(endDate),"yyyy-MM-dd HH:mm:ss");
|
|
|
startTime = UtilDateTime.formatLocal(startDate.toLocalDateTime(),"yyyy-MM-dd HH:mm:ss");
|
|
|
endTime = UtilDateTime.formatLocal(endDate.toLocalDateTime(),"yyyy-MM-dd HH:mm:ss");
|
|
|
+ if(holidayType.equals("RS052")){
|
|
|
+ int length = daysBetween(startDate, endDate) + 1;
|
|
|
+ int realLength = 0;
|
|
|
+ if ("上午晚到一小时".equals(params.get("brType"))
|
|
|
+ || "上午下午各休一半".equals(params.get("brType"))
|
|
|
+ || "下午早走一小时".equals(params.get("brType"))) {
|
|
|
+ // 长度
|
|
|
+ realLength = length;
|
|
|
+
|
|
|
+ } else {// 双胞胎请假时长*2
|
|
|
+ // 长度
|
|
|
+ realLength = length * 2;
|
|
|
+ }
|
|
|
+ returnMap.put("wholeLen", realLength);
|
|
|
+ return McR.success(returnMap);
|
|
|
+
|
|
|
+ }else{
|
|
|
leaveLengthMap.put("holidayTypeId", hoildayId);
|
|
|
leaveLengthMap.put("beginTimeCount",startTime);
|
|
|
leaveLengthMap.put("endTimeCount", endTime);
|
|
@@ -184,71 +217,6 @@ public class HRVacationInfoServiceImpl implements IHRVacationInfoServer {
|
|
|
returnmsg = "系统不可提交本月之前的请假单,请重新选择请假开始时间。";
|
|
|
return McR.errorParam(returnmsg);
|
|
|
}
|
|
|
-//
|
|
|
-// param.put("timeOffApplyType",holidayType);
|
|
|
-// param.put("timeOffStartDate", startTime);
|
|
|
-// param.put("timeOffEndDate", endTime);
|
|
|
-// param.put("excuse", excuse);
|
|
|
-// param.put("personNum", params.get("personId"));
|
|
|
-// String res =OSFWSClientSSOUtils.OSFWSClientSSO("getAtsLeaveLengthOSF", param);
|
|
|
-// System.out.println("res::::::::::::::::"+res);
|
|
|
-//
|
|
|
-// if (!res.isEmpty()) {
|
|
|
-// JSONObject jsonObj = JSON.parseObject(res);
|
|
|
-// String msg = jsonObj.get("msg").toString();
|
|
|
-//
|
|
|
-// if (!"成功".equals(msg)) {
|
|
|
-// String vacaLen = "";
|
|
|
-// if("day".equals(unit)){
|
|
|
-// vacaLen = String.valueOf(Double.valueOf(wholeLen) * 8);
|
|
|
-// }else{
|
|
|
-// vacaLen = wholeLen;
|
|
|
-// }
|
|
|
-//
|
|
|
-// returnmsg = jsonObj.get("reason").toString();
|
|
|
-// if(returnmsg.equals("剩余额度不足,请假失败!")){
|
|
|
-// returnmsg = returnmsg+"当前请假时长为:"+vacaLen;
|
|
|
-// }
|
|
|
-// }else{
|
|
|
-// Map mapaLike = new HashMap();
|
|
|
-// mapaLike.put("ygbh", personId);
|
|
|
-// mapaLike.put("start_date",startTime);
|
|
|
-// mapaLike.put("end_date", endDate);
|
|
|
-//
|
|
|
-// Map resMap1 = hRPortalInfoMapper.getAlikeLeave1(mapaLike);
|
|
|
-// Map resMap2 = hRPortalInfoMapper.getAlikeLeave2(mapaLike);
|
|
|
-// Map resMap3 = hRPortalInfoMapper.getAlikeLeave3(mapaLike);
|
|
|
-// Map resMap4 = hRPortalInfoMapper.getAlikeLeave4(mapaLike);
|
|
|
-//
|
|
|
-// if(resMap1 ==null && resMap2 == null && resMap3 == null && resMap4 == null){
|
|
|
-//
|
|
|
-// String vacaLen = "";
|
|
|
-// if("day".equals(unit)){
|
|
|
-// vacaLen = String.valueOf(Double.valueOf(wholeLen) * 8);
|
|
|
-// }else{
|
|
|
-// vacaLen = wholeLen;
|
|
|
-// }
|
|
|
-// Map map = new HashMap();
|
|
|
-// map.put("holiday_hours", vacaLen);
|
|
|
-// map.put("ygbh", endTime);
|
|
|
-//
|
|
|
-//// hRPortalInfoMapper.updateVacaLength(map);
|
|
|
-// }else{
|
|
|
-// Map<String, String> resultMap = new HashMap<String, String>();
|
|
|
-// if(resMap1 != null){
|
|
|
-// resultMap = hRPortalInfoMapper.getAlikeLeave1(mapaLike);
|
|
|
-// }else if(resMap2 != null){
|
|
|
-// resultMap = hRPortalInfoMapper.getAlikeLeave2(mapaLike);
|
|
|
-// }else if(resMap3 != null){
|
|
|
-// resultMap = hRPortalInfoMapper.getAlikeLeave3(mapaLike);
|
|
|
-// }else if(resMap4 != null){
|
|
|
-// resultMap = hRPortalInfoMapper.getAlikeLeave4(mapaLike);
|
|
|
-// }
|
|
|
-// returnmsg = "您已申请过包含当前请假时间的请假单,不可重复申请!单据编号为"+resultMap.get("lcbh");
|
|
|
-// }
|
|
|
-// }
|
|
|
-//// return McR.errorParam(returnmsg);
|
|
|
-// }
|
|
|
|
|
|
|
|
|
}
|
|
@@ -257,6 +225,8 @@ public class HRVacationInfoServiceImpl implements IHRVacationInfoServer {
|
|
|
return McR.success(returnMap);
|
|
|
}
|
|
|
|
|
|
+ }
|
|
|
+
|
|
|
/**
|
|
|
* 获取请假类型
|
|
|
* @param params
|
|
@@ -268,6 +238,264 @@ public class HRVacationInfoServiceImpl implements IHRVacationInfoServer {
|
|
|
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ // 哺乳假生成请假单
|
|
|
+ @SuppressWarnings({ "unchecked", "rawtypes" })
|
|
|
+ private String saveBreastfeed(Map<String, Object> params) {
|
|
|
+ //校验哺乳假规则
|
|
|
+ checkBreastfeed(params);
|
|
|
+
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
+ SimpleDateFormat sdf1 = new SimpleDateFormat("yyyyMMdd");
|
|
|
+
|
|
|
+ Map<String, String> personInfoMap = hrVacationInfoMapper.getPersonId((String) params.get("textField_lts1mg31"));// 参数为personcode
|
|
|
+
|
|
|
+ // 创建者id
|
|
|
+ String creatorId = hrVacationInfoMapper.getCreatorId();
|
|
|
+
|
|
|
+ Map leaveBillMap = new HashMap();
|
|
|
+ String fid = hrVacationInfoMapper.getFid().toString();
|
|
|
+ leaveBillMap.put("FID", fid);
|
|
|
+ leaveBillMap.put("FCREATORID", creatorId);// 创建者
|
|
|
+ leaveBillMap.put("FCREATETIME",
|
|
|
+ Timestamp.valueOf(sdf.format(new Date())));// 创建时间
|
|
|
+ leaveBillMap.put("FLASTUPDATEUSERID", creatorId);// 最后修改者
|
|
|
+ leaveBillMap.put("FLASTUPDATETIME",
|
|
|
+ Timestamp.valueOf(sdf.format(new Date())));// 最后修改时间
|
|
|
+ leaveBillMap.put("FCONTROLUNITID",
|
|
|
+ "00000000-0000-0000-0000-000000000000CCE7AED4");// //控制单元
|
|
|
+ // 单据编号
|
|
|
+ String fnumber = sdf1.format(new Date()).toString();
|
|
|
+ String maxCount = hrVacationInfoMapper.getFNumberInfo(fnumber + "-1");
|
|
|
+ if (maxCount == "" || maxCount == null) {
|
|
|
+ fnumber = fnumber + "-1" + getNum("0000");
|
|
|
+ } else {
|
|
|
+ fnumber = fnumber + "-1" + getNum(maxCount.substring(10, 14));
|
|
|
+ }
|
|
|
+
|
|
|
+ leaveBillMap.put("FNUMBER", fnumber);// 单据编号
|
|
|
+ leaveBillMap.put("FADMINORGUNITID", personInfoMap.get("ADMINFID"));// 行政组织
|
|
|
+ leaveBillMap.put("FHRORGUNITID",
|
|
|
+ "00000000-0000-0000-0000-000000000000CCE7AED4");// hr组织
|
|
|
+ leaveBillMap.put("FBILLSTATE", "3");// 单据状态
|
|
|
+ leaveBillMap.put("FAPPROVETYPE", "0");// 审批类型(0-直接审批,1-工作流)
|
|
|
+ leaveBillMap.put("FISMULTIENTRY", "0");// 是否多分录
|
|
|
+ leaveBillMap.put("FPROPOSER", personInfoMap.get("PERSONFID"));// 申请人
|
|
|
+ leaveBillMap.put("FAPPLYDATE",
|
|
|
+ Timestamp.valueOf(sdf.format(new Date())));// 申请日期
|
|
|
+ leaveBillMap.put("FBILLTYPE", "1");// 请假单类型
|
|
|
+
|
|
|
+ hrVacationInfoMapper.insertLeaveBill(leaveBillMap);
|
|
|
+
|
|
|
+ try {
|
|
|
+ Map leaveBillEntryMap = new HashMap();
|
|
|
+ leaveBillEntryMap.put("FID", "");
|
|
|
+ leaveBillEntryMap.put("FSEQ", 1);
|
|
|
+ leaveBillEntryMap.put("FPERSONID", personInfoMap.get("PERSONFID"));
|
|
|
+ leaveBillEntryMap.put("FPOSITIONID",
|
|
|
+ personInfoMap.get("POSITIONFID"));// 职位
|
|
|
+ leaveBillEntryMap.put("FADMINORGUNITID",
|
|
|
+ personInfoMap.get("ADMINFID"));// 部门
|
|
|
+ leaveBillEntryMap.put("FBILLID", fid);// 所属单据体
|
|
|
+
|
|
|
+// Date c;
|
|
|
+ String fstartTime = "";
|
|
|
+ String fendTime = "";
|
|
|
+
|
|
|
+ // startTime = UtilDateTime.formatLocal(UtilDateTime.getLocalDateTimeFromTimestamp(UtilMap.getLong(formDate,"dateField_lts3bfky")),
|
|
|
+ fstartTime=UtilDateTime.formatLocal(UtilDateTime.getLocalDateTimeFromTimestamp(UtilMap.getLong(params,"dateField_lts1mg3q")),"yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
+
|
|
|
+// c = new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(params.get(
|
|
|
+// "dateField_lts1mg3q").toString());
|
|
|
+// fstartTime = sdf.format(c);
|
|
|
+
|
|
|
+// c = new SimpleDateFormat("yyyy-MM-dd HH:mm").parse(params.get(
|
|
|
+// "dateField_lts1mg3r").toString());
|
|
|
+// fendTime = sdf.format(c);
|
|
|
+ fendTime=UtilDateTime.formatLocal(UtilDateTime.getLocalDateTimeFromTimestamp(UtilMap.getLong(params,"dateField_lts1mg3r")),"yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
+ leaveBillEntryMap.put("FBEGINTIME", Timestamp.valueOf(fstartTime));// 请假开始时间
|
|
|
+ leaveBillEntryMap.put("FENDTIME", Timestamp.valueOf(fendTime));// 请假结束时间
|
|
|
+
|
|
|
+ // 长度
|
|
|
+ // leaveBillEntryMap.put("FLEAVELENGTH",
|
|
|
+ // daysBetween(sdf.parse(leaveBillEntryMap.get("FBEGINTIME").toString()),
|
|
|
+ // sdf.parse(leaveBillEntryMap.get("FENDTIME").toString())) + 1);
|
|
|
+ leaveBillEntryMap.put("FPOLICYID", "Dy8AAAE0JEdfwQkQ");// 假期类型
|
|
|
+ leaveBillEntryMap.put("FREMARK", "小时");
|
|
|
+ leaveBillEntryMap.put("FREALBEGINTIME",
|
|
|
+ Timestamp.valueOf(fstartTime));// 实际请假开始时间
|
|
|
+ leaveBillEntryMap.put("FREALENDTIME", Timestamp.valueOf(fendTime));// 实际请假结束时间
|
|
|
+ // 实际长度
|
|
|
+ // leaveBillEntryMap.put("FREALLEAVELENGTH",
|
|
|
+ // daysBetween(sdf.parse(leaveBillEntryMap.get("FBEGINTIME").toString()),
|
|
|
+ // sdf.parse(leaveBillEntryMap.get("FENDTIME").toString())) + 1);
|
|
|
+ leaveBillEntryMap.put("FREALUNIT", 2);
|
|
|
+ leaveBillEntryMap.put("FISCANCELLEAVE", 0);
|
|
|
+ leaveBillEntryMap.put("FISDEFAULTMANAGE", 1);
|
|
|
+ leaveBillEntryMap.put("FISELASTICCALLEN", 0);
|
|
|
+ String childBir = "";
|
|
|
+ String birthEnd = "";
|
|
|
+
|
|
|
+ //
|
|
|
+ childBir=UtilDateTime.formatLocal(UtilDateTime.getLocalDateTimeFromTimestamp(UtilMap.getLong(params,"dateField_lzay8yt4")),"yyyy-MM-dd HH:mm:ss");
|
|
|
+ birthEnd=UtilDateTime.formatLocal(UtilDateTime.getLocalDateTimeFromTimestamp(UtilMap.getLong(params,"dateField_lzay8yt5")),"yyyy-MM-dd HH:mm:ss");
|
|
|
+
|
|
|
+// c = new SimpleDateFormat("yyyy-MM-dd").parse(params.get(
|
|
|
+// "dateField_lzay8yt4").toString());
|
|
|
+// childBir = sdf.format(c);
|
|
|
+//
|
|
|
+// c = new SimpleDateFormat("yyyy-MM-dd").parse(params.get(
|
|
|
+// "dateField_lzay8yt5").toString());
|
|
|
+// birthEnd = sdf.format(c);
|
|
|
+ leaveBillEntryMap.put("FCHILDBIRTHDAY", Timestamp.valueOf(childBir));// 出生日期
|
|
|
+ leaveBillEntryMap.put("FMLENDTIME", Timestamp.valueOf(birthEnd));// 产假结束日期
|
|
|
+ if(params.get("selectField_lzay8ysz").equals("上午晚到一小时")){
|
|
|
+ leaveBillEntryMap.put("FBFTYPEID", "8r0AAAA09qFIT3K3");// 哺乳假类型
|
|
|
+ }else if(params.get("selectField_lzay8ysz").equals("下午早走一小时")){
|
|
|
+ leaveBillEntryMap.put("FBFTYPEID", "8r0AAAA09qVIT3K3");// 哺乳假类型
|
|
|
+ }else if(params.get("selectField_lzay8ysz").equals("上午下午各休一半")){
|
|
|
+ leaveBillEntryMap.put("FBFTYPEID", "8r0AAAA09qNIT3K3");// 哺乳假类型
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ String startTime = leaveBillEntryMap.get("FBEGINTIME").toString();
|
|
|
+ String endTime = leaveBillEntryMap.get("FENDTIME").toString();
|
|
|
+ Date startDate = new SimpleDateFormat("yyyy-MM-dd HH:mm")
|
|
|
+ .parse(startTime);
|
|
|
+ Date endDate = new SimpleDateFormat("yyyy-MM-dd HH:mm")
|
|
|
+ .parse(endTime);
|
|
|
+
|
|
|
+ int length = daysBetween(startDate, endDate) + 1;
|
|
|
+ int realLength = daysBetween(startDate, endDate) + 1;
|
|
|
+ if ("8r0AAAA09qFIT3K3".equals(leaveBillEntryMap.get("FBFTYPEID"))
|
|
|
+ || "8r0AAAA09qNIT3K3".equals(leaveBillEntryMap
|
|
|
+ .get("FBFTYPEID"))
|
|
|
+ || "8r0AAAA09qVIT3K3".equals(leaveBillEntryMap
|
|
|
+ .get("FBFTYPEID"))) {
|
|
|
+ // 长度
|
|
|
+ leaveBillEntryMap.put("FLEAVELENGTH", length);
|
|
|
+ // 实际长度
|
|
|
+ leaveBillEntryMap.put("FREALLEAVELENGTH", realLength);
|
|
|
+
|
|
|
+ } else {// 双胞胎请假时长*2
|
|
|
+ // 长度
|
|
|
+ leaveBillEntryMap.put("FLEAVELENGTH", length * 2);
|
|
|
+ // 实际长度
|
|
|
+ leaveBillEntryMap.put("FREALLEAVELENGTH", realLength * 2);
|
|
|
+ }
|
|
|
+
|
|
|
+ hrVacationInfoMapper.insertLeaveBillEntry(leaveBillEntryMap);
|
|
|
+
|
|
|
+ Map leaveBillDetail = new HashMap();
|
|
|
+ leaveBillDetail.put("FID", "");
|
|
|
+ leaveBillDetail.put("FPROPOSERID", personInfoMap.get("PERSONFID"));// 员工
|
|
|
+ leaveBillDetail.put("FADMINORGUNITID",
|
|
|
+ personInfoMap.get("ADMINFID"));// 行政组织(部门)
|
|
|
+ leaveBillDetail.put("FLEAVEBILLID", fid);
|
|
|
+ leaveBillDetail.put("FLEAVEDATE",
|
|
|
+ Timestamp.valueOf(sdf.format(new Date())));// 请假日期
|
|
|
+ leaveBillDetail.put("FLEAVELENGTH",
|
|
|
+ daysBetween(startDate, endDate) + 1);// 请假时长
|
|
|
+ leaveBillDetail.put("FLEAVEUNIT", 2);
|
|
|
+ leaveBillDetail.put("FPOLICYID", "Dy8AAAE0JEdfwQkQ");// 假期类型
|
|
|
+
|
|
|
+ hrVacationInfoMapper.insertLeaveBillDetail(leaveBillDetail);
|
|
|
+
|
|
|
+ //请假结束的时候把HR生成的单据编号回写到Portal
|
|
|
+// Map map = new HashMap();
|
|
|
+// map.put("hr_order_id", fnumber);
|
|
|
+// map.put("requestid", params.get("requestid"));
|
|
|
+// hRPortalInfoMapper.updateVacaFnumber(map);
|
|
|
+
|
|
|
+ } catch (ParseException e) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ return e.getMessage();
|
|
|
+ }
|
|
|
+ return "";
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ // 哺乳假校验请假单
|
|
|
+ //单独写一个哺乳假的校验。
|
|
|
+ //请假校验的时候把请假时长回写到Portal
|
|
|
+ //请假结束的时候把HR生成的单据编号回写到Portal
|
|
|
+ //1、截止日期不能超过子女出生日期的一年 2、起始时间需是产假结束日期的后一天3、附件必传
|
|
|
+ @SuppressWarnings({ "unchecked", "rawtypes" })
|
|
|
+ private String checkBreastfeed(Map<String, Object> params) {
|
|
|
+ String msg = "";
|
|
|
+ try {
|
|
|
+
|
|
|
+ //截止日期不能超过子女出生日期的一年
|
|
|
+ String endTime = params.get("dateField_lts1mg3r").toString();
|
|
|
+
|
|
|
+ String childBirth = params.get("dateField_lzay8yt4").toString();
|
|
|
+ String realEndDate = nextYear(childBirth);
|
|
|
+ String endSubTime = endTime.substring(0, endTime.indexOf(" "));
|
|
|
+
|
|
|
+ int compare = endSubTime.compareTo(realEndDate);
|
|
|
+ if(compare>0){
|
|
|
+ return msg="哺乳假结束日期不可超过子女出生日期后的一年,请重新选择哺乳假结束日期。";
|
|
|
+ }
|
|
|
+
|
|
|
+ //起始时间需是产假结束日期的后一天
|
|
|
+ String startTime = params.get("dateField_lts1mg3q").toString();
|
|
|
+ String birthEndDate = params.get("dateField_lzay8yt5").toString();
|
|
|
+
|
|
|
+// String realStartDate = nextDay(birthEndDate);
|
|
|
+ String startSubTime = startTime.substring(0, startTime.indexOf(" "));
|
|
|
+// if(!realStartDate.equals(startSubTime)){
|
|
|
+// return msg = "哺乳假开始日期必须是产假结束日期的后一天,请重新选择哺乳假开始日期。";
|
|
|
+// }
|
|
|
+ int birthCompare = startSubTime.compareTo(birthEndDate);
|
|
|
+ int endCompare = startTime.compareTo(endTime);
|
|
|
+ if(birthCompare<0 || endCompare>0){
|
|
|
+ return msg = "哺乳假开始日期必须在产假结束日期之后并且在哺乳假结束日期之前,请重新选择哺乳假开始日期。";
|
|
|
+ }
|
|
|
+
|
|
|
+ //附件必须上传
|
|
|
+ if(params.get("attachmentField_lts1mg42").toString().isEmpty()){
|
|
|
+ return msg = "请上传附件。";
|
|
|
+ }
|
|
|
+
|
|
|
+ //请假校验的时候把请假时长回写到Portal
|
|
|
+ Date startDate;
|
|
|
+
|
|
|
+ startDate = new SimpleDateFormat("yyyy-MM-dd HH:mm")
|
|
|
+ .parse(startTime);
|
|
|
+
|
|
|
+ Date endDate = new SimpleDateFormat("yyyy-MM-dd HH:mm")
|
|
|
+ .parse(endTime);
|
|
|
+
|
|
|
+ int length = daysBetween(startDate, endDate) + 1;
|
|
|
+ int realLength = 0;
|
|
|
+ if ("8r0AAAA09qFIT3K3".equals(params.get("selectField_lzay8ysz"))
|
|
|
+ || "8r0AAAA09qNIT3K3".equals(params.get("selectField_lzay8ysz"))
|
|
|
+ || "8r0AAAA09qVIT3K3".equals(params.get("selectField_lzay8ysz"))) {
|
|
|
+ // 长度
|
|
|
+ realLength = length;
|
|
|
+
|
|
|
+ } else {// 双胞胎请假时长*2
|
|
|
+ // 长度
|
|
|
+ realLength = length * 2;
|
|
|
+ }
|
|
|
+// Map map = new HashMap();
|
|
|
+// map.put("holiday_hours", realLength);
|
|
|
+// map.put("requestid", params.get("requestid"));
|
|
|
+//
|
|
|
+// hRPortalInfoMapper.updateVacaLength(map);
|
|
|
+
|
|
|
+ } catch (ParseException e) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+
|
|
|
+ return msg;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
// 请假单,出差逻辑实现
|
|
|
private String saveVacationInfo(String serviceName,Map formDate, String onlyCheck) throws URISyntaxException, ParseException {
|
|
|
|
|
@@ -587,6 +815,56 @@ public class HRVacationInfoServiceImpl implements IHRVacationInfoServer {
|
|
|
return returnmsg;
|
|
|
}
|
|
|
|
|
|
+ public static String getNum(String code) {
|
|
|
+ String roundCode = "0001";
|
|
|
+
|
|
|
+ if (code != null && !code.isEmpty()) {
|
|
|
+ int intCode = Integer.parseInt(code) + 1;
|
|
|
+ if (intCode < 99) {
|
|
|
+ roundCode = String.format(String.valueOf(intCode));
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ DecimalFormat df = new DecimalFormat("0000");
|
|
|
+ String newCode = df.format(Integer.parseInt(roundCode));
|
|
|
+
|
|
|
+ return newCode;
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
+ public static int daysBetween(Date smdate, Date bdate)
|
|
|
+ throws ParseException {
|
|
|
+ SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ smdate = sdf.parse(sdf.format(smdate));
|
|
|
+ bdate = sdf.parse(sdf.format(bdate));
|
|
|
+ Calendar cal = Calendar.getInstance();
|
|
|
+ cal.setTime(smdate);
|
|
|
+ long time1 = cal.getTimeInMillis();
|
|
|
+ cal.setTime(bdate);
|
|
|
+ long time2 = cal.getTimeInMillis();
|
|
|
+ long between_days = (time2 - time1) / (1000 * 3600 * 24);
|
|
|
+
|
|
|
+ return Integer.parseInt(String.valueOf(between_days));
|
|
|
+ }
|
|
|
+
|
|
|
+ public static String nextYear(String date){
|
|
|
+
|
|
|
+ Calendar ca = Calendar.getInstance();
|
|
|
+ String nextYear ="";
|
|
|
+ try {
|
|
|
+ ca.setTime(new SimpleDateFormat("yyyy-MM-dd").parse(date));
|
|
|
+ ca.add(Calendar.YEAR, +1);
|
|
|
+ ca.add(Calendar.MONTH, -0);
|
|
|
+ ca.add(Calendar.DATE, -1);
|
|
|
+
|
|
|
+ nextYear = new SimpleDateFormat("yyyy-MM-dd").format(ca.getTime());
|
|
|
+ } catch (ParseException e) {
|
|
|
+ // TODO Auto-generated catch block
|
|
|
+ e.printStackTrace();
|
|
|
+ }
|
|
|
+ return nextYear;
|
|
|
+ }
|
|
|
+
|
|
|
private Date formatdate(String date) {
|
|
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
|
|
|