Commit c441ef1c by jianan

薪资单-N22接口查询时间协同

parent 5a046beb
......@@ -480,7 +480,6 @@ public class PractitionerController {
/**
* 薪资单明细保单列表查询接口
* 此接口根据/querySalaryDetail接口返回报文中的年份和月份查询,查询时需要将月份往后推2个月
*
* @param requestVO 请求信息
* @return PolicyInfoQueryResponseVO
......
......@@ -460,19 +460,20 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
loginName = list.get(0).getLoginName();
years = String.valueOf(list.get(0).getYear());
month = String.valueOf(list.get(0).getMonth());
}
PayScaleInfo payScaleInfo = new PayScaleInfo();
payScaleInfo.setMonDtlAmount(monDtlAmount);
payScaleInfo.setMonDtlItem("实发薪水");
payScaleInfo.setMonDtlRAmount(monDtlRAmount);
payScaleInfo.setDrpTitleCode(list.get(0).getGrade());
payScaleInfo.setMonDtlPeriod(key);
payScaleInfo.setLoginName(loginName);
payScaleInfo.setYears(years);
payScaleInfo.setMonth(month);
PayScaleInfo payScaleInfo = new PayScaleInfo();
payScaleInfo.setMonDtlAmount(monDtlAmount);
payScaleInfo.setMonDtlItem("实发薪水");
payScaleInfo.setMonDtlRAmount(monDtlRAmount);
payScaleInfo.setDrpTitleCode(list.get(0).getGrade());
payScaleInfo.setMonDtlPeriod(key);
payScaleInfo.setLoginName(loginName);
// 处理时间,作为接口/searchStaffSalaryDetails的查询入参
this.handleYearsAndMonth(years, month, payScaleInfo);
resultList.add(payScaleInfo);
}
resultList.add(payScaleInfo);
}
resultList.sort(Comparator.comparing(PayScaleInfo :: getMonDtlPeriod).reversed());
......@@ -480,6 +481,22 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
return resultList;
}
private void handleYearsAndMonth(String years, String month, PayScaleInfo payScaleInfo) {
Integer mon = Integer.valueOf(month);
Integer year = Integer.valueOf(years);
if (mon == 11) {
year = year + 1;
mon = 1;
} else if (mon == 12) {
year = year + 1;
mon = 2;
} else {
mon = mon + 2;
}
payScaleInfo.setYears(String.valueOf(year));
payScaleInfo.setMonth(String.valueOf(mon));
}
private String calculateDate(String dateStr) {
Date date = CommonUtil.stringParseDate(dateStr, "yyyy-MM-dd");
......@@ -707,14 +724,24 @@ public class PractitionerBasicInfoServiceImpl implements PractitionerBasicInfoSe
}
private void handleDateParams(SalaryDetailsSearchRequestBody salaryDetailsSearchRequestBody, QuerySalaryDetailRequestVO requestVO) {
String years = requestVO.getYears();
String month = requestVO.getMonth();
int year = Integer.valueOf(requestVO.getYears());
int mon = Integer.valueOf(requestVO.getMonth());
if (mon == 1) {
year = year - 1;
mon = 11;
} else if (mon == 2) {
year = year - 1;
mon = 12;
} else {
mon = mon - 2;
}
String curDate = "";
if (month.length() == 2) {
curDate = years + "-" + month + "-01";
if (mon > 10) {
curDate = year + "-" + mon + "-01";
} else if (month.length() == 1) {
curDate = years + "-0" + month + "-01";
} else {
curDate = year + "-0" + mon + "-01";
}
salaryDetailsSearchRequestBody.setStartDate(curDate);
salaryDetailsSearchRequestBody.setEndDate(curDate);
......
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