|
|
@@ -2,15 +2,20 @@ package com.kingdee.shr.perfweb.app.base.evalplan;
|
|
|
|
|
|
|
|
|
import com.google.common.base.Joiner;
|
|
|
+import com.google.common.collect.Sets;
|
|
|
import com.kingdee.bos.BOSException;
|
|
|
import com.kingdee.bos.Context;
|
|
|
import com.kingdee.bos.dao.IObjectPK;
|
|
|
+import com.kingdee.eas.base.netctrl.IMutexServiceControl;
|
|
|
+import com.kingdee.eas.base.netctrl.MutexServiceControlFactory;
|
|
|
+import com.kingdee.eas.hr.perf.handler.AreaBaseConfig;
|
|
|
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.exception.SHRWebException;
|
|
|
import com.kingdee.shr.base.syssetting.util.NetCtrlHelper;
|
|
|
+import com.kingdee.shr.base.syssetting.util.SHRCheck;
|
|
|
import com.kingdee.shr.perfweb.app.exception.SHRPerfWebBizException;
|
|
|
import com.kingdee.shr.perfweb.app.resource.SHRPerfWebResource;
|
|
|
import com.kingdee.shr.perfweb.util.GetEntityInfoUtils;
|
|
|
@@ -21,6 +26,8 @@ import com.kingdee.shr.perfweb.utils.PerfwebStrUtils;
|
|
|
import com.kingdee.shr.perfweb.utils.PerfwebThreadPoolUtils;
|
|
|
import com.kingdee.shr.perfweb.workflow.serviceImpl.WorkFlowEngine;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.slf4j.Logger;
|
|
|
+import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.mock.web.MockHttpServletRequest;
|
|
|
import org.springframework.mock.web.MockHttpServletResponse;
|
|
|
import org.springframework.mock.web.MockServletContext;
|
|
|
@@ -44,6 +51,19 @@ import java.util.concurrent.TimeUnit;
|
|
|
* version: 1.0 <br>
|
|
|
*/
|
|
|
public class GoalsTargetFacadeControllerBeanEx extends GoalsTargetFacadeControllerBean {
|
|
|
+ private static Logger logger = LoggerFactory.getLogger(GoalsTargetFacadeControllerBeanEx.class);
|
|
|
+
|
|
|
+ public final static String AREABASE ="HbulTDUkQBSS5kI9V4xZfIqoXbM=";
|
|
|
+ public static Set<String> getAreaBases(Context ctx) throws BOSException, SQLException {
|
|
|
+ Set<String> areaBases = Sets.newHashSet();
|
|
|
+ String sqlAreaBase = "select fid from T_EVA_EvaluFormAreaBase where fid =? or FRELATEDAREAID=?";
|
|
|
+ IRowSet rs = DbUtil.executeQuery(ctx,sqlAreaBase,new Object[]{AREABASE,AREABASE});
|
|
|
+ while (rs.next()){
|
|
|
+ String fid = rs.getString("fid");
|
|
|
+ areaBases.add(fid);
|
|
|
+ }
|
|
|
+ return areaBases;
|
|
|
+ }
|
|
|
/**
|
|
|
* 下单自动获取跨部门绩效等级
|
|
|
* @param ctx
|
|
|
@@ -55,164 +75,282 @@ public class GoalsTargetFacadeControllerBeanEx extends GoalsTargetFacadeControll
|
|
|
protected void _batchGoalsTransmitEx(Context ctx, Object evaObjIds, Object periodIds,Boolean isTransmit) throws BOSException {
|
|
|
IObjectPK userId = ctx.getCaller();
|
|
|
try {
|
|
|
- String areabaseId = "XpebMP4VRlmvZa3uIWF2WYqoXbM=";
|
|
|
+
|
|
|
+ Set<String> areaBases = this.getAreaBases(ctx);
|
|
|
//项目考核区域
|
|
|
System.out.println("com.kingdee.shr.perfweb.app.base.evalplan.GoalsTargetFacadeControllerBeanEx._batchGoalsTransmit");
|
|
|
IRowSet rowSet = DbUtil.executeQuery(ctx, "select peo.FPERSONID,pp.FPSTARTDATE,pp.FPENDDATE,pp.FCYCLETYPE from T_EVA_PerfEvaObject peo left join T_EVA_PerfPeriod pp on peo.FPERIODID=pp.fid where peo.FID = ?", new Object[]{evaObjIds});
|
|
|
if(rowSet.next()) {
|
|
|
- String getTable = "CT_PF_PerformanProjectPerson";
|
|
|
- String personid=rowSet.getString("FPERSONID");
|
|
|
- String cycletype=rowSet.getString("FCYCLETYPE");
|
|
|
- Date fpstartdate=rowSet.getDate("FPSTARTDATE");
|
|
|
- Date fpenddate=rowSet.getDate("FPENDDATE");
|
|
|
- SimpleDateFormat ssf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
- String pstartdate=ssf.format(fpstartdate);
|
|
|
- String penddate=ssf.format(fpenddate);
|
|
|
- String[] ps = new String[]{personid};
|
|
|
- IRowSet rsSose=null;
|
|
|
-
|
|
|
- StringBuilder sel1 = new StringBuilder();
|
|
|
- sel1.append(" select pp.FPERSONID from t_hr_personPosition pp ");
|
|
|
- sel1.append(" left join T_ORG_admin org on org.fid=pp.FPERSONDEP ");
|
|
|
- sel1.append(" left join T_Org_LayerType lt on lt.fid=org.FLAYERTYPEID ");
|
|
|
- sel1.append(" where lt.FNUMBER ='一级部门' and pp.FPERSONID=? ");
|
|
|
- rsSose = DbUtil.executeQuery(ctx,sel1.toString(),ps);
|
|
|
- if (rsSose.next()){
|
|
|
- getTable="CT_HR_PerformanProjectOne";
|
|
|
+ StringBuilder selectWSql= new StringBuilder("select isnull(FWEIGHT,0) FWEIGHT from T_EVA_IndicatorTarget where FAREABASEID in('' ");
|
|
|
+ for (String abid : areaBases){
|
|
|
+ selectWSql.append(",'");
|
|
|
+ selectWSql.append(abid);
|
|
|
+ selectWSql.append("'");
|
|
|
}
|
|
|
- StringBuilder sel2 = new StringBuilder();
|
|
|
- sel2.append(" select pp.FPERSONID from t_hr_personPosition pp ");
|
|
|
- sel2.append(" left join T_ORG_admin org on org.fid=pp.FPERSONDEP ");
|
|
|
- sel2.append(" left join T_Org_LayerType lt on lt.fid=org.FLAYERTYPEID ");
|
|
|
- sel2.append(" where lt.FNUMBER ='二级部门' and pp.FPERSONID=? ");
|
|
|
- rsSose = DbUtil.executeQuery(ctx,sel2.toString(),ps);
|
|
|
- if (rsSose.next()&&(!("CT_HR_PerformanProjectOne".equals(getTable)))){
|
|
|
- getTable="CT_HR_PerformanProjecttwo";
|
|
|
- }
|
|
|
- //周期月份
|
|
|
- if("400".equals(cycletype)) {
|
|
|
- StringBuilder performan = new StringBuilder();
|
|
|
- performan.append(" select CFPERPOJECTSUM from " + getTable);
|
|
|
- performan.append(" where CFPERSONID = ? and CFTIMETYPE = 2 and FBILLSTATE =3 ");
|
|
|
- performan.append(" and to_char(CFSTARTDATE,'yyyy-MM-dd') = ? and to_char(CFENDDATE,'yyyy-MM-dd') = ? ");
|
|
|
- System.out.println("performan400:"+performan);
|
|
|
- IRowSet rsPerf = DbUtil.executeQuery(ctx,performan.toString(),new String[]{personid,pstartdate,penddate});
|
|
|
- if (rsPerf.next()){
|
|
|
- BigDecimal perpojectSum = rsPerf.getBigDecimal("CFPERPOJECTSUM");
|
|
|
- StringBuilder performanLevel = new StringBuilder();
|
|
|
- performanLevel.append(" select pfld.FSYSPERFLEVEL from T_PER_PerfScoreLevel psl ");
|
|
|
- performanLevel.append(" left join T_PER_PerfScorLevelDefine pfld on psl.fid=pfld.FPERFSCORELEVELID ");
|
|
|
- performanLevel.append(" where psl.FSTATE='1' and pfld.FSCORELOWLIMIT<? and pfld.FSCOREUPLIMIT>=? ");
|
|
|
- System.out.println("performanLevel:"+performanLevel+",param:"+perpojectSum+","+perpojectSum);
|
|
|
- IRowSet rsLevel = DbUtil.executeQuery(ctx,performanLevel.toString(),new String[]{perpojectSum.toPlainString(),perpojectSum.toPlainString()});
|
|
|
- if (rsLevel.next()){
|
|
|
- String FSYSPERFLEVEL = rsLevel.getString("FSYSPERFLEVEL");
|
|
|
- Object[] params = new Object[]{FSYSPERFLEVEL,perpojectSum,areabaseId, evaObjIds, periodIds.toString()};
|
|
|
- System.out.println("FSYSPERFLEVEL:"+FSYSPERFLEVEL);
|
|
|
- DbUtil.execute(ctx, "update T_EVA_IndicatorTarget set FGRADE=?,FSCORE=? where FAREABASEID =? and FEVAOBJID=? and FPERFPERIODID=?", params);
|
|
|
- this.startGradeTargetInstAction(ctx,evaObjIds,periodIds,new Object[]{perpojectSum,FSYSPERFLEVEL,areabaseId,evaObjIds,periodIds.toString()});
|
|
|
- if(isTransmit) {
|
|
|
- this.startEvaTaskAction(ctx, periodIds.toString(), evaObjIds.toString());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //周期季度
|
|
|
- }else if("300".equals(cycletype)){
|
|
|
- StringBuilder performan = new StringBuilder();
|
|
|
- performan.append(" select CFPERPOJECTSUM from " + getTable);
|
|
|
- performan.append(" where CFPERSONID=? and CFTIMETYPE = 1 and FBILLSTATE =3 ");
|
|
|
- performan.append(" and to_char(CFSTARTDATE,'yyyy-MM-dd')=? and to_char(CFENDDATE,'yyyy-MM-dd') = ? ");
|
|
|
- IRowSet rsPerf = DbUtil.executeQuery(ctx,performan.toString(),new String[]{personid,pstartdate,penddate});
|
|
|
- if (rsPerf.next()){
|
|
|
- BigDecimal perpojectSum = rsPerf.getBigDecimal("CFPERPOJECTSUM");
|
|
|
- StringBuilder performanLevel = new StringBuilder();
|
|
|
- performanLevel.append(" select pfld.FSYSPERFLEVEL from T_PER_PerfScoreLevel psl ");
|
|
|
- performanLevel.append(" left join T_PER_PerfScorLevelDefine pfld on psl.fid=pfld.FPERFSCORELEVELID ");
|
|
|
- performanLevel.append(" where psl.FSTATE='1' and pfld.FSCORELOWLIMIT<? and pfld.FSCOREUPLIMIT>=? ");
|
|
|
- IRowSet rsLevel = DbUtil.executeQuery(ctx,performanLevel.toString(),new String[]{perpojectSum.toPlainString(),perpojectSum.toPlainString()});
|
|
|
- if (rsLevel.next()){
|
|
|
- String FSYSPERFLEVEL = rsLevel.getString("FSYSPERFLEVEL");
|
|
|
- Object[] params = new Object[]{FSYSPERFLEVEL,perpojectSum,areabaseId, evaObjIds, periodIds.toString()};
|
|
|
- DbUtil.execute(ctx, "update T_EVA_IndicatorTarget set FGRADE=?,FSCORE=? where FAREABASEID =? and FEVAOBJID=? and FPERFPERIODID=?", params);
|
|
|
- this.startGradeTargetInstAction(ctx,evaObjIds,periodIds,new Object[]{perpojectSum,FSYSPERFLEVEL,areabaseId,evaObjIds,periodIds.toString()});
|
|
|
- if(isTransmit) {
|
|
|
- this.startEvaTaskAction(ctx, periodIds.toString(), evaObjIds.toString());
|
|
|
- }
|
|
|
- }
|
|
|
- }else {
|
|
|
- //周期月份
|
|
|
- StringBuilder performan1 = new StringBuilder();
|
|
|
- performan1.append(" select (sum(CFPERPOJECTSUM)/count(fid)) CFPERPOJECTSUM from " + getTable);
|
|
|
- performan1.append(" where CFPERSONID=? and CFTIMETYPE = 2 and FBILLSTATE =3 ");
|
|
|
- performan1.append(" and to_char(CFSTARTDATE,'yyyy-MM-dd')=? and to_char(CFENDDATE,'yyyy-MM-dd') = ? ");
|
|
|
- performan1.append(" group by CFPERSONID ");
|
|
|
- IRowSet rsPerf1 = DbUtil.executeQuery(ctx,performan1.toString(),new String[]{personid,pstartdate,penddate});
|
|
|
- if (rsPerf1.next()){
|
|
|
- BigDecimal perpojectSum = rsPerf1.getBigDecimal("CFPERPOJECTSUM");
|
|
|
- StringBuilder performanLevel = new StringBuilder();
|
|
|
- performanLevel.append(" select pfld.FSYSPERFLEVEL from T_PER_PerfScoreLevel psl ");
|
|
|
- performanLevel.append(" left join T_PER_PerfScorLevelDefine pfld on psl.fid=pfld.FPERFSCORELEVELID ");
|
|
|
- performanLevel.append(" where psl.FSTATE='1' and pfld.FSCORELOWLIMIT<? and pfld.FSCOREUPLIMIT>=? ");
|
|
|
- IRowSet rsLevel = DbUtil.executeQuery(ctx,performanLevel.toString(),new String[]{perpojectSum.toPlainString(),perpojectSum.toPlainString()});
|
|
|
- if (rsLevel.next()){
|
|
|
- String FSYSPERFLEVEL = rsLevel.getString("FSYSPERFLEVEL");
|
|
|
- Object[] params = new Object[]{FSYSPERFLEVEL,perpojectSum,areabaseId, evaObjIds, periodIds.toString()};
|
|
|
- DbUtil.execute(ctx, "update T_EVA_IndicatorTarget set FGRADE=?,FSCORE=? where FAREABASEID =? and FEVAOBJID=? and FPERFPERIODID=?", params);
|
|
|
- this.startGradeTargetInstAction(ctx,evaObjIds,periodIds,new Object[]{perpojectSum,FSYSPERFLEVEL,areabaseId,evaObjIds,periodIds.toString()});
|
|
|
- if(isTransmit) {
|
|
|
- this.startEvaTaskAction(ctx, periodIds.toString(), evaObjIds.toString());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- //周期年度季度
|
|
|
- }else if("100".equals(cycletype)){
|
|
|
- StringBuilder performan = new StringBuilder();
|
|
|
- performan.append(" select CFPERPOJECTSUM from " + getTable);
|
|
|
- performan.append(" where CFPERSONID=? and CFTIMETYPE = 0 and FBILLSTATE =3 ");
|
|
|
- performan.append(" and to_char(CFSTARTDATE,'yyyy-MM-dd')=? and to_char(CFENDDATE,'yyyy-MM-dd') = ? ");
|
|
|
- IRowSet rsPerf = DbUtil.executeQuery(ctx,performan.toString(),new String[]{personid,pstartdate,penddate});
|
|
|
- if (rsPerf.next()){
|
|
|
- BigDecimal perpojectSum = rsPerf.getBigDecimal("CFPERPOJECTSUM");
|
|
|
- StringBuilder performanLevel = new StringBuilder();
|
|
|
- performanLevel.append(" select pfld.FSYSPERFLEVEL from T_PER_PerfScoreLevel psl ");
|
|
|
- performanLevel.append(" left join T_PER_PerfScorLevelDefine pfld on psl.fid=pfld.FPERFSCORELEVELID ");
|
|
|
- performanLevel.append(" where psl.FSTATE='1' and pfld.FSCORELOWLIMIT<? and pfld.FSCOREUPLIMIT>=? ");
|
|
|
- IRowSet rsLevel = DbUtil.executeQuery(ctx,performanLevel.toString(),new String[]{perpojectSum.toPlainString(),perpojectSum.toPlainString()});
|
|
|
- if (rsLevel.next()){
|
|
|
- String FSYSPERFLEVEL = rsLevel.getString("FSYSPERFLEVEL");
|
|
|
- Object[] params = new Object[]{FSYSPERFLEVEL,perpojectSum,areabaseId, evaObjIds, periodIds.toString()};
|
|
|
- DbUtil.execute(ctx, "update T_EVA_IndicatorTarget set FGRADE=?,FSCORE=? where FAREABASEID =? and FEVAOBJID=? and FPERFPERIODID=?", params);
|
|
|
- this.startGradeTargetInstAction(ctx,evaObjIds,periodIds,new Object[]{perpojectSum,FSYSPERFLEVEL,areabaseId,evaObjIds,periodIds.toString()});
|
|
|
- if(isTransmit) {
|
|
|
- this.startEvaTaskAction(ctx, periodIds.toString(), evaObjIds.toString());
|
|
|
- }
|
|
|
- }
|
|
|
- }else {
|
|
|
- //周期月份
|
|
|
- StringBuilder performan1 = new StringBuilder();
|
|
|
- performan1.append(" select (sum(CFPERPOJECTSUM)/count(fid)) CFPERPOJECTSUM from " + getTable);
|
|
|
- performan1.append(" where CFPERSONID=? and CFTIMETYPE = 2 and FBILLSTATE =3 ");
|
|
|
- performan1.append(" and to_char(CFSTARTDATE,'yyyy-MM-dd')=? and to_char(CFENDDATE,'yyyy-MM-dd') = ? ");
|
|
|
- performan1.append(" group by CFPERSONID ");
|
|
|
- IRowSet rsPerf1 = DbUtil.executeQuery(ctx,performan1.toString(),new String[]{personid,pstartdate,penddate});
|
|
|
- if (rsPerf1.next()){
|
|
|
- BigDecimal perpojectSum = rsPerf1.getBigDecimal("CFPERPOJECTSUM");
|
|
|
- StringBuilder performanLevel = new StringBuilder();
|
|
|
- performanLevel.append(" select pfld.FSYSPERFLEVEL from T_PER_PerfScoreLevel psl ");
|
|
|
- performanLevel.append(" left join T_PER_PerfScorLevelDefine pfld on psl.fid=pfld.FPERFSCORELEVELID ");
|
|
|
- performanLevel.append(" where psl.FSTATE='1' and pfld.FSCORELOWLIMIT<? and pfld.FSCOREUPLIMIT>=? ");
|
|
|
- IRowSet rsLevel = DbUtil.executeQuery(ctx,performanLevel.toString(),new String[]{perpojectSum.toPlainString(),perpojectSum.toPlainString()});
|
|
|
- if (rsLevel.next()){
|
|
|
- String FSYSPERFLEVEL = rsLevel.getString("FSYSPERFLEVEL");
|
|
|
- Object[] params = new Object[]{FSYSPERFLEVEL,perpojectSum,areabaseId, evaObjIds, periodIds.toString()};
|
|
|
- DbUtil.execute(ctx, "update T_EVA_IndicatorTarget set FGRADE=?,FSCORE=? where FAREABASEID =? and FEVAOBJID=? and FPERFPERIODID=?", params);
|
|
|
- this.startGradeTargetInstAction(ctx,evaObjIds,periodIds,new Object[]{perpojectSum,FSYSPERFLEVEL,areabaseId,evaObjIds,periodIds.toString()});
|
|
|
- if(isTransmit) {
|
|
|
- this.startEvaTaskAction(ctx, periodIds.toString(), evaObjIds.toString());
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
+ selectWSql.append(") and FEVAOBJID=? and FPERFPERIODID=? ");
|
|
|
+ IRowSet wRowSet = DbUtil.executeQuery(ctx,selectWSql.toString(),new Object[]{evaObjIds, periodIds.toString()});
|
|
|
+ if (wRowSet.next()){
|
|
|
+ BigDecimal FWEIGHT = wRowSet.getBigDecimal("FWEIGHT");
|
|
|
+ if(FWEIGHT.compareTo(BigDecimal.ZERO)>0){
|
|
|
+ String getTable = "CT_PF_PerformanProjectPerson";
|
|
|
+ String personid=rowSet.getString("FPERSONID");
|
|
|
+ String cycletype=rowSet.getString("FCYCLETYPE");
|
|
|
+ Date fpstartdate=rowSet.getDate("FPSTARTDATE");
|
|
|
+ Date fpenddate=rowSet.getDate("FPENDDATE");
|
|
|
+ SimpleDateFormat ssf = new SimpleDateFormat("yyyy-MM-dd");
|
|
|
+ String pstartdate=ssf.format(fpstartdate);
|
|
|
+ String penddate=ssf.format(fpenddate);
|
|
|
+ String[] ps = new String[]{personid};
|
|
|
+ IRowSet rsSose=null;
|
|
|
+
|
|
|
+ StringBuilder sel1 = new StringBuilder();
|
|
|
+ sel1.append(" select pp.FPERSONID from t_hr_personPosition pp ");
|
|
|
+ sel1.append(" left join T_ORG_admin org on org.fid=pp.FPERSONDEP ");
|
|
|
+ sel1.append(" left join T_Org_LayerType lt on lt.fid=org.FLAYERTYPEID ");
|
|
|
+ sel1.append(" where lt.FNUMBER ='\u4e00\u7ea7\u90e8\u95e8' and pp.FPERSONID=? ");
|
|
|
+ rsSose = DbUtil.executeQuery(ctx,sel1.toString(),ps);
|
|
|
+ if (rsSose.next()){
|
|
|
+ getTable="CT_HR_PerformanProjectOne";
|
|
|
+ }
|
|
|
+ StringBuilder sel2 = new StringBuilder();
|
|
|
+ sel2.append(" select pp.FPERSONID from t_hr_personPosition pp ");
|
|
|
+ sel2.append(" left join T_ORG_admin org on org.fid=pp.FPERSONDEP ");
|
|
|
+ sel2.append(" left join T_Org_LayerType lt on lt.fid=org.FLAYERTYPEID ");
|
|
|
+ sel2.append(" where lt.FNUMBER ='\u4e8c\u7ea7\u90e8\u95e8' and pp.FPERSONID=? ");
|
|
|
+ rsSose = DbUtil.executeQuery(ctx,sel2.toString(),ps);
|
|
|
+ if (rsSose.next()&&(!("CT_HR_PerformanProjectOne".equals(getTable)))){
|
|
|
+ getTable="CT_HR_PerformanProjecttwo";
|
|
|
+ }
|
|
|
+ //周期月份
|
|
|
+ if("400".equals(cycletype)) {
|
|
|
+ StringBuilder performan = new StringBuilder();
|
|
|
+ performan.append(" select CFPERPOJECTSUM from " + getTable);
|
|
|
+ performan.append(" where CFPERSONID = ? and CFPERIODTYPE = '\u6708\u5ea6' and FBILLSTATE =3 ");
|
|
|
+ performan.append(" and to_char(CFSTARTDATE,'yyyy-MM-dd') = ? and to_char(CFENDDATE,'yyyy-MM-dd') = ? ");
|
|
|
+ System.out.println("performan400:"+performan);
|
|
|
+ IRowSet rsPerf = DbUtil.executeQuery(ctx,performan.toString(),new String[]{personid,pstartdate,penddate});
|
|
|
+ if (rsPerf.next()){
|
|
|
+ BigDecimal perpojectSum = rsPerf.getBigDecimal("CFPERPOJECTSUM");
|
|
|
+ StringBuilder performanLevel = new StringBuilder();
|
|
|
+ performanLevel.append(" select pfld.FSYSPERFLEVEL from T_PER_PerfScoreLevel psl ");
|
|
|
+ performanLevel.append(" left join T_PER_PerfScorLevelDefine pfld on psl.fid=pfld.FPERFSCORELEVELID ");
|
|
|
+ performanLevel.append(" where psl.FSTATE='1' and pfld.FSCORELOWLIMIT<? and pfld.FSCOREUPLIMIT>=? ");
|
|
|
+ System.out.println("performanLevel:"+performanLevel+",param:"+perpojectSum+","+perpojectSum);
|
|
|
+ IRowSet rsLevel = DbUtil.executeQuery(ctx,performanLevel.toString(),new String[]{perpojectSum.toPlainString(),perpojectSum.toPlainString()});
|
|
|
+ if (rsLevel.next()){
|
|
|
+ String FSYSPERFLEVEL = rsLevel.getString("FSYSPERFLEVEL");
|
|
|
+ Object[] params = new Object[]{FSYSPERFLEVEL,perpojectSum, evaObjIds, periodIds.toString()};
|
|
|
+ System.out.println("params:"+Arrays.toString(params));
|
|
|
+ StringBuilder updateSql= new StringBuilder("update T_EVA_IndicatorTarget set FGRADE=?,FSCORE=? where FAREABASEID in('' ");
|
|
|
+ StringBuilder selectSql= new StringBuilder("select FEXTENDID from T_EVA_IndicatorTarget where FAREABASEID in('' ");
|
|
|
+ for (String abid : areaBases){
|
|
|
+ updateSql.append(",'");
|
|
|
+ updateSql.append(abid);
|
|
|
+ updateSql.append("'");
|
|
|
+ selectSql.append(",'");
|
|
|
+ selectSql.append(abid);
|
|
|
+ selectSql.append("'");
|
|
|
+ }
|
|
|
+ updateSql.append(") and FEVAOBJID=? and FPERFPERIODID=? ");
|
|
|
+ selectSql.append(") and FEVAOBJID=? and FPERFPERIODID=? ");
|
|
|
+ StringBuilder updateHelperSql = new StringBuilder();
|
|
|
+ updateHelperSql.append("update T_EVA_IndicatorExtendHelper set FEXTEND3=? where fid in(");
|
|
|
+ updateHelperSql.append(selectSql);
|
|
|
+ updateHelperSql.append(" ) ");
|
|
|
+ DbUtil.execute(ctx,updateHelperSql.toString(), new Object[]{FSYSPERFLEVEL, evaObjIds, periodIds.toString()});
|
|
|
+ DbUtil.execute(ctx,updateSql.toString(), params);
|
|
|
+ this.startGradeTargetInstAction(ctx,evaObjIds,periodIds,areaBases,new Object[]{perpojectSum,FSYSPERFLEVEL,evaObjIds,periodIds.toString()});
|
|
|
+ System.out.println("isTransmit:"+isTransmit);
|
|
|
+ if(isTransmit) {
|
|
|
+ this.startEvaTaskAction(ctx, periodIds.toString(), evaObjIds.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //周期季度
|
|
|
+ }else if("300".equals(cycletype)){
|
|
|
+ StringBuilder performan = new StringBuilder();
|
|
|
+ performan.append(" select CFPERPOJECTSUM from " + getTable);
|
|
|
+ performan.append(" where CFPERSONID=? and CFPERIODTYPE = '\u5b63\u5ea6' and FBILLSTATE =3 ");
|
|
|
+ performan.append(" and to_char(CFSTARTDATE,'yyyy-MM-dd')=? and to_char(CFENDDATE,'yyyy-MM-dd') = ? ");
|
|
|
+ IRowSet rsPerf = DbUtil.executeQuery(ctx,performan.toString(),new String[]{personid,pstartdate,penddate});
|
|
|
+ if (rsPerf.next()){
|
|
|
+ BigDecimal perpojectSum = rsPerf.getBigDecimal("CFPERPOJECTSUM");
|
|
|
+ StringBuilder performanLevel = new StringBuilder();
|
|
|
+ performanLevel.append(" select pfld.FSYSPERFLEVEL from T_PER_PerfScoreLevel psl ");
|
|
|
+ performanLevel.append(" left join T_PER_PerfScorLevelDefine pfld on psl.fid=pfld.FPERFSCORELEVELID ");
|
|
|
+ performanLevel.append(" where psl.FSTATE='1' and pfld.FSCORELOWLIMIT<? and pfld.FSCOREUPLIMIT>=? ");
|
|
|
+ IRowSet rsLevel = DbUtil.executeQuery(ctx,performanLevel.toString(),new String[]{perpojectSum.toPlainString(),perpojectSum.toPlainString()});
|
|
|
+ if (rsLevel.next()){
|
|
|
+ String FSYSPERFLEVEL = rsLevel.getString("FSYSPERFLEVEL");
|
|
|
+// Object[] params = new Object[]{FSYSPERFLEVEL,perpojectSum,areabaseId, evaObjIds, periodIds.toString()};
|
|
|
+// DbUtil.execute(ctx, "update T_EVA_IndicatorTarget set FGRADE=?,FSCORE=? where FAREABASEID =? and FEVAOBJID=? and FPERFPERIODID=?",
|
|
|
+// params);
|
|
|
+ Object[] params = new Object[]{FSYSPERFLEVEL,perpojectSum, evaObjIds, periodIds.toString()};
|
|
|
+ System.out.println("params:"+Arrays.toString(params));
|
|
|
+ StringBuilder updateSql= new StringBuilder("update T_EVA_IndicatorTarget set FGRADE=?,FSCORE=? where FAREABASEID in('' ");
|
|
|
+ StringBuilder selectSql= new StringBuilder("select FEXTENDID from T_EVA_IndicatorTarget where FAREABASEID in('' ");
|
|
|
+ for (String abid : areaBases){
|
|
|
+ updateSql.append(",'");
|
|
|
+ updateSql.append(abid);
|
|
|
+ updateSql.append("'");
|
|
|
+ selectSql.append(",'");
|
|
|
+ selectSql.append(abid);
|
|
|
+ selectSql.append("'");
|
|
|
+ }
|
|
|
+ updateSql.append(") and FEVAOBJID=? and FPERFPERIODID=? ");
|
|
|
+ selectSql.append(") and FEVAOBJID=? and FPERFPERIODID=? ");
|
|
|
+ StringBuilder updateHelperSql = new StringBuilder();
|
|
|
+ updateHelperSql.append("update T_EVA_IndicatorExtendHelper set FEXTEND3=? where fid in(");
|
|
|
+ updateHelperSql.append(selectSql);
|
|
|
+ updateHelperSql.append(" ) ");
|
|
|
+ DbUtil.execute(ctx,updateHelperSql.toString(), new Object[]{FSYSPERFLEVEL, evaObjIds, periodIds.toString()});
|
|
|
+ DbUtil.execute(ctx,updateSql.toString(), params);
|
|
|
+ this.startGradeTargetInstAction(ctx,evaObjIds,periodIds,areaBases,new Object[]{perpojectSum,FSYSPERFLEVEL,evaObjIds,periodIds.toString()});
|
|
|
+ System.out.println("isTransmit:"+isTransmit);
|
|
|
+ if(isTransmit) {
|
|
|
+ this.startEvaTaskAction(ctx, periodIds.toString(), evaObjIds.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //周期月份
|
|
|
+ StringBuilder performan1 = new StringBuilder();
|
|
|
+ performan1.append(" select (sum(CFPERPOJECTSUM)/count(fid)) CFPERPOJECTSUM from " + getTable);
|
|
|
+ performan1.append(" where CFPERSONID=? and CFPERIODTYPE = '\u6708\u5ea6' and FBILLSTATE =3 ");
|
|
|
+ performan1.append(" and to_char(CFSTARTDATE,'yyyy-MM-dd')=? and to_char(CFENDDATE,'yyyy-MM-dd') = ? ");
|
|
|
+ performan1.append(" group by CFPERSONID ");
|
|
|
+ IRowSet rsPerf1 = DbUtil.executeQuery(ctx,performan1.toString(),new String[]{personid,pstartdate,penddate});
|
|
|
+ if (rsPerf1.next()){
|
|
|
+ BigDecimal perpojectSum = rsPerf1.getBigDecimal("CFPERPOJECTSUM");
|
|
|
+ StringBuilder performanLevel = new StringBuilder();
|
|
|
+ performanLevel.append(" select pfld.FSYSPERFLEVEL from T_PER_PerfScoreLevel psl ");
|
|
|
+ performanLevel.append(" left join T_PER_PerfScorLevelDefine pfld on psl.fid=pfld.FPERFSCORELEVELID ");
|
|
|
+ performanLevel.append(" where psl.FSTATE='1' and pfld.FSCORELOWLIMIT<? and pfld.FSCOREUPLIMIT>=? ");
|
|
|
+ IRowSet rsLevel = DbUtil.executeQuery(ctx,performanLevel.toString(),new String[]{perpojectSum.toPlainString(),perpojectSum.toPlainString()});
|
|
|
+ if (rsLevel.next()){
|
|
|
+ String FSYSPERFLEVEL = rsLevel.getString("FSYSPERFLEVEL");
|
|
|
+ Object[] params = new Object[]{FSYSPERFLEVEL,perpojectSum, evaObjIds, periodIds.toString()};
|
|
|
+ System.out.println("params:"+Arrays.toString(params));
|
|
|
+ StringBuilder updateSql= new StringBuilder("update T_EVA_IndicatorTarget set FGRADE=?,FSCORE=? where FAREABASEID in('' ");
|
|
|
+ StringBuilder selectSql= new StringBuilder("select FEXTENDID from T_EVA_IndicatorTarget where FAREABASEID in('' ");
|
|
|
+ for (String abid : areaBases){
|
|
|
+ updateSql.append(",'");
|
|
|
+ updateSql.append(abid);
|
|
|
+ updateSql.append("'");
|
|
|
+ selectSql.append(",'");
|
|
|
+ selectSql.append(abid);
|
|
|
+ selectSql.append("'");
|
|
|
+ }
|
|
|
+ updateSql.append(") and FEVAOBJID=? and FPERFPERIODID=? ");
|
|
|
+ selectSql.append(") and FEVAOBJID=? and FPERFPERIODID=? ");
|
|
|
+ StringBuilder updateHelperSql = new StringBuilder();
|
|
|
+ updateHelperSql.append("update T_EVA_IndicatorExtendHelper set FEXTEND3=? where fid in(");
|
|
|
+ updateHelperSql.append(selectSql);
|
|
|
+ updateHelperSql.append(" ) ");
|
|
|
+ DbUtil.execute(ctx,updateHelperSql.toString(), new Object[]{FSYSPERFLEVEL, evaObjIds, periodIds.toString()});
|
|
|
+ DbUtil.execute(ctx,updateSql.toString(), params);
|
|
|
+ this.startGradeTargetInstAction(ctx,evaObjIds,periodIds,areaBases,new Object[]{perpojectSum,FSYSPERFLEVEL,evaObjIds,periodIds.toString()});
|
|
|
+ System.out.println("isTransmit:"+isTransmit);
|
|
|
+ if(isTransmit) {
|
|
|
+ this.startEvaTaskAction(ctx, periodIds.toString(), evaObjIds.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ //周期年度季度
|
|
|
+ }else if("100".equals(cycletype)){
|
|
|
+ StringBuilder performan = new StringBuilder();
|
|
|
+ performan.append(" select CFPERPOJECTSUM from " + getTable);
|
|
|
+ performan.append(" where CFPERSONID=? and CFPERIODTYPE = '\u5e74\u5ea6' and FBILLSTATE =3 ");
|
|
|
+ performan.append(" and to_char(CFSTARTDATE,'yyyy-MM-dd')=? and to_char(CFENDDATE,'yyyy-MM-dd') = ? ");
|
|
|
+ IRowSet rsPerf = DbUtil.executeQuery(ctx,performan.toString(),new String[]{personid,pstartdate,penddate});
|
|
|
+ if (rsPerf.next()){
|
|
|
+ BigDecimal perpojectSum = rsPerf.getBigDecimal("CFPERPOJECTSUM");
|
|
|
+ StringBuilder performanLevel = new StringBuilder();
|
|
|
+ performanLevel.append(" select pfld.FSYSPERFLEVEL from T_PER_PerfScoreLevel psl ");
|
|
|
+ performanLevel.append(" left join T_PER_PerfScorLevelDefine pfld on psl.fid=pfld.FPERFSCORELEVELID ");
|
|
|
+ performanLevel.append(" where psl.FSTATE='1' and pfld.FSCORELOWLIMIT<? and pfld.FSCOREUPLIMIT>=? ");
|
|
|
+ IRowSet rsLevel = DbUtil.executeQuery(ctx,performanLevel.toString(),new String[]{perpojectSum.toPlainString(),perpojectSum.toPlainString()});
|
|
|
+ if (rsLevel.next()){
|
|
|
+ String FSYSPERFLEVEL = rsLevel.getString("FSYSPERFLEVEL");
|
|
|
+ Object[] params = new Object[]{FSYSPERFLEVEL,perpojectSum, evaObjIds, periodIds.toString()};
|
|
|
+ System.out.println("params:"+Arrays.toString(params));
|
|
|
+ StringBuilder updateSql= new StringBuilder("update T_EVA_IndicatorTarget set FGRADE=?,FSCORE=? where FAREABASEID in('' ");
|
|
|
+ StringBuilder selectSql= new StringBuilder("select FEXTENDID from T_EVA_IndicatorTarget where FAREABASEID in('' ");
|
|
|
+ for (String abid : areaBases){
|
|
|
+ updateSql.append(",'");
|
|
|
+ updateSql.append(abid);
|
|
|
+ updateSql.append("'");
|
|
|
+ selectSql.append(",'");
|
|
|
+ selectSql.append(abid);
|
|
|
+ selectSql.append("'");
|
|
|
+ }
|
|
|
+ updateSql.append(") and FEVAOBJID=? and FPERFPERIODID=? ");
|
|
|
+ selectSql.append(") and FEVAOBJID=? and FPERFPERIODID=? ");
|
|
|
+ StringBuilder updateHelperSql = new StringBuilder();
|
|
|
+ updateHelperSql.append("update T_EVA_IndicatorExtendHelper set FEXTEND3=? where fid in(");
|
|
|
+ updateHelperSql.append(selectSql);
|
|
|
+ updateHelperSql.append(" ) ");
|
|
|
+ DbUtil.execute(ctx,updateHelperSql.toString(), new Object[]{FSYSPERFLEVEL, evaObjIds, periodIds.toString()});
|
|
|
+ this.startGradeTargetInstAction(ctx,evaObjIds,periodIds,areaBases,new Object[]{perpojectSum,FSYSPERFLEVEL,evaObjIds,periodIds.toString()});
|
|
|
+ System.out.println("isTransmit:"+isTransmit);
|
|
|
+ if(isTransmit) {
|
|
|
+ this.startEvaTaskAction(ctx, periodIds.toString(), evaObjIds.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ //周期月份
|
|
|
+ StringBuilder performan1 = new StringBuilder();
|
|
|
+ performan1.append(" select (sum(CFPERPOJECTSUM)/count(fid)) CFPERPOJECTSUM from " + getTable);
|
|
|
+ performan1.append(" where CFPERSONID=? and CFPERIODTYPE = '\u6708\u5ea6' and FBILLSTATE =3 ");
|
|
|
+ performan1.append(" and to_char(CFSTARTDATE,'yyyy-MM-dd')=? and to_char(CFENDDATE,'yyyy-MM-dd') = ? ");
|
|
|
+ performan1.append(" group by CFPERSONID ");
|
|
|
+ IRowSet rsPerf1 = DbUtil.executeQuery(ctx,performan1.toString(),new String[]{personid,pstartdate,penddate});
|
|
|
+ if (rsPerf1.next()){
|
|
|
+ BigDecimal perpojectSum = rsPerf1.getBigDecimal("CFPERPOJECTSUM");
|
|
|
+ StringBuilder performanLevel = new StringBuilder();
|
|
|
+ performanLevel.append(" select pfld.FSYSPERFLEVEL from T_PER_PerfScoreLevel psl ");
|
|
|
+ performanLevel.append(" left join T_PER_PerfScorLevelDefine pfld on psl.fid=pfld.FPERFSCORELEVELID ");
|
|
|
+ performanLevel.append(" where psl.FSTATE='1' and pfld.FSCORELOWLIMIT<? and pfld.FSCOREUPLIMIT>=? ");
|
|
|
+ IRowSet rsLevel = DbUtil.executeQuery(ctx,performanLevel.toString(),new String[]{perpojectSum.toPlainString(),perpojectSum.toPlainString()});
|
|
|
+ if (rsLevel.next()){
|
|
|
+ String FSYSPERFLEVEL = rsLevel.getString("FSYSPERFLEVEL");
|
|
|
+ Object[] params = new Object[]{FSYSPERFLEVEL,perpojectSum, evaObjIds, periodIds.toString()};
|
|
|
+ System.out.println("params:"+Arrays.toString(params));
|
|
|
+ StringBuilder updateSql= new StringBuilder("update T_EVA_IndicatorTarget set FGRADE=?,FSCORE=? where FAREABASEID in('' ");
|
|
|
+ StringBuilder selectSql= new StringBuilder("select FEXTENDID from T_EVA_IndicatorTarget where FAREABASEID in('' ");
|
|
|
+ for (String abid : areaBases){
|
|
|
+ updateSql.append(",'");
|
|
|
+ updateSql.append(abid);
|
|
|
+ updateSql.append("'");
|
|
|
+ selectSql.append(",'");
|
|
|
+ selectSql.append(abid);
|
|
|
+ selectSql.append("'");
|
|
|
+ }
|
|
|
+ updateSql.append(") and FEVAOBJID=? and FPERFPERIODID=? ");
|
|
|
+ selectSql.append(") and FEVAOBJID=? and FPERFPERIODID=? ");
|
|
|
+ StringBuilder updateHelperSql = new StringBuilder();
|
|
|
+ updateHelperSql.append("update T_EVA_IndicatorExtendHelper set FEXTEND3=? where fid in(");
|
|
|
+ updateHelperSql.append(selectSql);
|
|
|
+ updateHelperSql.append(" ) ");
|
|
|
+ DbUtil.execute(ctx,updateHelperSql.toString(), new Object[]{FSYSPERFLEVEL, evaObjIds, periodIds.toString()});
|
|
|
+ DbUtil.execute(ctx,updateSql.toString(), params);
|
|
|
+ this.startGradeTargetInstAction(ctx,evaObjIds,periodIds,areaBases,new Object[]{perpojectSum,FSYSPERFLEVEL,evaObjIds,periodIds.toString()});
|
|
|
+ System.out.println("isTransmit:"+isTransmit);
|
|
|
+ if(isTransmit) {
|
|
|
+ this.startEvaTaskAction(ctx, periodIds.toString(), evaObjIds.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if(isTransmit) {
|
|
|
+ this.startEvaTaskAction(ctx, periodIds.toString(), evaObjIds.toString());
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }else {
|
|
|
+ if(isTransmit) {
|
|
|
+ this.startEvaTaskAction(ctx, periodIds.toString(), evaObjIds.toString());
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -225,20 +363,35 @@ public class GoalsTargetFacadeControllerBeanEx extends GoalsTargetFacadeControll
|
|
|
* 更新评估表的跨部门组织绩效等级,分数
|
|
|
*/
|
|
|
class startGradeTargetInst implements Runnable{
|
|
|
- Context ctx; Object evaObjIds; Object periodIds;Object[] params;
|
|
|
+ private Context ctx;
|
|
|
+ private Object evaObjIds;
|
|
|
+ private Object periodIds;
|
|
|
+ private Set<String> areaBases;
|
|
|
+ private Object[] params;
|
|
|
|
|
|
- public startGradeTargetInst(Context ctx, Object evaObjIds, Object periodIds, Object[] params) {
|
|
|
+ public startGradeTargetInst(Context ctx, Object evaObjIds, Object periodIds,Set<String> areaBases, Object[] params) {
|
|
|
this.ctx = ctx;
|
|
|
this.evaObjIds = evaObjIds;
|
|
|
this.periodIds = periodIds;
|
|
|
+ this.areaBases = areaBases;
|
|
|
this.params = params;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
public void run() {
|
|
|
try {
|
|
|
- String update = "update T_EVA_GradeTargetInst set FTARGETSCORE=?, FGRADERANK=? where FAREABASEID=? and FGradeTaskNodeID in(select fid from T_EVA_GradeTaskNodeInst where FEVAOBJID=? and FPERIODID=?)";
|
|
|
- DbUtil.execute(this.ctx,update,this.params);
|
|
|
+// String update = "update T_EVA_GradeTargetInst set FTARGETSCORE=?, FGRADERANK=? where FAREABASEID=? and " +
|
|
|
+// "FGradeTaskNodeID in(select fid from T_EVA_GradeTaskNodeInst where FEVAOBJID=? and FPERIODID=?)";
|
|
|
+// DbUtil.execute(this.ctx,update,this.params);
|
|
|
+ StringBuilder updateSql= new StringBuilder("update T_EVA_GradeTargetInst set FTARGETSCORE=?, FGRADERANK=? where FAREABASEID in('' ");
|
|
|
+ for (String abid : areaBases){
|
|
|
+ updateSql.append(",'");
|
|
|
+ updateSql.append(abid);
|
|
|
+ updateSql.append("'");
|
|
|
+ }
|
|
|
+ updateSql.append(") and FGradeTaskNodeID in(select fid from T_EVA_GradeTaskNodeInst where FEVAOBJID=? and FPERIODID=?) ");
|
|
|
+ DbUtil.execute(this.ctx,updateSql.toString(),this.params);
|
|
|
} catch (BOSException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
@@ -253,56 +406,84 @@ public class GoalsTargetFacadeControllerBeanEx extends GoalsTargetFacadeControll
|
|
|
* @param params
|
|
|
* @throws BOSException
|
|
|
*/
|
|
|
- protected void startGradeTargetInstAction(Context ctx, Object evaObjIds, Object periodIds,Object[] params) throws BOSException {
|
|
|
+ protected void startGradeTargetInstAction(Context ctx, Object evaObjIds, Object periodIds,Set<String> areaBases,Object[] params) throws BOSException {
|
|
|
ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(1);
|
|
|
- scheduledThreadPoolExecutor.schedule(new startGradeTargetInst(ctx,evaObjIds,periodIds,params), 3, TimeUnit.MINUTES);
|
|
|
+ scheduledThreadPoolExecutor.schedule(new startGradeTargetInst(ctx,evaObjIds,periodIds,areaBases,params), 15, TimeUnit.SECONDS);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
protected void _batchGoalsTransmit(Context ctx, Object evaObjIds, Object periodIds) throws BOSException {
|
|
|
- super._batchGoalsTransmit(ctx,evaObjIds,periodIds);
|
|
|
Boolean isTransmit = (Boolean) ctx.get("com.kingdee.shr.perfweb.app.base.evalplan.GoalsTargetFacadeControllerBeanEx.isTransmit");
|
|
|
if(null==isTransmit){
|
|
|
isTransmit=Boolean.TRUE;
|
|
|
}
|
|
|
+ if(isTransmit) {
|
|
|
+ super._batchGoalsTransmit(ctx, evaObjIds, periodIds);
|
|
|
+ }
|
|
|
this._batchGoalsTransmitEx(ctx,evaObjIds,periodIds,isTransmit);
|
|
|
}
|
|
|
|
|
|
|
|
|
- public void startEvaTaskAction(Context ctx,String periodId,String billId) throws SHRWebException {
|
|
|
+ public void startEvaTaskAction(Context ctx,String periodId,String billId) throws Exception {
|
|
|
try {
|
|
|
+ System.out.println("startEvaTaskAction:periodId:"+periodId+",billId:"+billId);
|
|
|
ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(1);
|
|
|
scheduledThreadPoolExecutor.schedule(()->{
|
|
|
try {
|
|
|
MockHttpServletRequest request = new MockHttpServletRequest();
|
|
|
MockHttpServletResponse response = new MockHttpServletResponse();
|
|
|
request.setParameter("period", periodId);
|
|
|
- request.setParameter("billId", billId);
|
|
|
+ StringBuilder sql = new StringBuilder("select (fid||'$'||FWORKFLOWID) as wfid from T_EVA_PerfEvaObject where fid in(''");
|
|
|
+ sql.append(",'");
|
|
|
+ sql.append(billId);
|
|
|
+ sql.append("'");
|
|
|
+ sql.append(")");
|
|
|
+ IRowSet rs = DbUtil.executeQuery(ctx, sql.toString());
|
|
|
+ String wbillId="";
|
|
|
+ while (rs.next()) {
|
|
|
+ wbillId=rs.getString("wfid");
|
|
|
+ request.setParameter("billId", wbillId);
|
|
|
+ }
|
|
|
+ System.out.println("startEvaTaskAction:periodId:"+periodId+",wbillId:"+wbillId);
|
|
|
ModelMap modelMap = new ModelMap();
|
|
|
BatchMessageTipsHeader batchMessageTipsHeader = new BatchMessageTipsHeader();
|
|
|
this.startEvaTaskAction(ctx,request, response, modelMap, batchMessageTipsHeader);
|
|
|
- } catch (SHRWebException e) {
|
|
|
+ } catch (Exception e) {
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
- }, 1, TimeUnit.MINUTES);
|
|
|
+ }, 10, TimeUnit.SECONDS);
|
|
|
}catch (Exception e){
|
|
|
e.printStackTrace();
|
|
|
}
|
|
|
}
|
|
|
- public void startEvaTaskAction(Context ctx,HttpServletRequest request, HttpServletResponse response, ModelMap modelMap, BatchMessageTipsHeader batchMessageTipsHeader) throws SHRWebException {
|
|
|
+ public static final Map batchRequestObjIDForUpdate(Context ctx,List dataList) throws BOSException {
|
|
|
+ IMutexServiceControl mutexService = MutexServiceControlFactory.getLocalInstance(ctx);
|
|
|
+ String userName = ctx.getUserName();
|
|
|
+ Map map = mutexService.batchRequestObjIDForUpdate(dataList);
|
|
|
+ logger.info("NetCtrlService........dataId :" + SHRCheck.vaildLog(dataList.toString()) + ";userName," + userName + " request net ctrl " + map.toString());
|
|
|
+ return map;
|
|
|
+ }
|
|
|
+ public static final void batchReleaseObjIDForUpdate(Context ctx,List dataList) throws BOSException {
|
|
|
+ IMutexServiceControl mutexService = MutexServiceControlFactory.getLocalInstance(ctx);
|
|
|
+ mutexService.batchReleaseObjIDForUpdate(dataList);
|
|
|
+ }
|
|
|
+ public void startEvaTaskAction(Context ctx,HttpServletRequest request, HttpServletResponse response, ModelMap modelMap, BatchMessageTipsHeader batchMessageTipsHeader) throws Exception {
|
|
|
+ System.out.println("startEvaTaskAction:batchMessageTipsHeader:"+batchMessageTipsHeader);
|
|
|
String period = request.getParameter("period");
|
|
|
PerfPeriodInfo periodInfo = GetEntityInfoUtils.getPerfPeriodInfo(ctx, period);
|
|
|
if (periodInfo.getEvaPeriodStatus().getValue() == 100) {
|
|
|
- throw new SHRWebException(new SHRPerfWebBizException(SHRPerfWebBizException.OPERATENOTALLOWEDASPERIODISEND));
|
|
|
+ throw new Exception(new SHRPerfWebBizException(SHRPerfWebBizException.OPERATENOTALLOWEDASPERIODISEND));
|
|
|
} else {
|
|
|
Map<String, Set<String>> evaObjMap = new HashMap();
|
|
|
Map<String, Set<String>> evaObjAreaMap = new HashMap();
|
|
|
List<String> idList = this.getEvaObjIdsByDealIds(request, evaObjMap, evaObjAreaMap);
|
|
|
+ System.out.println("startEvaTaskAction:idList:"+idList);
|
|
|
List<String> avilableIdList = new ArrayList(16);
|
|
|
HashSet failedSet = new HashSet();
|
|
|
|
|
|
try {
|
|
|
- Map<String, Boolean> idMap = NetCtrlHelper.batchRequestObjIDForUpdate(idList);
|
|
|
+ Map<String, Boolean> idMap = batchRequestObjIDForUpdate(ctx,idList);
|
|
|
+ System.out.println("startEvaTaskAction:idMap:"+idMap);
|
|
|
Iterator var14 = idList.iterator();
|
|
|
|
|
|
while(true) {
|
|
|
@@ -373,7 +554,7 @@ public class GoalsTargetFacadeControllerBeanEx extends GoalsTargetFacadeControll
|
|
|
if (flag) {
|
|
|
String result = WorkFlowEngine.getInstance().createAsignmentPool(ctx, Joiner.on(",").join(evaObjArr), period);
|
|
|
if (!ServerResponseConst.SUCCESS.equals(result)) {
|
|
|
- throw new SHRWebException(new SHRPerfWebBizException(SHRPerfWebBizException.SYSTEMERR));
|
|
|
+ throw new Exception(new SHRPerfWebBizException(SHRPerfWebBizException.SYSTEMERR));
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -389,7 +570,7 @@ public class GoalsTargetFacadeControllerBeanEx extends GoalsTargetFacadeControll
|
|
|
e.printStackTrace();
|
|
|
} finally {
|
|
|
try {
|
|
|
- NetCtrlHelper.batchReleaseObjIDForUpdate(idList);
|
|
|
+ batchReleaseObjIDForUpdate(ctx,idList);
|
|
|
} catch (BOSException e) {
|
|
|
e.printStackTrace();
|
|
|
}
|