|
|
@@ -5,7 +5,6 @@ import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.google.common.collect.Maps;
|
|
|
import com.google.common.collect.Sets;
|
|
|
-import com.grapecity.documents.excel.O;
|
|
|
import com.kingdee.bos.BOSException;
|
|
|
import com.kingdee.bos.Context;
|
|
|
import com.kingdee.bos.metadata.entity.*;
|
|
|
@@ -40,6 +39,8 @@ import java.math.BigDecimal;
|
|
|
import java.sql.SQLException;
|
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.time.LocalDate;
|
|
|
+import java.time.Month;
|
|
|
+import java.time.Year;
|
|
|
import java.time.format.DateTimeFormatter;
|
|
|
import java.util.*;
|
|
|
|
|
|
@@ -47,9 +48,11 @@ public class EvaResultSummaryManagerListHandlerExEx extends EvaResultSummaryMana
|
|
|
|
|
|
private static final Logger logger = LoggerFactory.getLogger(EvaResultSummaryManagerListHandlerExEx.class);
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
public void batchSaveReviseDataAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap, BatchMessageTipsHeader batchMessageTipsHeader) throws SHRWebException {
|
|
|
Context ctx = SHRContext.getInstance().getContext();
|
|
|
-
|
|
|
List unValidIds;
|
|
|
try {
|
|
|
unValidIds = EvaResultSummaryBillUtil.validEvaResultSummaryBill(ctx, (String)null, request.getParameter("billId"), "10");
|
|
|
@@ -114,6 +117,8 @@ public class EvaResultSummaryManagerListHandlerExEx extends EvaResultSummaryMana
|
|
|
evaResultSummaryCollection.add(evaResultSummaryInfo);
|
|
|
}else {
|
|
|
evaResultSummaryInfo.put("perCoefficient", perCoefficientObj);
|
|
|
+ evaResultSummaryInfo.put("perMaxCoefficient", perMaxCoefficientObj);
|
|
|
+ evaResultSummaryInfo.put("perMinCoefficient", perMinCoefficientObj);
|
|
|
BigDecimal perMaxCoefficient = new BigDecimal(perMaxCoefficientObj.toString());
|
|
|
BigDecimal perMinCoefficient = new BigDecimal(perMinCoefficientObj.toString());
|
|
|
BigDecimal perCoefficient = new BigDecimal(perCoefficientObj.toString());
|
|
|
@@ -301,6 +306,31 @@ public class EvaResultSummaryManagerListHandlerExEx extends EvaResultSummaryMana
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+ public Map<String,Map<String,Object>> getPerformanceLevelByLevelAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws ShrWebBizException {
|
|
|
+
|
|
|
+ Map<String,Map<String,Object>> result = Maps.newHashMap();
|
|
|
+ try {
|
|
|
+ Context ctx = SHRContext.getInstance().getContext();
|
|
|
+ String sql = "select CFLEVEL,CFCOEFFICIENT,CFMAXCOEFFICIENT,CFMINCOEFFICIENT from CT_PER_PerformanceLevel ";
|
|
|
+ IRowSet rs = DbUtil.executeQuery(ctx,sql.toString());
|
|
|
+ while (rs.next()){
|
|
|
+ Map<String,Object> map = Maps.newHashMap();
|
|
|
+ String CFLEVEL=rs.getString("CFLEVEL");
|
|
|
+ BigDecimal CFCOEFFICIENT=rs.getBigDecimal("CFCOEFFICIENT");
|
|
|
+ BigDecimal CFMAXCOEFFICIENT=rs.getBigDecimal("CFMAXCOEFFICIENT");
|
|
|
+ BigDecimal CFMINCOEFFICIENT=rs.getBigDecimal("CFMINCOEFFICIENT");
|
|
|
+ map.put("level",CFLEVEL);
|
|
|
+ map.put("coefficient",CFCOEFFICIENT);
|
|
|
+ map.put("maxcoefficient",CFMAXCOEFFICIENT);
|
|
|
+ map.put("mincoefficient",CFMINCOEFFICIENT);
|
|
|
+ result.put(CFLEVEL,map);
|
|
|
+ }
|
|
|
+ }catch (Exception e){
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new ShrWebBizException(e.getMessage());
|
|
|
+ }
|
|
|
+ return result;
|
|
|
+ }
|
|
|
/**
|
|
|
* 获取绩效系数
|
|
|
* @param request
|
|
|
@@ -380,6 +410,7 @@ public class EvaResultSummaryManagerListHandlerExEx extends EvaResultSummaryMana
|
|
|
initData.put("perobjectId","");
|
|
|
initData.put("projectName","");
|
|
|
}
|
|
|
+ initData.put("performanceLevel",this.getPerformanceLevelByLevelAction(request,response,modelMap));
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -834,7 +865,7 @@ public class EvaResultSummaryManagerListHandlerExEx extends EvaResultSummaryMana
|
|
|
orgLevelSql.append(" and adcount.FLAYERTYPEID='00000000-0000-0000-0000-00000000000362824988' ");
|
|
|
orgLevelSql.append(" order by adcount.fsortcode) FADMINORGUNITID,s1.FPERIODID,s1.FEVAPLANID,isnull(s1.FREVISEGRADELEVEL,s1.FGRADELEVEL) revLevel ");
|
|
|
orgLevelSql.append(" from T_EVA_EvaResultSummary s1 ");
|
|
|
- orgLevelSql.append(" where s1.FPERIODID=? s1.FEVAPLANID=? ");
|
|
|
+ orgLevelSql.append(" where s1.FPERIODID=? and s1.FEVAPLANID=? ");
|
|
|
orgLevelSql.append(" ) t ");
|
|
|
orgLevelSql.append(" group by FADMINORGUNITID, FPERIODID,FEVAPLANID,revLevel ");
|
|
|
// orgLevelSql.append(" select count(*) lens,FADMINORGUNITID,FPERIODID,FEVAPLANID,revLevel from ( ");
|
|
|
@@ -1332,15 +1363,21 @@ public class EvaResultSummaryManagerListHandlerExEx extends EvaResultSummaryMana
|
|
|
sql.append(",'").append(id).append("'");
|
|
|
}
|
|
|
sql.append(" ) ");
|
|
|
- LocalDate startDate = null;
|
|
|
- LocalDate endDate = null;
|
|
|
- EvalplanCycleTypeEnum cycleTypeEnum = null;
|
|
|
+
|
|
|
IRowSet rsSql = DbUtil.executeQuery(ctx, sql.toString());
|
|
|
boolean faist = true;
|
|
|
+ Map<String, Object> cycleMap=null;
|
|
|
+ Map<String, Object> cycleMap2=null;
|
|
|
while (rsSql.next()) {
|
|
|
String id = rsSql.getString("fid");
|
|
|
String orgId = rsSql.getString("FADMINORGUNITID");
|
|
|
+ IRowSet rs = DbUtil.executeQuery(ctx,"select fname_l2 from t_org_admin where fid='"+orgId+"'");
|
|
|
String orgName = rsSql.getString("FADMINORGNAME");
|
|
|
+ String orgName_l2=orgName;
|
|
|
+ if(rs.next()) {
|
|
|
+ orgName_l2=rs.getString("fname_l2");
|
|
|
+ }
|
|
|
+
|
|
|
String FBILLSTATE = rsSql.getString("FBILLSTATE");
|
|
|
|
|
|
if (faist) {
|
|
|
@@ -1348,16 +1385,25 @@ public class EvaResultSummaryManagerListHandlerExEx extends EvaResultSummaryMana
|
|
|
int FCYCLETYPE = rsSql.getInt("FCYCLETYPE");
|
|
|
Date FPENDDATE = rsSql.getDate("FPENDDATE");
|
|
|
Date FPSTARTDATE = rsSql.getDate("FPSTARTDATE");
|
|
|
- Map<String, Object> cycleMap = this.getCycletype(sf.format(FPSTARTDATE), sf.format(FPENDDATE), FCYCLETYPE);
|
|
|
- cycleTypeEnum = (EvalplanCycleTypeEnum) cycleMap.get("cycleType");
|
|
|
- endDate = (LocalDate) cycleMap.get("endDate");
|
|
|
- startDate = (LocalDate) cycleMap.get("startDate");
|
|
|
+
|
|
|
+ cycleMap = this.getCycletype(sf.format(FPSTARTDATE), sf.format(FPENDDATE), EvalplanCycleTypeEnum.QUARTER_VALUE);
|
|
|
+ cycleMap2 = this.getCycletype(sf.format(FPSTARTDATE), sf.format(FPENDDATE), EvalplanCycleTypeEnum.FULL_YEAR_VALUE);
|
|
|
}
|
|
|
- id_orgIdMap.put(id, orgId + "!" + orgName+"!"+FBILLSTATE);
|
|
|
+ id_orgIdMap.put(id, orgId + "!" + orgName_l2+"!"+FBILLSTATE);
|
|
|
}
|
|
|
List<String> sess = Lists.newArrayList();
|
|
|
- //T_EVA_OrgEvaResultSummary
|
|
|
- Map<String, Map<String, String>> mapMap = this.getOrgEvaResultLevel(ctx, startDate, endDate, cycleTypeEnum);
|
|
|
+ EvalplanCycleTypeEnum cycleTypeEnum = (EvalplanCycleTypeEnum) cycleMap.get("cycleType");
|
|
|
+ LocalDate endDate = (LocalDate) cycleMap.get("endDate");
|
|
|
+ LocalDate startDate = (LocalDate) cycleMap.get("startDate");
|
|
|
+ int year = (int) cycleMap.get("year");
|
|
|
+ int quarter = (int) cycleMap.get("quarter");
|
|
|
+ EvalplanCycleTypeEnum cycleTypeEnum2 = (EvalplanCycleTypeEnum) cycleMap2.get("cycleType");
|
|
|
+ LocalDate endDate2 = (LocalDate) cycleMap2.get("endDate");
|
|
|
+ LocalDate startDate2 = (LocalDate) cycleMap2.get("startDate");
|
|
|
+ int year2 = (int) cycleMap2.get("year");
|
|
|
+ int quarter2 = (int) cycleMap2.get("quarter");
|
|
|
+ Map<String, Map<String, String>> mapMap = this.getOrgEvaResultLevel(ctx, startDate, endDate, cycleTypeEnum,year,quarter);
|
|
|
+ Map<String, Map<String, String>> mapMap2 = this.getOrgEvaResultLevel(ctx, startDate2, endDate2, cycleTypeEnum2,year2,quarter2);
|
|
|
for (Map.Entry<String, String> ee : id_orgIdMap.entrySet()) {
|
|
|
String[] orgs = ee.getValue().split("!");
|
|
|
String orgId = orgs[0];
|
|
|
@@ -1366,6 +1412,9 @@ public class EvaResultSummaryManagerListHandlerExEx extends EvaResultSummaryMana
|
|
|
String id = ee.getKey();
|
|
|
if (!"3".equals(FBILLSTATE)){
|
|
|
Map<String, String> orgLevelMap = mapMap.get(orgId);
|
|
|
+ if (null == orgLevelMap) {
|
|
|
+ orgLevelMap=mapMap2.get(orgId);
|
|
|
+ }
|
|
|
if (null == orgLevelMap) {
|
|
|
batchMessage.put(id, "未找到当前" + orgName + "部门匹配的组织绩效等级");
|
|
|
} else {
|
|
|
@@ -1387,7 +1436,7 @@ public class EvaResultSummaryManagerListHandlerExEx extends EvaResultSummaryMana
|
|
|
return batchMessage;
|
|
|
}
|
|
|
|
|
|
- public Map<String, Object> getCycletype(String pstartdate, String penddate, int cycletype) {
|
|
|
+ public static Map<String, Object> getCycletype(String pstartdate, String penddate, int cycletype) {
|
|
|
Map<String, Object> map = Maps.newHashMap();
|
|
|
LocalDate startDate = LocalDate.parse(pstartdate, DateTimeFormatter.ISO_LOCAL_DATE);
|
|
|
LocalDate endDate = LocalDate.parse(penddate, DateTimeFormatter.ISO_LOCAL_DATE);
|
|
|
@@ -1397,25 +1446,67 @@ public class EvaResultSummaryManagerListHandlerExEx extends EvaResultSummaryMana
|
|
|
endDate = endDate.plusYears(-1);
|
|
|
startDate = startDate.plusYears(-1);
|
|
|
cycleTypeEnum = EvalplanCycleTypeEnum.FULL_YEAR;
|
|
|
+ int month = startDate.getMonthValue();
|
|
|
+ //获取为季度
|
|
|
+ int quarter = (month - 1) / 3;
|
|
|
+ int year = endDate.getYear();
|
|
|
+
|
|
|
+ map.put("year", year);
|
|
|
+ map.put("quarter", 1);
|
|
|
} else if (EvalplanCycleTypeEnum.HALF_YEAR_VALUE == cycletype) {
|
|
|
//周期为半年度
|
|
|
endDate = endDate.plusMonths(-6);
|
|
|
startDate = startDate.plusMonths(-6);
|
|
|
cycleTypeEnum = EvalplanCycleTypeEnum.HALF_YEAR;
|
|
|
- } else if (EvalplanCycleTypeEnum.QUARTER_VALUE == cycletype) {
|
|
|
+ int month = startDate.getMonthValue();
|
|
|
//获取为季度
|
|
|
- endDate = endDate.plusMonths(-3);
|
|
|
- startDate = startDate.plusMonths(-3);
|
|
|
+ int quarter = (month - 1) / 3;
|
|
|
+ int year = endDate.getYear();
|
|
|
+ if(0==quarter){
|
|
|
+ year=year-1;
|
|
|
+ quarter=4;
|
|
|
+ }
|
|
|
+ map.put("year", year);
|
|
|
+ map.put("quarter", month<7?1:2);
|
|
|
+ } else if (EvalplanCycleTypeEnum.QUARTER_VALUE == cycletype) {
|
|
|
+
|
|
|
+ int month = startDate.getMonthValue();
|
|
|
+
|
|
|
+ //获取为季度0~3季度
|
|
|
+ int quarter = (month - 1) / 3;
|
|
|
+ //当前季度为第一季度,则需取上一年度的季度
|
|
|
+ int year = endDate.getYear();
|
|
|
+ if(0==quarter){
|
|
|
+ year=year-1;
|
|
|
+ quarter=4;
|
|
|
+ }
|
|
|
+ Month endMonth = Month.of(quarter*3);
|
|
|
+ endDate = LocalDate.of(year,endMonth,endMonth.length(endDate.isLeapYear()));
|
|
|
+ Month startMonth = Month.of(endMonth.getValue()-2);
|
|
|
+ startDate = LocalDate.of(year,startMonth,1);
|
|
|
cycleTypeEnum = EvalplanCycleTypeEnum.QUARTER;
|
|
|
+ map.put("year", year);
|
|
|
+ map.put("quarter", quarter);
|
|
|
} else if (EvalplanCycleTypeEnum.MONTHLY_VALUE == cycletype) {
|
|
|
//获取为季度
|
|
|
endDate = endDate.plusMonths(-1);
|
|
|
startDate = startDate.plusMonths(-1);
|
|
|
cycleTypeEnum = EvalplanCycleTypeEnum.MONTHLY;
|
|
|
+ int month = startDate.getMonthValue();
|
|
|
+ //获取为季度
|
|
|
+ int quarter = (month - 1) / 3;
|
|
|
+ int year = endDate.getYear();
|
|
|
+ if(0==quarter){
|
|
|
+ year=year-1;
|
|
|
+ quarter=4;
|
|
|
+ }
|
|
|
+ map.put("year", year);
|
|
|
+ map.put("quarter", quarter);
|
|
|
}
|
|
|
map.put("cycleType", cycleTypeEnum);
|
|
|
map.put("endDate", endDate);
|
|
|
map.put("startDate", startDate);
|
|
|
+
|
|
|
return map;
|
|
|
}
|
|
|
|
|
|
@@ -1445,33 +1536,71 @@ public class EvaResultSummaryManagerListHandlerExEx extends EvaResultSummaryMana
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ protected Map<String, Map<String, String>> getOrgEvaResultLevel(Context ctx, LocalDate startDate, LocalDate endDate,EvalplanCycleTypeEnum cycletype,int year,int quarter) throws BOSException, SQLException {
|
|
|
+ //202404J
|
|
|
+ String FPERIODNAME = "";
|
|
|
+ if (EvalplanCycleTypeEnum.FULL_YEAR == cycletype) {
|
|
|
+ FPERIODNAME=year+"M";
|
|
|
+ } else if (EvalplanCycleTypeEnum.HALF_YEAR == cycletype) {
|
|
|
+ FPERIODNAME=year+"0"+quarter+"H";
|
|
|
+ } else if (EvalplanCycleTypeEnum.QUARTER == cycletype) {
|
|
|
+ FPERIODNAME=year+"0"+quarter+"J";
|
|
|
+ } else if (EvalplanCycleTypeEnum.MONTHLY == cycletype) {
|
|
|
+ FPERIODNAME=year+(quarter>9?(""+quarter):("0"+quarter))+"M";
|
|
|
+ }
|
|
|
+ return this.getOrgEvaResultLevel(ctx, startDate, endDate, cycletype,FPERIODNAME,year,quarter);
|
|
|
+ }
|
|
|
protected Map<String, Map<String, String>> getOrgEvaResultLevel(Context ctx, LocalDate startDate, LocalDate endDate) throws BOSException, SQLException {
|
|
|
- return this.getOrgEvaResultLevel(ctx, startDate, endDate, EvalplanCycleTypeEnum.QUARTER);
|
|
|
+ return this.getOrgEvaResultLevel(ctx, startDate, endDate, EvalplanCycleTypeEnum.QUARTER,"",2000,1);
|
|
|
}
|
|
|
-
|
|
|
- protected Map<String, Map<String, String>> getOrgEvaResultLevel(Context ctx, LocalDate startDate, LocalDate endDate, EvalplanCycleTypeEnum cycletype) throws BOSException, SQLException {
|
|
|
+ protected Map<String, Map<String, String>> getOrgEvaResultLevel(Context ctx, LocalDate startDate, LocalDate endDate, EvalplanCycleTypeEnum cycletype, String FPERIODNAME,int year,int quarter) throws BOSException, SQLException {
|
|
|
Map<String, Map<String, String>> mapMap = Maps.newHashMap();
|
|
|
StringBuffer selSql = new StringBuffer();
|
|
|
selSql.append(" select oers.fid oersId, ");
|
|
|
- selSql.append(" (select top 1 adcount.fid from T_ORG_Admin child ");
|
|
|
- selSql.append(" left join T_ORG_Admin adcount on (charindex(concat(adcount.flongnumber,'!'),child.flongnumber) = 1 or adcount.flongnumber = child.flongnumber) ");
|
|
|
- selSql.append(" where child.fid=oers.FADMINORGUNITID ");
|
|
|
- selSql.append(" and adcount.FLAYERTYPEID='00000000-0000-0000-0000-00000000000362824988' ");
|
|
|
- selSql.append(" order by adcount.fsortcode) FADMINORGUNITID ");
|
|
|
- selSql.append(" ,oers.FLASTGRADELEVEL,(case when ppd.fid is null ");
|
|
|
+ selSql.append(" oers.FADMINORGUNITID FADMINORGUNITID, ");
|
|
|
+ selSql.append(" oers.FLASTGRADELEVEL,(case when ppd.fid is null ");
|
|
|
selSql.append(" then (oers.FPERIODYEAR||'-01-'||'01')||'T'|| (oers.FPERIODYEAR||'-01-'||'01') ");
|
|
|
selSql.append(" else (to_char(ppd.FPSTARTDATE,'yyyy-MM-dd')||'T'||to_char(ppd.FPENDDATE,'yyyy-MM-dd')) end) PERIOD ");
|
|
|
selSql.append(" from T_EVA_OrgEvaResultSummary oers ");
|
|
|
selSql.append(" left join T_EVA_PerfPeriod ppd on ppd.fid = oers.FPERIODID ");
|
|
|
selSql.append(" where to_char(ppd.FPSTARTDATE,'yyyy-MM-dd') >= ? and to_char(ppd.FPENDDATE,'yyyy-MM-dd') <= ? ");
|
|
|
selSql.append(" and ppd.FCYCLETYPE = ? and ppd.FREFSTATUS = 100 and oers.FBILLSTATE='3' ");
|
|
|
+ selSql.append(" and oers.FADMINORGUNITID in( ");
|
|
|
+ selSql.append(" select adcount.fid from T_ORG_Admin child ");
|
|
|
+ selSql.append(" left join T_ORG_Admin adcount on (charindex(concat(adcount.flongnumber,'!'),child.flongnumber) = 1 or adcount.flongnumber = child.flongnumber) ");
|
|
|
+ selSql.append(" where child.fid=oers.FADMINORGUNITID and adcount.FLAYERTYPEID='00000000-0000-0000-0000-00000000000362824988' ");
|
|
|
+ selSql.append(" ) ");
|
|
|
+ selSql.append(" UNION all ");
|
|
|
+ selSql.append(" select fid oersId, ");
|
|
|
+ selSql.append(" FADMINORGUNITID , ");
|
|
|
+ selSql.append(" FLASTGRADELEVEL,(FPERIODYEAR||'-'||(FPERIODTIME*3-2)||'-'||'01')||'T'|| (FPERIODYEAR||'-'||(FPERIODTIME*3)||'-'||?) PERIOD ");
|
|
|
+ selSql.append(" from T_EVA_OrgEvaResultSummary where FEVAPLANNAME='手工录入' ");
|
|
|
+ selSql.append(" and FADMINORGUNITID in( ");
|
|
|
+ selSql.append(" select adcount.fid from T_ORG_Admin child ");
|
|
|
+ selSql.append(" left join T_ORG_Admin adcount on (charindex(concat(adcount.flongnumber,'!'),child.flongnumber) = 1 or adcount.flongnumber = child.flongnumber) ");
|
|
|
+ selSql.append(" where child.fid=FADMINORGUNITID and adcount.FLAYERTYPEID='00000000-0000-0000-0000-00000000000362824988' ");
|
|
|
+ selSql.append(" ) ");
|
|
|
+ selSql.append(" and FPERIODTIMENUMBER like ? ");
|
|
|
+ Month endMonth = Month.of(quarter*3);
|
|
|
+ Year year1 = Year.of(year);
|
|
|
+ int days = endMonth.length(year1.isLeap());
|
|
|
String[] param = new String[]{startDate.format(DateTimeFormatter.ISO_LOCAL_DATE),
|
|
|
- endDate.format(DateTimeFormatter.ISO_LOCAL_DATE), String.valueOf(cycletype.getValue())};
|
|
|
+ endDate.format(DateTimeFormatter.ISO_LOCAL_DATE),
|
|
|
+ String.valueOf(cycletype.getValue()),
|
|
|
+ ((days > 9)? String.valueOf(days) : ("0"+String.valueOf(days)) ),
|
|
|
+ (FPERIODNAME+"%")
|
|
|
+ };
|
|
|
IRowSet rs = DbUtil.executeQuery(ctx, selSql.toString(), param);
|
|
|
int i = selSql.indexOf("?");
|
|
|
selSql.replace(i, i + 1, param[0]);
|
|
|
i = selSql.indexOf("?");
|
|
|
selSql.replace(i, i + 1, param[1]);
|
|
|
+ i = selSql.indexOf("?");
|
|
|
+ selSql.replace(i, i + 1, param[2]);
|
|
|
+ i = selSql.indexOf("?");
|
|
|
+ selSql.replace(i, i + 1, param[3]);
|
|
|
+ i = selSql.indexOf("?");
|
|
|
+ selSql.replace(i, i + 1, param[4]);
|
|
|
System.out.println(selSql);
|
|
|
while (rs.next()) {
|
|
|
Map<String, String> stringMap = Maps.newHashMap();
|
|
|
@@ -1546,36 +1675,10 @@ public class EvaResultSummaryManagerListHandlerExEx extends EvaResultSummaryMana
|
|
|
System.out.println(bigs);
|
|
|
System.out.println(bigsList);
|
|
|
Map<String, Object> map = Maps.newHashMap();
|
|
|
- String pstartdate = "2025-10-01";
|
|
|
- String penddate = "2025-12-31";
|
|
|
+ String pstartdate = "2024-10-01";
|
|
|
+ String penddate = "2024-10-31";
|
|
|
int cycletype = 300;
|
|
|
- LocalDate startDate = LocalDate.parse(pstartdate, DateTimeFormatter.ISO_LOCAL_DATE);
|
|
|
- LocalDate endDate = LocalDate.parse(penddate, DateTimeFormatter.ISO_LOCAL_DATE);
|
|
|
- EvalplanCycleTypeEnum cycleTypeEnum = EvalplanCycleTypeEnum.getEnum(cycletype);
|
|
|
- if (EvalplanCycleTypeEnum.FULL_YEAR_VALUE == cycletype) {
|
|
|
- //周期为年度
|
|
|
- endDate = endDate.plusYears(-1);
|
|
|
- startDate = startDate.plusYears(-1);
|
|
|
- cycleTypeEnum = EvalplanCycleTypeEnum.FULL_YEAR;
|
|
|
- } else if (EvalplanCycleTypeEnum.HALF_YEAR_VALUE == cycletype) {
|
|
|
- //周期为半年度
|
|
|
- endDate = endDate.plusMonths(-6);
|
|
|
- startDate = startDate.plusMonths(-6);
|
|
|
- cycleTypeEnum = EvalplanCycleTypeEnum.HALF_YEAR;
|
|
|
- } else if (EvalplanCycleTypeEnum.QUARTER_VALUE == cycletype) {
|
|
|
- //获取为季度
|
|
|
- endDate = endDate.plusMonths(-3);
|
|
|
- startDate = startDate.plusMonths(-3);
|
|
|
- cycleTypeEnum = EvalplanCycleTypeEnum.QUARTER;
|
|
|
- } else if (EvalplanCycleTypeEnum.MONTHLY_VALUE == cycletype) {
|
|
|
- //获取为季度
|
|
|
- endDate = endDate.plusMonths(-1);
|
|
|
- startDate = startDate.plusMonths(-1);
|
|
|
- cycleTypeEnum = EvalplanCycleTypeEnum.MONTHLY;
|
|
|
- }
|
|
|
- map.put("cycleType", cycleTypeEnum);
|
|
|
- map.put("endDate", endDate);
|
|
|
- map.put("startDate", startDate);
|
|
|
- //System.out.println(map);
|
|
|
+
|
|
|
+ System.out.println(getCycletype(pstartdate,penddate,cycletype));
|
|
|
}
|
|
|
}
|