Commit 68455da1 authored by hongguangwu's avatar hongguangwu

合同-date

parent e073df6e
......@@ -71,9 +71,6 @@ import javax.servlet.http.HttpServletResponse;
import java.io.BufferedOutputStream;
import java.io.IOException;
import java.net.URLEncoder;
import java.time.LocalDate;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import java.util.*;
import java.util.stream.Collectors;
......@@ -660,28 +657,28 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
if (Common.isNotNull(companyFieldMap.get("contractType"))){
//固定期限
paramter.put("contractType", "一");
paramter.put("fcontractStartY", DateUtil.format(localDate2Date(attachInfo.getContractStart()), "yyyy"));
paramter.put("fcontractStartM", DateUtil.format(localDate2Date(attachInfo.getContractStart()), "MM"));
paramter.put("fcontractStartD", DateUtil.format(localDate2Date(attachInfo.getContractStart()), "dd"));
paramter.put("fcontractEndY", DateUtil.format(localDate2Date(attachInfo.getContractEnd()), "yyyy"));
paramter.put("fcontractEndM", DateUtil.format(localDate2Date(attachInfo.getContractEnd()), "MM"));
paramter.put("fcontractEndD", DateUtil.format(localDate2Date(attachInfo.getContractEnd()), "dd"));
paramter.put("fcontractStartY", DateUtil.format(attachInfo.getContractStart(), "yyyy"));
paramter.put("fcontractStartM", DateUtil.format(attachInfo.getContractStart(), "MM"));
paramter.put("fcontractStartD", DateUtil.format(attachInfo.getContractStart(), "dd"));
paramter.put("fcontractEndY", DateUtil.format(attachInfo.getContractEnd(), "yyyy"));
paramter.put("fcontractEndM", DateUtil.format(attachInfo.getContractEnd(), "MM"));
paramter.put("fcontractEndD", DateUtil.format(attachInfo.getContractEnd(), "dd"));
if (Common.isNotNull(companyFieldMap.get("fPeriodStartY"))){
//合同起止时间填充,新签需要判断是否有试用期,试用期工资
if (attachInfo.getPeriodStart() == null) {
return R.failed("新签试用期开始时间为空");
}
paramter.put("fPeriodStartY", DateUtil.format(localDate2Date(attachInfo.getPeriodStart()), "yyyy"));
paramter.put("fPeriodStartM", DateUtil.format(localDate2Date(attachInfo.getPeriodStart()), "MM"));
paramter.put("fPeriodStartD", DateUtil.format(localDate2Date(attachInfo.getPeriodStart()), "dd"));
paramter.put("fPeriodStartY", DateUtil.format(attachInfo.getPeriodStart(), "yyyy"));
paramter.put("fPeriodStartM", DateUtil.format(attachInfo.getPeriodStart(), "MM"));
paramter.put("fPeriodStartD", DateUtil.format(attachInfo.getPeriodStart(), "dd"));
}
if (Common.isNotNull(companyFieldMap.get("fPeriodEndY"))){
if (attachInfo.getPeriodEnd() == null) {
return R.failed("新签试用期结束时间为空");
}
paramter.put("fPeriodEndY", DateUtil.format(localDate2Date(attachInfo.getPeriodEnd()), "yyyy"));
paramter.put("fPeriodEndM", DateUtil.format(localDate2Date(attachInfo.getPeriodEnd()), "MM"));
paramter.put("fPeriodEndD", DateUtil.format(localDate2Date(attachInfo.getPeriodEnd()), "dd"));
paramter.put("fPeriodEndY", DateUtil.format(attachInfo.getPeriodEnd(), "yyyy"));
paramter.put("fPeriodEndM", DateUtil.format(attachInfo.getPeriodEnd(), "MM"));
paramter.put("fPeriodEndD", DateUtil.format(attachInfo.getPeriodEnd(), "dd"));
}
if (Common.isNotNull(companyFieldMap.get("periodSalaryPerMonth"))){
if (attachInfo.getPeriodSalaryPerMonth() == null) {
......@@ -799,26 +796,26 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
//固定期限
paramter.put("contractType", "一");
paramter.put("fcontractStartY", DateUtil.format(localDate2Date(attachInfo.getContractStart()), "yyyy"));
paramter.put("fcontractStartM", DateUtil.format(localDate2Date(attachInfo.getContractStart()), "MM"));
paramter.put("fcontractStartD", DateUtil.format(localDate2Date(attachInfo.getContractStart()), "dd"));
paramter.put("fcontractEndY", DateUtil.format(localDate2Date(attachInfo.getContractEnd()), "yyyy"));
paramter.put("fcontractEndM", DateUtil.format(localDate2Date(attachInfo.getContractEnd()), "MM"));
paramter.put("fcontractEndD", DateUtil.format(localDate2Date(attachInfo.getContractEnd()), "dd"));
paramter.put("fcontractStartY", DateUtil.format(attachInfo.getContractStart(), "yyyy"));
paramter.put("fcontractStartM", DateUtil.format(attachInfo.getContractStart(), "MM"));
paramter.put("fcontractStartD", DateUtil.format(attachInfo.getContractStart(), "dd"));
paramter.put("fcontractEndY", DateUtil.format(attachInfo.getContractEnd(), "yyyy"));
paramter.put("fcontractEndM", DateUtil.format(attachInfo.getContractEnd(), "MM"));
paramter.put("fcontractEndD", DateUtil.format(attachInfo.getContractEnd(), "dd"));
//合同起止时间填充,新签需要判断是否有试用期,试用期工资
if (!signFlag) {
if (attachInfo.getPeriodStart() == null) {
return R.failed("新签试用期开始时间为空");
}
paramter.put("fPeriodStartY", DateUtil.format(localDate2Date(attachInfo.getPeriodStart()), "yyyy"));
paramter.put("fPeriodStartM", DateUtil.format(localDate2Date(attachInfo.getPeriodStart()), "MM"));
paramter.put("fPeriodStartD", DateUtil.format(localDate2Date(attachInfo.getPeriodStart()), "dd"));
paramter.put("fPeriodStartY", DateUtil.format(attachInfo.getPeriodStart(), "yyyy"));
paramter.put("fPeriodStartM", DateUtil.format(attachInfo.getPeriodStart(), "MM"));
paramter.put("fPeriodStartD", DateUtil.format(attachInfo.getPeriodStart(), "dd"));
if (attachInfo.getPeriodEnd() == null) {
return R.failed("新签试用期结束时间为空");
}
paramter.put("fPeriodEndY", DateUtil.format(localDate2Date(attachInfo.getPeriodEnd()), "yyyy"));
paramter.put("fPeriodEndM", DateUtil.format(localDate2Date(attachInfo.getPeriodEnd()), "MM"));
paramter.put("fPeriodEndD", DateUtil.format(localDate2Date(attachInfo.getPeriodEnd()), "dd"));
paramter.put("fPeriodEndY", DateUtil.format(attachInfo.getPeriodEnd(), "yyyy"));
paramter.put("fPeriodEndM", DateUtil.format(attachInfo.getPeriodEnd(), "MM"));
paramter.put("fPeriodEndD", DateUtil.format(attachInfo.getPeriodEnd(), "dd"));
if (attachInfo.getPeriodSalaryPerMonth() == null) {
return R.failed("新签试用期工资为空");
}
......@@ -862,14 +859,6 @@ public class FddContractInfoServiceImpl extends ServiceImpl<FddContractInfoMappe
return new R<>(paramter.toJSONString());
}
public static Date localDate2Date(LocalDate localDate) {
if (null == localDate) {
return null;
}
ZonedDateTime zonedDateTime = localDate.atStartOfDay(ZoneId.systemDefault());
return Date.from(zonedDateTime.toInstant());
}
/**
* @param entity
* @Author: huyc
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment