|
|
@@ -1,24 +1,35 @@
|
|
|
package com.kingdee.eas.hr.perf.handler;
|
|
|
|
|
|
+import cn.hutool.core.util.StrUtil;
|
|
|
import com.alibaba.fastjson.JSON;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
import com.alibaba.fastjson.JSONObject;
|
|
|
+import com.google.common.collect.Maps;
|
|
|
+import com.google.common.collect.Sets;
|
|
|
import com.kingdee.bos.BOSException;
|
|
|
import com.kingdee.bos.Context;
|
|
|
import com.kingdee.bos.rabbitmq.guava.Lists;
|
|
|
import com.kingdee.eas.common.EASBizException;
|
|
|
import com.kingdee.eas.framework.CoreBaseInfo;
|
|
|
+import com.kingdee.eas.hr.perf.PerformProTeamCollection;
|
|
|
+import com.kingdee.eas.hr.perf.PerformProTeamFactory;
|
|
|
+import com.kingdee.eas.hr.perf.PersonPerformProCollection;
|
|
|
+import com.kingdee.eas.hr.perf.PersonPerformProFactory;
|
|
|
import com.kingdee.eas.util.app.DbUtil;
|
|
|
import com.kingdee.jdbc.rowset.IRowSet;
|
|
|
import com.kingdee.shr.base.syssetting.api.bean.BatchMessageTipsBody;
|
|
|
import com.kingdee.shr.base.syssetting.api.bean.BatchMessageTipsHeader;
|
|
|
import com.kingdee.shr.base.syssetting.context.SHRContext;
|
|
|
import com.kingdee.shr.base.syssetting.exception.SHRWebException;
|
|
|
+import com.kingdee.shr.base.syssetting.exception.ShrWebBizException;
|
|
|
import com.kingdee.shr.base.syssetting.web.json.JSONUtils;
|
|
|
import com.kingdee.shr.compensation.util.CmpStrUtil;
|
|
|
import com.kingdee.shr.perfweb.app.base.evalplan.EvaResultSummaryAuditBillFactory;
|
|
|
import com.kingdee.shr.perfweb.app.base.evalplan.IEvaResultSummaryAuditBill;
|
|
|
+import com.kingdee.shr.perfweb.app.exception.SHRPerfWebBizException;
|
|
|
+import com.kingdee.shr.perfweb.app.resource.SHRPerfWebResource;
|
|
|
import com.kingdee.shr.perfweb.planexecute.handler.EvaresultAuditBillEditHandler;
|
|
|
+import com.kingdee.shr.perfweb.util.SHRPerfWebResourceUtil;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
@@ -26,9 +37,9 @@ import org.springframework.ui.ModelMap;
|
|
|
|
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
import javax.servlet.http.HttpServletResponse;
|
|
|
+import java.math.BigDecimal;
|
|
|
import java.sql.SQLException;
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.List;
|
|
|
+import java.util.*;
|
|
|
|
|
|
/**
|
|
|
* @BelongsProject: dataImpExp820
|
|
|
@@ -50,6 +61,53 @@ public class EvaresultAuditBillEditHandlerEx extends EvaresultAuditBillEditHand
|
|
|
* @throws SHRWebException
|
|
|
*/
|
|
|
public void verifyBeforeSubmitAction(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
|
|
|
+ String entryData = request.getParameter("entryData");
|
|
|
+ BatchMessageTipsHeader header = new BatchMessageTipsHeader();
|
|
|
+ boolean isExists = true;
|
|
|
+ if (!com.kingdee.util.StringUtils.isEmpty(entryData)) {
|
|
|
+ String period = request.getParameter("period");
|
|
|
+ String planId = request.getParameter("planId");
|
|
|
+ String billId = request.getParameter("billId");
|
|
|
+ String ids = request.getParameter("ids");
|
|
|
+ List<String> rowList = Lists.newArrayList();
|
|
|
+ for (String id : billId.split(",")) {
|
|
|
+ rowList.add(id);
|
|
|
+ }
|
|
|
+ header=this.verifyToDep(request,response,modelMap);
|
|
|
+ if(header.getFailureCount()<=0&&header.getSuccessCount()>0){
|
|
|
+ header = this.beforeAuditEvaResutProject(ids,period,planId,entryData);
|
|
|
+ }
|
|
|
+ header.setBillId(billId.toString());
|
|
|
+ }
|
|
|
+ this.writeSuccessData(header);
|
|
|
+ }
|
|
|
+ protected static Set<String> getErrorIdsByBatchMessageTip(BatchMessageTipsHeader batchMessageTipsHeader) {
|
|
|
+ Set<String> errorIds = new HashSet();
|
|
|
+ Iterator var2 = batchMessageTipsHeader.getResult().iterator();
|
|
|
+
|
|
|
+ while(var2.hasNext()) {
|
|
|
+ BatchMessageTipsBody body = (BatchMessageTipsBody)var2.next();
|
|
|
+ if (!body.isMuitTipsState()) {
|
|
|
+ errorIds.add(body.getId());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return errorIds;
|
|
|
+ }
|
|
|
+ protected static void addBatchMessageSuccessTips(Set<String> ids, String message, BatchMessageTipsHeader batchMessageTipsHeader) {
|
|
|
+ Iterator var3 = ids.iterator();
|
|
|
+
|
|
|
+ while(var3.hasNext()) {
|
|
|
+ String id = (String)var3.next();
|
|
|
+ BatchMessageTipsBody body = new BatchMessageTipsBody();
|
|
|
+ body.setId(id);
|
|
|
+ body.setMuitTipsState(Boolean.TRUE);
|
|
|
+ body.setMuitTipsMessage(com.kingdee.util.StringUtils.isEmpty(message) ? SHRPerfWebResourceUtil.getRes(SHRPerfWebResource.OPERATESUCCESS, SHRContext.getInstance().getContext()) : message);
|
|
|
+ batchMessageTipsHeader.addResult(body);
|
|
|
+ }
|
|
|
+
|
|
|
+ }
|
|
|
+ public BatchMessageTipsHeader verifyToDep(HttpServletRequest request, HttpServletResponse response, ModelMap modelMap) throws SHRWebException {
|
|
|
String entryData = request.getParameter("entryData");
|
|
|
BatchMessageTipsHeader header = new BatchMessageTipsHeader();
|
|
|
boolean isExists = true;
|
|
|
@@ -84,22 +142,36 @@ public class EvaresultAuditBillEditHandlerEx extends EvaresultAuditBillEditHand
|
|
|
//当跨部门协作绩效等级为C、D等级的,当期员工绩效不得为高绩效(S、A等级)
|
|
|
if (rs.next()){
|
|
|
//跨部门协作绩效等级
|
|
|
- String depgradelevel = rs.getString("CFDEPGRADELEVEL");
|
|
|
- switch (depgradelevel){
|
|
|
- case "S":;
|
|
|
- case "A":;
|
|
|
- case "B":isSuccess=true; msg="校验通过";success+=1;break;
|
|
|
- case "C":
|
|
|
- case "D":
|
|
|
- if("S".equals(auditGradeLevel)||"A".equals(auditGradeLevel)){
|
|
|
- isSuccess=false;
|
|
|
- msg="当跨部门协作绩效等级为C、D等级的,当期员工绩效不得为高绩效(S、A等级)";
|
|
|
- fail+=1;
|
|
|
- } else {
|
|
|
- isSuccess=true; msg="校验通过";success+=1;
|
|
|
- }
|
|
|
- break;
|
|
|
- }
|
|
|
+ String depgradelevel = rs.getString("CFDEPGRADELEVEL");
|
|
|
+ if(StringUtils.isNotBlank(depgradelevel)) {
|
|
|
+ switch (depgradelevel) {
|
|
|
+ case "S":
|
|
|
+ ;
|
|
|
+ case "A":
|
|
|
+ ;
|
|
|
+ case "B":
|
|
|
+ isSuccess = true;
|
|
|
+ msg = "校验通过";
|
|
|
+ success += 1;
|
|
|
+ break;
|
|
|
+ case "C":
|
|
|
+ case "D":
|
|
|
+ if ("S".equals(auditGradeLevel) || "A".equals(auditGradeLevel)) {
|
|
|
+ isSuccess = false;
|
|
|
+ msg = "当跨部门协作绩效等级为C、D等级的,当期员工绩效不得为高绩效(S、A等级)";
|
|
|
+ fail += 1;
|
|
|
+ } else {
|
|
|
+ isSuccess = true;
|
|
|
+ msg = "校验通过";
|
|
|
+ success += 1;
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ msg="没有当跨部门协作绩效等级,请先检查跨部门协作绩效等级";
|
|
|
+ isSuccess=true;
|
|
|
+ success+=1;
|
|
|
+ }
|
|
|
}else {
|
|
|
msg="操作失败,数据异常";
|
|
|
isSuccess=false;
|
|
|
@@ -123,46 +195,636 @@ public class EvaresultAuditBillEditHandlerEx extends EvaresultAuditBillEditHand
|
|
|
header.setFailureCount(fail);
|
|
|
header.setSuccessCount(success);
|
|
|
}
|
|
|
- this.writeSuccessData(header);
|
|
|
+ return (header);
|
|
|
}
|
|
|
|
|
|
- protected void verifyModel(HttpServletRequest request, HttpServletResponse response, CoreBaseInfo model) throws SHRWebException {
|
|
|
+ protected static void addBatchMessageTip(String unvalidEvaObj, String message, BatchMessageTipsHeader batchMessageTipsHeader) {
|
|
|
+ BatchMessageTipsBody body = new BatchMessageTipsBody();
|
|
|
+ body.setId(unvalidEvaObj);
|
|
|
+ body.setMuitTipsState(Boolean.FALSE);
|
|
|
+ body.setMuitTipsMessage(message);
|
|
|
+ batchMessageTipsHeader.addResult(body);
|
|
|
+ batchMessageTipsHeader.setFailureCount(batchMessageTipsHeader.getFailureCount() + 1);
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取人员项目正态分布规则
|
|
|
+ *
|
|
|
+ * @param ctx
|
|
|
+ * @param idList 非必填
|
|
|
+ * @param batchMessage 非必填
|
|
|
+ * @return
|
|
|
+ * @throws BOSException
|
|
|
+ * @throws SQLException
|
|
|
+ */
|
|
|
+ public Map<String, Map<String, BigDecimal>> getProjectPerformPro(Context ctx, List<String> idList, Map<String, String> batchMessage) throws BOSException, SQLException {
|
|
|
+ //获取正态分布规则
|
|
|
+ Map<String, Map<String, BigDecimal>> orgLevelMap = Maps.newHashMap();
|
|
|
+ PerformProTeamCollection proCollection = PerformProTeamFactory.getLocalInstance(ctx).getPerformProTeamCollection(" where status=1 ");
|
|
|
+ if (proCollection.size() == 1) {
|
|
|
+ StringBuilder orgPerSql = new StringBuilder();
|
|
|
+ orgPerSql.append(" select fp.fid,fpe.CFS,fpe.CFA,fpe.CFB,fpe.CFC,fpe.CFD,fpe.CFORGPERFORMTYPE ");
|
|
|
+ orgPerSql.append(" from CT_PF_PerformProTeam fp ");
|
|
|
+ orgPerSql.append(" left join CT_PF_PerformProTeamEntry fpe on fp.fid=fpe.FPARENTID ");
|
|
|
+ orgPerSql.append(" where fp.CFSTATUS = 1 ");
|
|
|
+ orgPerSql.append(" order by fp.FCREATETIME ");
|
|
|
+ IRowSet rs = DbUtil.executeQuery(ctx, orgPerSql.toString());
|
|
|
+ while (rs.next()) {
|
|
|
+ Map<String, BigDecimal> objectMap = Maps.newHashMap();
|
|
|
+ String type = rs.getString("CFORGPERFORMTYPE");
|
|
|
+ objectMap.put("S", rs.getBigDecimal("CFS"));
|
|
|
+ objectMap.put("A", rs.getBigDecimal("CFA"));
|
|
|
+ objectMap.put("B", rs.getBigDecimal("CFB"));
|
|
|
+ objectMap.put("C", rs.getBigDecimal("CFC"));
|
|
|
+ objectMap.put("D", rs.getBigDecimal("CFD"));
|
|
|
+ orgLevelMap.put(type, objectMap);
|
|
|
+ }
|
|
|
+ } else if (proCollection.size() > 1) {
|
|
|
+ if (null != batchMessage && null != idList) {
|
|
|
+ for (String key : idList) {
|
|
|
+ batchMessage.put(key, "存在多个正态分布规则,请检查!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (null != batchMessage && null != idList) {
|
|
|
+ for (String key : idList) {
|
|
|
+ batchMessage.put(key, "不存在正态分布规则,请检查!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return orgLevelMap;
|
|
|
+ }
|
|
|
+ /**
|
|
|
+ * 获取人员组织正态分布规则
|
|
|
+ *
|
|
|
+ * @param ctx
|
|
|
+ * @param idList 非必填
|
|
|
+ * @param batchMessage 非必填
|
|
|
+ * @return
|
|
|
+ * @throws BOSException
|
|
|
+ * @throws SQLException
|
|
|
+ */
|
|
|
+ public Map<String, Map<String, BigDecimal>> getPersonPerformPro(Context ctx, List<String> idList, Map<String, String> batchMessage) throws BOSException, SQLException {
|
|
|
+ //获取正态分布规则
|
|
|
+ Map<String, Map<String, BigDecimal>> orgLevelMap = Maps.newHashMap();
|
|
|
+ PersonPerformProCollection proCollection = PersonPerformProFactory.getLocalInstance(ctx).getPersonPerformProCollection(" where state=1 ");
|
|
|
+ if (proCollection.size() == 1) {
|
|
|
+ StringBuilder orgPerSql = new StringBuilder();
|
|
|
+ orgPerSql.append(" select fp.fid,fpe.CFS,fpe.CFA,fpe.CFB,fpe.CFC,fpe.CFD,fpe.CFORGPERFORMTYPE ");
|
|
|
+ orgPerSql.append(" from CT_PF_PersonPerformPro fp ");
|
|
|
+ orgPerSql.append(" left join CT_PF_PersonPerformProEntry fpe on fp.fid=fpe.FPARENTID ");
|
|
|
+ orgPerSql.append(" where fp.CFSTATE = 1 ");
|
|
|
+ orgPerSql.append(" order by fp.FCREATETIME ");
|
|
|
+ IRowSet rs = DbUtil.executeQuery(ctx, orgPerSql.toString());
|
|
|
+ while (rs.next()) {
|
|
|
+ Map<String, BigDecimal> objectMap = Maps.newHashMap();
|
|
|
+ String type = rs.getString("CFORGPERFORMTYPE");
|
|
|
+ objectMap.put("S", rs.getBigDecimal("CFS"));
|
|
|
+ objectMap.put("A", rs.getBigDecimal("CFA"));
|
|
|
+ objectMap.put("B", rs.getBigDecimal("CFB"));
|
|
|
+ objectMap.put("C", rs.getBigDecimal("CFC"));
|
|
|
+ objectMap.put("D", rs.getBigDecimal("CFD"));
|
|
|
+ orgLevelMap.put(type, objectMap);
|
|
|
+ }
|
|
|
+ } else if (proCollection.size() > 1) {
|
|
|
+ if (null != batchMessage && null != idList) {
|
|
|
+ for (String key : idList) {
|
|
|
+ batchMessage.put(key, "存在多个正态分布规则,请检查!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ if (null != batchMessage && null != idList) {
|
|
|
+ for (String key : idList) {
|
|
|
+ batchMessage.put(key, "不存在正态分布规则,请检查!");
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return orgLevelMap;
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * 获取人员的等级组织分组
|
|
|
+ *
|
|
|
+ * @param ctx
|
|
|
+ * @param entryList
|
|
|
+ * @return
|
|
|
+ * @throws BOSException
|
|
|
+ * @throws SQLException
|
|
|
+ */
|
|
|
+ public Map<String, Map<String, Object>> getPersonLevelLensMap(Context ctx, JSONArray entryList) throws BOSException, SQLException {
|
|
|
+
|
|
|
+ Map<String, Map<String, Object>> personLevelMap = Maps.newHashMap();
|
|
|
+ Map<String, BigDecimal> revLevelMap = Maps.newHashMap();
|
|
|
+ for(int i=0;i<entryList.size();i++) {
|
|
|
+ JSONObject object = entryList.getJSONObject(i);
|
|
|
+ String id =object.getString("id");
|
|
|
+ String evaResult = object.getString("evaResult.id");
|
|
|
+ //修改后等级
|
|
|
+ String auditGradeLevel = object.getString("evaResult.auditGradeLevel");
|
|
|
+ BigDecimal l = revLevelMap.get(auditGradeLevel);
|
|
|
+ if(Objects.isNull(l)){
|
|
|
+ l=BigDecimal.ZERO;
|
|
|
+ }
|
|
|
+ l=l.add(BigDecimal.ONE);
|
|
|
+ revLevelMap.put(auditGradeLevel, l);
|
|
|
+ }
|
|
|
+ for(int i=0;i<entryList.size();i++) {
|
|
|
+ JSONObject object = entryList.getJSONObject(i);
|
|
|
+ String id =object.getString("id");
|
|
|
|
|
|
+ String evaResult = object.getString("evaResult.id");
|
|
|
+ //修改后等级
|
|
|
+ String auditGradeLevel = object.getString("evaResult.auditGradeLevel");
|
|
|
+ Map<String, Object> map = Maps.newHashMap();
|
|
|
+ String key = auditGradeLevel;
|
|
|
+ map.put("lens", revLevelMap.get(auditGradeLevel));
|
|
|
+ map.put("id",id);
|
|
|
+ map.put("evaResult",evaResult);
|
|
|
+ map.put("revLevel",auditGradeLevel);
|
|
|
+ personLevelMap.put(key, map);
|
|
|
+ }
|
|
|
+ return personLevelMap;
|
|
|
}
|
|
|
|
|
|
- public String beforeAuditEvaResut(Context ctx, List<String> ids) throws SHRWebException {
|
|
|
+ /**
|
|
|
+ * 根据上季度的组织等级,校验当前周期,当前考核计划,所选员工的所属组织的员工绩效等级分布校验
|
|
|
+ *
|
|
|
+ * @throws SHRWebException
|
|
|
+ */
|
|
|
+ public BatchMessageTipsHeader beforeAuditEvaResutProject(String ids, String period, String planId, String entryData) throws SHRWebException {
|
|
|
+ Context ctx = SHRContext.getInstance().getContext();
|
|
|
|
|
|
- List<String> unIdLIst = Lists.newArrayList();
|
|
|
- StringBuilder err = new StringBuilder();
|
|
|
+ BatchMessageTipsHeader batchMessageTipsHeader = new BatchMessageTipsHeader();
|
|
|
+ if (ids == null) {
|
|
|
+ throw new ShrWebBizException(new SHRPerfWebBizException(SHRPerfWebBizException.SYSTEMERR));
|
|
|
+ }
|
|
|
try {
|
|
|
- StringBuffer sql = new StringBuffer();
|
|
|
- sql.append(" select ers.fid,ers.FPNAME,ers.FPNUMBER,pp.FPSTARTDATE,ers.CFOrgLevelEveID,pp.FYEAR,pp.FTIMEPERIOD from ");
|
|
|
- sql.append(" T_EVA_EvaResultSummary ers ");
|
|
|
- sql.append(" left join T_EVA_PerfPeriod pp on ers.FPERIODID=pp.fid ");
|
|
|
- sql.append(" where ers.fid in(''");
|
|
|
- for (String id : ids) {
|
|
|
- sql.append(",'").append(id).append("'");
|
|
|
+
|
|
|
+ int fail = 0;
|
|
|
+ List<String> idList = Lists.newArrayList();
|
|
|
+ for (String id : ids.split(",")) {
|
|
|
+ idList.add(id);
|
|
|
}
|
|
|
- sql.append(" ) ");
|
|
|
- IRowSet rsSql = DbUtil.executeQuery(ctx, sql.toString());
|
|
|
- while (rsSql.next()){
|
|
|
- String id = rsSql.getString("id");
|
|
|
- String FPNAME = rsSql.getString("FPNAME");
|
|
|
- String FPNUMBER = rsSql.getString("FPNUMBER");
|
|
|
- String orgLevelEveID = rsSql.getString("CFOrgLevelEveID");
|
|
|
- if(StringUtils.isBlank(orgLevelEveID)) {
|
|
|
- err.append("员工:"+FPNAME+"("+FPNUMBER+"),无法获取当前组织绩效考核等级");
|
|
|
- unIdLIst.add(id);
|
|
|
+ Set<String> idSet = Sets.newHashSet();
|
|
|
+ idSet.addAll(idList);
|
|
|
+ int success = idList.size();
|
|
|
+ //明细数据
|
|
|
+ JSONArray entryList = JSON.parseArray(entryData);
|
|
|
+ StringBuilder planSql = new StringBuilder();
|
|
|
+ planSql.append("select fid,CFPerobjectIdId from T_EVA_PerfPlan where fid=? and CFPerobjectIdId is not null ");
|
|
|
+ IRowSet rs = DbUtil.executeQuery(ctx, planSql.toString(), new Object[]{planId});
|
|
|
+ if (rs.next()) {
|
|
|
+ String CFPerobjectIdId = rs.getString("CFPerobjectIdId");
|
|
|
+ Map<String, String> batchMessage = this.beforeAuditProjectEvaResut(ctx, period, planId, idList,entryList);
|
|
|
+ if (null != batchMessage && batchMessage.size() > 0) {
|
|
|
+ for (Map.Entry<String, String> entry : batchMessage.entrySet()) {
|
|
|
+ addBatchMessageTip(entry.getKey(), entry.getValue(), batchMessageTipsHeader);
|
|
|
+ idSet.remove(entry.getKey());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ Map<String, String> batchMessage = this.beforeAuditEvaResut(ctx, period, planId, idList,entryList);
|
|
|
+ if (null != batchMessage && batchMessage.size() > 0) {
|
|
|
+ for (Map.Entry<String, String> entry : batchMessage.entrySet()) {
|
|
|
+ addBatchMessageTip(entry.getKey(), entry.getValue(), batchMessageTipsHeader);
|
|
|
+ idSet.remove(entry.getKey());
|
|
|
+ }
|
|
|
}
|
|
|
+ //addBatchMessageSuccessTips(idSet,"验证成功",batchMessageTipsHeader);
|
|
|
}
|
|
|
+ this.addBatchMessageSuccessTips(idSet,"验证成功",batchMessageTipsHeader);
|
|
|
+ batchMessageTipsHeader.setSuccessCount(idList.size()-batchMessageTipsHeader.getFailureCount());
|
|
|
+ } catch (Exception e) {
|
|
|
+ e.printStackTrace();
|
|
|
+ throw new ShrWebBizException(e);
|
|
|
+ }
|
|
|
+
|
|
|
+ batchMessageTipsHeader.setBillId(ids.toString());
|
|
|
+
|
|
|
+ return batchMessageTipsHeader;
|
|
|
+ }
|
|
|
+
|
|
|
+ public BigDecimal getLens(String levelID, Map<String, Map<String, Object>> personLevelMap){
|
|
|
+ Map<String, Object> personMap = personLevelMap.get(levelID);
|
|
|
+ BigDecimal lens = BigDecimal.ZERO;
|
|
|
+ if (null != personMap) {
|
|
|
+ lens = (BigDecimal) personMap.get("lens");
|
|
|
+
|
|
|
+ }
|
|
|
+ return lens;
|
|
|
+ }
|
|
|
+
|
|
|
+ public Map<String, String> beforeAuditProjectEvaResut(Context ctx, String period, String planId, List<String> idList,JSONArray entryList ) throws BOSException, SQLException {
|
|
|
+ Map<String, String> batchMessage = Maps.newHashMap();
|
|
|
+ StringBuilder selParamId = new StringBuilder("''");
|
|
|
+ for (int i = 0; i < idList.size(); i++) {
|
|
|
+ selParamId.append(",?");
|
|
|
+ }
|
|
|
+ //获取正态分布规则
|
|
|
+ Map<String, Map<String, BigDecimal>> personPerformMap = this.getProjectPerformPro(ctx, idList, batchMessage);
|
|
|
+ if (null != personPerformMap && personPerformMap.size() > 0) {
|
|
|
+ //获取组织分组人数
|
|
|
+ //Map<String, Map<String, String>> orgLevelMap = this.getProjectLevelCountMap(ctx, period, planId,selParamId, idList);
|
|
|
+ //获取人员等级分组
|
|
|
+ Map<String, Map<String, Object>> personLevelMap = this.getPersonLevelLensMap(ctx,entryList);
|
|
|
+
|
|
|
+
|
|
|
+ BigDecimal big100 = new BigDecimal(100);
|
|
|
+ for(int i=0;i<entryList.size();i++) {
|
|
|
+ JSONObject object = entryList.getJSONObject(i);
|
|
|
+ String fid =object.getString("id");
|
|
|
+ String evaResult = object.getString("evaResult.id");
|
|
|
+ //修改后等级
|
|
|
+ String auditGradeLevel = object.getString("evaResult.auditGradeLevel");
|
|
|
+ String revLevel = auditGradeLevel;
|
|
|
+ if (StrUtil.isBlank(auditGradeLevel)) {
|
|
|
+ batchMessage.put(fid, "绩效等级为空,请维护");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ StringBuilder sel = new StringBuilder();
|
|
|
+ sel.append(" select s1.fid,ppm.CFPROJECTNAME, pp.CFPerobjectIdId, s1.FPERIODID, s1.FEVAPLANID,");
|
|
|
+ sel.append(" isnull(s1.FREVISEGRADELEVEL,s1.FGRADELEVEL) revLevel,s1.CFProjectLevel ");
|
|
|
+ sel.append(" from T_EVA_EvaResultSummary s1 ");
|
|
|
+ sel.append(" left join T_EVA_PerfPlan pp on pp.fid = s1.FEVAPLANID ");
|
|
|
+ sel.append(" left join CT_PRO_ProjectManagement ppm on ppm.fid = pp.CFPerobjectIdId ");
|
|
|
+ sel.append(" where s1.fid in ('");
|
|
|
+ sel.append(evaResult);
|
|
|
+ sel.append("') ");
|
|
|
+ IRowSet rs = DbUtil.executeQuery(ctx, sel.toString(), idList.toArray());
|
|
|
+ if (!rs.next()){
|
|
|
+ batchMessage.put(fid, "绩效等级为空,请维护");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ String CFPROJECTNAME = rs.getString("CFPROJECTNAME");
|
|
|
+
|
|
|
+ if (StrUtil.isBlank(revLevel)) {
|
|
|
+ //String msg = String.format("%s绩效等级为空", CFPROJECTNAME);
|
|
|
+ batchMessage.put(fid, "绩效等级为空,请维护");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+
|
|
|
+ //项目绩效等级
|
|
|
+ String projectLevel = rs.getString("CFProjectLevel");
|
|
|
+ if (StrUtil.isBlank(projectLevel)) {
|
|
|
+ String msg = String.format("%s项目绩效等级为空", CFPROJECTNAME);
|
|
|
+ batchMessage.put(fid, msg);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //该组织的组织绩效等级的正态分布
|
|
|
+ Map<String, BigDecimal> personPerform = personPerformMap.get(projectLevel);
|
|
|
+ if (null == personPerform) {
|
|
|
+ String msg = String.format("没有找到%s项目绩效等级%s的正态分布规则", CFPROJECTNAME, projectLevel);
|
|
|
+ batchMessage.put(fid, msg);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //获取该组织下的人员总数
|
|
|
+ //Map<String, String> orgMap = orgLevelMap.get(key);
|
|
|
+ //获取该组织下的人员各个绩效等级分组汇总
|
|
|
+// String keyRevLevel = FADMINORGUNITID + FPERIODID + FEVAPLANID + revLevel;
|
|
|
+// Map<String, String> personMap = personLevelMap.get(keyRevLevel);
|
|
|
+ Map<String, BigDecimal> leveList = Maps.newHashMap();
|
|
|
+
|
|
|
+ //获取该组织下的人员总数
|
|
|
+ //Map<String, String> orgMap = orgLevelMap.get(key);
|
|
|
+
|
|
|
+ //获取等级D人数
|
|
|
+ String keyRevLevelD = "D";
|
|
|
+ BigDecimal dLens = this.getLens(keyRevLevelD,personLevelMap);
|
|
|
+ leveList.put("D", dLens);
|
|
|
+ //获取等级C人数
|
|
|
+ String keyRevLevelC = "C";
|
|
|
+ BigDecimal cLens = this.getLens(keyRevLevelC,personLevelMap);
|
|
|
+ leveList.put("C", cLens);
|
|
|
+
|
|
|
+ //获取等级B人数
|
|
|
+ String keyRevLevelB = "B";
|
|
|
+ BigDecimal bLens = this.getLens(keyRevLevelB,personLevelMap);
|
|
|
+ leveList.put("B", bLens);
|
|
|
+
|
|
|
+ //获取等级A人数
|
|
|
+ String keyRevLevelA = "A";
|
|
|
+ BigDecimal aLens = this.getLens(keyRevLevelA,personLevelMap);
|
|
|
+ leveList.put("A", aLens);
|
|
|
+
|
|
|
+ //获取等级S人数
|
|
|
+ String keyRevLevelS = "S";
|
|
|
+ BigDecimal sLens = this.getLens(keyRevLevelS,personLevelMap);
|
|
|
+ leveList.put("S", sLens);
|
|
|
+
|
|
|
+ //总人数
|
|
|
+ BigDecimal alls = new BigDecimal(idList.size());
|
|
|
+
|
|
|
+ //当前等级正态分布比例
|
|
|
+ BigDecimal scale = personPerform.get(revLevel);
|
|
|
+ //创建每个等级的人数列表
|
|
|
+ Map<String, BigDecimal> bigsList = Maps.newHashMap();
|
|
|
+ BigDecimal bigS = ((personPerform.get("S").divide(big100, BigDecimal.ROUND_HALF_UP, BigDecimal.ROUND_HALF_UP)).multiply(alls).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
+ bigsList.put("S", bigS);
|
|
|
+ BigDecimal bigA = ((personPerform.get("A").divide(big100, BigDecimal.ROUND_HALF_UP, BigDecimal.ROUND_HALF_UP)).multiply(alls).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
+ bigsList.put("A", bigA);
|
|
|
+ BigDecimal bigB = ((personPerform.get("B").divide(big100, BigDecimal.ROUND_HALF_UP, BigDecimal.ROUND_HALF_UP)).multiply(alls).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
+ bigsList.put("B", bigB);
|
|
|
+ BigDecimal bigC = ((personPerform.get("C").divide(big100, BigDecimal.ROUND_HALF_UP, BigDecimal.ROUND_HALF_UP)).multiply(alls).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
+ bigsList.put("C", bigC);
|
|
|
+ BigDecimal bigD = ((personPerform.get("D").divide(big100, BigDecimal.ROUND_HALF_UP, BigDecimal.ROUND_HALF_UP)).multiply(alls).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
+ bigsList.put("D", bigD);
|
|
|
+
|
|
|
+ //已占用数
|
|
|
+ BigDecimal lens = BigDecimal.ZERO;
|
|
|
+ //进行额度加减
|
|
|
+ BigDecimal personSize = BigDecimal.ZERO;
|
|
|
+ BigDecimal personMaxSize = BigDecimal.ZERO;
|
|
|
+ BigDecimal personMinSize = BigDecimal.ZERO;
|
|
|
+ BigDecimal personMaxASize = BigDecimal.ZERO;
|
|
|
+ BigDecimal personMaxSSize = BigDecimal.ZERO;
|
|
|
+ BigDecimal personMinCSize = BigDecimal.ZERO;
|
|
|
+ BigDecimal personMinDSize = BigDecimal.ZERO;
|
|
|
+ BigDecimal personMinVSize = BigDecimal.ZERO;
|
|
|
+ List<String> ldrs = Lists.newArrayList();
|
|
|
+ Map<String,String> ldrcd = Maps.newHashMap();
|
|
|
+ switch (auditGradeLevel) {
|
|
|
+ case "A":
|
|
|
+ personSize = personSize.add(bigA).subtract(aLens);
|
|
|
+ lens = lens.add(aLens);
|
|
|
+ if ("A".equals(auditGradeLevel)) {
|
|
|
+ personMaxSize = personMaxSize.add((bigA));
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ personMaxSize = personMaxSize.add((bigA).subtract(aLens));
|
|
|
+ }
|
|
|
+ personMaxASize = new BigDecimal(personMaxSize.toPlainString());
|
|
|
+ ldrs.add("A最多"+personMaxASize.toPlainString()+"人,");
|
|
|
+ //bigsList.remove("A");
|
|
|
+ case "S":
|
|
|
+ personSize = personSize.add(bigS).subtract(sLens);
|
|
|
+ lens = lens.add(sLens);
|
|
|
+ if ("S".equals(auditGradeLevel)) {
|
|
|
+ personMaxSize = personMaxSize.add((bigS));
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ personMaxSize = personMaxSize.add((bigS).subtract(sLens));
|
|
|
+ }
|
|
|
+ personMaxSSize = new BigDecimal(personMaxSize.toPlainString());
|
|
|
+ ldrs.add("S最多"+personMaxSSize.toPlainString()+"人,");
|
|
|
+ //bigsList.remove("S");
|
|
|
+ case "B":
|
|
|
+ case "C":
|
|
|
+ personMinVSize=personMinVSize.add(bigC).subtract(cLens);
|
|
|
+ if ("C".equals(revLevel)) {
|
|
|
+ personMinSize = personMinSize.add((bigC));
|
|
|
+ } else {
|
|
|
+ personMinSize = personMinSize.add((bigC).subtract(cLens));
|
|
|
+ }
|
|
|
+ personMinCSize = new BigDecimal(bigC.toPlainString());
|
|
|
+ //bigsList.remove("C");
|
|
|
+ case "D":
|
|
|
+ personMinVSize=personMinVSize.add(bigD).subtract(dLens);
|
|
|
+ if ("D".equals(revLevel)) {
|
|
|
+ personMinSize = personMinSize.add((bigD));
|
|
|
+ } else {
|
|
|
+ personMinSize = personMinSize.add((bigD).subtract(dLens));
|
|
|
+ }
|
|
|
+ personMinDSize = new BigDecimal(bigD.add(bigC).toPlainString());
|
|
|
+ }
|
|
|
+ switch (revLevel) {
|
|
|
+ case "A":
|
|
|
+ case "S":
|
|
|
+ case "B":
|
|
|
+ ldrcd.put("C", "C最少" + (personMinCSize.compareTo(BigDecimal.ZERO) > 0 ? personMinCSize.toPlainString() : '0') + "人或者D最少" + (personMinDSize.compareTo(BigDecimal.ZERO) > 0 ? personMinDSize.toPlainString() : "0") + "人,");
|
|
|
+ break;
|
|
|
+ case "C":
|
|
|
+ ldrcd.put("C", "C最少" + (bigC.compareTo(BigDecimal.ZERO) > 0 ? bigC.toPlainString() : '0') + "人或者D最少" + (personMinDSize.compareTo(BigDecimal.ZERO) > 0 ? personMinDSize.toPlainString() : "0") + "人,");
|
|
|
+ break;
|
|
|
+ case "D":
|
|
|
+ ldrcd.put("D", "D最少" + bigD + "人,");
|
|
|
+ }
|
|
|
+ String ld = "当前周期绩效等级为%l的人数为%maxs人,";
|
|
|
+ if (personMinVSize.compareTo(BigDecimal.ZERO) > 0 || personSize.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
+ if(ldrs.size()>0) {
|
|
|
+ String ldrstr = ldrs.get(0);
|
|
|
+ ld += ldrstr;
|
|
|
+ ld = ld.replace("%" + revLevel, (personMaxSize.compareTo(BigDecimal.ZERO) > 0 ? (personMaxSize) : BigDecimal.ZERO).toPlainString());
|
|
|
+ }
|
|
|
+ ld = ld.replace("%l", revLevel);
|
|
|
+ ld = ld.replace("%maxs", (leveList.get(revLevel) == null ? BigDecimal.ZERO : leveList.get(revLevel)).toPlainString());
|
|
|
+
|
|
|
+ for (Map.Entry<String,String> entry : ldrcd.entrySet()) {
|
|
|
+ String eKey = entry.getKey();
|
|
|
+ String ldr= entry.getValue();
|
|
|
+ ld += ldr;
|
|
|
+ }
|
|
|
+ ld += "请修正后重新审核.";
|
|
|
+ batchMessage.put(fid, ld);
|
|
|
+ }
|
|
|
|
|
|
- if(!unIdLIst.isEmpty()) {
|
|
|
- ids.removeAll(unIdLIst);
|
|
|
- err.append("存在无法获取当前组织绩效考核等级的记录");
|
|
|
}
|
|
|
- }catch (Exception e){
|
|
|
- e.printStackTrace();
|
|
|
}
|
|
|
- return err.toString();
|
|
|
+ return batchMessage;
|
|
|
}
|
|
|
+ /**
|
|
|
+ * 结果直接审核、结果工作流审核,绩效等级分布比例校验人数由整个绩效考核计划的人数改为按选择的人数进行分布比例校验。
|
|
|
+ *
|
|
|
+ * @param ctx
|
|
|
+ * @param period
|
|
|
+ * @param planId
|
|
|
+ * @param idList
|
|
|
+ * @return
|
|
|
+ * @throws BOSException
|
|
|
+ * @throws SQLException
|
|
|
+ */
|
|
|
+ public Map<String, String> beforeAuditEvaResut(Context ctx, String period, String planId, List<String> idList,JSONArray entryList) throws BOSException, SQLException {
|
|
|
+ Map<String, String> batchMessage = Maps.newHashMap();
|
|
|
+ StringBuilder selParamId = new StringBuilder("''");
|
|
|
+ for (int i = 0; i < idList.size(); i++) {
|
|
|
+ selParamId.append(",?");
|
|
|
+ }
|
|
|
+ //获取正态分布规则
|
|
|
+ Map<String, Map<String, BigDecimal>> personPerformMap = this.getPersonPerformPro(ctx, idList, batchMessage);
|
|
|
+ if (null != personPerformMap && personPerformMap.size() > 0) {
|
|
|
+ //获取组织分组人数
|
|
|
+ //Map<String, Map<String, String>> orgLevelMap = this.getOrgLevelCountMap(ctx, period, planId);
|
|
|
+ //获取人员等级分组
|
|
|
+ Map<String, Map<String, Object>> personLevelMap = this.getPersonLevelLensMap(ctx, entryList);
|
|
|
+
|
|
|
+ BigDecimal big100 = new BigDecimal(100);
|
|
|
+ for(int i=0;i<entryList.size();i++) {
|
|
|
+ JSONObject object = entryList.getJSONObject(i);
|
|
|
+ String fid = object.getString("id");
|
|
|
+ String evaResult = object.getString("evaResult.id");
|
|
|
+ //修改后等级
|
|
|
+ String auditGradeLevel = object.getString("evaResult.auditGradeLevel");
|
|
|
+
|
|
|
+ if (StrUtil.isBlank(auditGradeLevel)) {
|
|
|
+ batchMessage.put(fid, "绩效等级为空,请维护");
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ StringBuilder sel = new StringBuilder();
|
|
|
+ sel.append(" select ers.fid,ers.FADMINORGNAME, ");
|
|
|
+ sel.append(" ers.FPERIODID, ers.FEVAPLANID,isnull(ers.FREVISEGRADELEVEL, ers.FGRADELEVEL) revLevel,ers.CFOrgLevel ");
|
|
|
+ sel.append(" from T_EVA_EvaResultSummary ers where ers.fid = '");
|
|
|
+ sel.append(evaResult);
|
|
|
+ sel.append("' ");
|
|
|
+ IRowSet rs = DbUtil.executeQuery(ctx, sel.toString());
|
|
|
+ String orgLevel="";
|
|
|
+ String FADMINORGNAME ="";
|
|
|
+ //上季度组织绩效等级
|
|
|
+ if (rs.next()){
|
|
|
+ orgLevel = rs.getString("CFOrgLevel");
|
|
|
+ FADMINORGNAME = rs.getString("FADMINORGNAME");
|
|
|
+ if (StringUtils.isBlank(orgLevel)) {
|
|
|
+ String msg = String.format("%s上季度组织绩效等级为空", FADMINORGNAME);
|
|
|
+ batchMessage.put(fid, msg);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //该组织的组织绩效等级的正态分布
|
|
|
+ Map<String, BigDecimal> personPerform = personPerformMap.get(orgLevel);
|
|
|
+ if (null == personPerform) {
|
|
|
+ String msg = String.format("没有找到%s上季度组织绩效等级%s的正态分布规则", FADMINORGNAME, orgLevel);
|
|
|
+ batchMessage.put(fid, msg);
|
|
|
+ continue;
|
|
|
+ }
|
|
|
+ //获取该组织下的人员总数
|
|
|
+ //Map<String, String> orgMap = orgLevelMap.get(key);
|
|
|
+ Map<String, BigDecimal> leveList = Maps.newHashMap();
|
|
|
+ //获取等级D人数
|
|
|
+ String keyRevLevelD = "D";
|
|
|
+ BigDecimal dLens = this.getLens(keyRevLevelD,personLevelMap);
|
|
|
+ leveList.put("D", dLens);
|
|
|
+ //获取等级C人数
|
|
|
+ String keyRevLevelC = "C";
|
|
|
+ BigDecimal cLens = this.getLens(keyRevLevelC,personLevelMap);
|
|
|
+ leveList.put("C", cLens);
|
|
|
+
|
|
|
+ //获取等级B人数
|
|
|
+ String keyRevLevelB = "B";
|
|
|
+ BigDecimal bLens = this.getLens(keyRevLevelB,personLevelMap);
|
|
|
+ leveList.put("B", bLens);
|
|
|
+
|
|
|
+ //获取等级A人数
|
|
|
+ String keyRevLevelA = "A";
|
|
|
+ BigDecimal aLens = this.getLens(keyRevLevelA,personLevelMap);
|
|
|
+ leveList.put("A", aLens);
|
|
|
+
|
|
|
+ //获取等级S人数
|
|
|
+ String keyRevLevelS = "S";
|
|
|
+ BigDecimal sLens = this.getLens(keyRevLevelS,personLevelMap);
|
|
|
+ leveList.put("S", sLens);
|
|
|
+
|
|
|
+ System.out.println("leveList:"+leveList);
|
|
|
+ //总人数
|
|
|
+ BigDecimal alls = new BigDecimal(idList.size());
|
|
|
+
|
|
|
+ //当前等级正态分布比例
|
|
|
+ BigDecimal scale = personPerform.get(auditGradeLevel);
|
|
|
+ //创建每个等级的人数列表
|
|
|
+ Map<String, BigDecimal> bigsList = Maps.newHashMap();
|
|
|
+ BigDecimal bigS = ((personPerform.get("S").divide(big100, BigDecimal.ROUND_HALF_UP, BigDecimal.ROUND_HALF_UP)).multiply(alls).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
+ bigsList.put("S", bigS);
|
|
|
+ BigDecimal bigA = ((personPerform.get("A").divide(big100, BigDecimal.ROUND_HALF_UP, BigDecimal.ROUND_HALF_UP)).multiply(alls).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
+ bigsList.put("A", bigA);
|
|
|
+ BigDecimal bigB = ((personPerform.get("B").divide(big100, BigDecimal.ROUND_HALF_UP, BigDecimal.ROUND_HALF_UP)).multiply(alls).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
+ bigsList.put("B", bigB);
|
|
|
+ BigDecimal bigC = ((personPerform.get("C").divide(big100, BigDecimal.ROUND_HALF_UP, BigDecimal.ROUND_HALF_UP)).multiply(alls).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
+ bigsList.put("C", bigC);
|
|
|
+ BigDecimal bigD = ((personPerform.get("D").divide(big100, BigDecimal.ROUND_HALF_UP, BigDecimal.ROUND_HALF_UP)).multiply(alls).setScale(0, BigDecimal.ROUND_HALF_UP));
|
|
|
+ bigsList.put("D", bigD);
|
|
|
+ System.out.println("bigsList:"+bigsList);
|
|
|
+ //已占用数
|
|
|
+ BigDecimal lens = BigDecimal.ZERO;
|
|
|
+ //进行额度加减
|
|
|
+ //if ("S".equals(revLevel) || "A".equals(revLevel)||"B".equals(revLevel) || "C".equals(revLevel) || "D".equals(revLevel)) {
|
|
|
+ BigDecimal personSize = BigDecimal.ZERO;
|
|
|
+ BigDecimal personMaxSize = BigDecimal.ZERO;
|
|
|
+ BigDecimal personMinSize = BigDecimal.ZERO;
|
|
|
+ BigDecimal personMaxASize = BigDecimal.ZERO;
|
|
|
+ BigDecimal personMaxSSize = BigDecimal.ZERO;
|
|
|
+ BigDecimal personMinCSize = BigDecimal.ZERO;
|
|
|
+ BigDecimal personMinDSize = BigDecimal.ZERO;
|
|
|
+ BigDecimal personMinVSize = BigDecimal.ZERO;
|
|
|
+ List<String> ldrs = Lists.newArrayList();
|
|
|
+ Map<String,String> ldrcd = Maps.newHashMap();
|
|
|
+ switch (auditGradeLevel) {
|
|
|
+ case "A":
|
|
|
+ personSize = personSize.add(bigA).subtract(aLens);
|
|
|
+ lens = lens.add(aLens);
|
|
|
+ if ("A".equals(auditGradeLevel)) {
|
|
|
+ personMaxSize = personMaxSize.add((bigA));
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ personMaxSize = personMaxSize.add((bigA).subtract(aLens));
|
|
|
+ }
|
|
|
+ personMaxASize = new BigDecimal(personMaxSize.toPlainString());
|
|
|
+ ldrs.add("A最多"+personMaxASize.toPlainString()+"人,");
|
|
|
+ //bigsList.remove("A");
|
|
|
+ case "S":
|
|
|
+ personSize = personSize.add(bigS).subtract(sLens);
|
|
|
+ lens = lens.add(sLens);
|
|
|
+ if ("S".equals(auditGradeLevel)) {
|
|
|
+ personMaxSize = personMaxSize.add((bigS));
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ personMaxSize = personMaxSize.add((bigS).subtract(sLens));
|
|
|
+ }
|
|
|
+ personMaxSSize = new BigDecimal(personMaxSize.toPlainString());
|
|
|
+ ldrs.add("S最多"+personMaxSSize.toPlainString()+"人,");
|
|
|
+ //bigsList.remove("S");
|
|
|
+ case "B":
|
|
|
+ case "C":
|
|
|
+ personMinVSize=personMinVSize.add(bigC).subtract(cLens);
|
|
|
+ if ("C".equals(auditGradeLevel)) {
|
|
|
+ personMinSize = personMinSize.add((bigC));
|
|
|
+ } else {
|
|
|
+ personMinSize = personMinSize.add((bigC).subtract(cLens));
|
|
|
+ }
|
|
|
+ personMinCSize = new BigDecimal(bigC.toPlainString());
|
|
|
+ //bigsList.remove("C");
|
|
|
+ case "D":
|
|
|
+ personMinVSize=personMinVSize.add(bigD).subtract(dLens);
|
|
|
+ if ("D".equals(auditGradeLevel)) {
|
|
|
+ personMinSize = personMinSize.add((bigD));
|
|
|
+ } else {
|
|
|
+ personMinSize = personMinSize.add((bigD).subtract(dLens));
|
|
|
+ }
|
|
|
+ personMinDSize = new BigDecimal(bigD.add(bigC).toPlainString());
|
|
|
+ }
|
|
|
+ switch (auditGradeLevel) {
|
|
|
+ case "A":
|
|
|
+ case "S":
|
|
|
+ case "B":
|
|
|
+ ldrcd.put("C", "C最少" + (personMinCSize.compareTo(BigDecimal.ZERO) > 0 ? personMinCSize.toPlainString() : '0') + "人或者D最少" + (personMinDSize.compareTo(BigDecimal.ZERO) > 0 ? personMinDSize.toPlainString() : "0") + "人,");
|
|
|
+ break;
|
|
|
+ case "C":
|
|
|
+ ldrcd.put("C", "C最少" + (bigC.compareTo(BigDecimal.ZERO) > 0 ? bigC.toPlainString() : '0') + "人或者D最少" + (personMinDSize.compareTo(BigDecimal.ZERO) > 0 ? personMinDSize.toPlainString() : "0") + "人,");
|
|
|
+ break;
|
|
|
+ case "D":
|
|
|
+ ldrcd.put("D", "D最少" + bigD + "人,");
|
|
|
+ }
|
|
|
+ String ld = "当前周期绩效等级为%l的人数为%maxs人,";
|
|
|
+ if (personMinVSize.compareTo(BigDecimal.ZERO) > 0 || personSize.compareTo(BigDecimal.ZERO) < 0) {
|
|
|
+ if(ldrs.size()>0){
|
|
|
+ String ldrstr = ldrs.get(0);
|
|
|
+ ld += ldrstr;
|
|
|
+ ld = ld.replace("%" + auditGradeLevel, (personMaxSize.compareTo(BigDecimal.ZERO) > 0 ? (personMaxSize) : BigDecimal.ZERO).toPlainString());
|
|
|
+ }
|
|
|
+ ld = ld.replace("%l", auditGradeLevel);
|
|
|
+ ld = ld.replace("%maxs", (leveList.get(auditGradeLevel) == null ? BigDecimal.ZERO : leveList.get(auditGradeLevel)).toPlainString());
|
|
|
+
|
|
|
+ for (Map.Entry<String,String> entry : ldrcd.entrySet()) {
|
|
|
+ String eKey = entry.getKey();
|
|
|
+ String ldr= entry.getValue();
|
|
|
+ ld += ldr;
|
|
|
+ }
|
|
|
+ ld += "请修正后重新审核.";
|
|
|
+ batchMessage.put(fid, ld);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return batchMessage;
|
|
|
+ }
|
|
|
+
|
|
|
+ protected void verifyModel(HttpServletRequest request, HttpServletResponse response, CoreBaseInfo model) throws SHRWebException {
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
}
|