diff --git a/src/com/engine/jclpoc/web/PocPerformanceController.java b/src/com/engine/jclpoc/web/PocPerformanceController.java index ba8bf5c..b14a4f3 100644 --- a/src/com/engine/jclpoc/web/PocPerformanceController.java +++ b/src/com/engine/jclpoc/web/PocPerformanceController.java @@ -37,7 +37,7 @@ public class PocPerformanceController { rs.executeQuery("select * from uf_360pjhd_dt2 where mainid = ? and bpr = ? and sfpjwc = 1 and df is not null", hdId, bpr); int count = 0; double sum = 0; - if (rs.next()) { + while (rs.next()) { count++; sum += rs.getDouble("df"); } diff --git a/src/weaver/interfaces/poc/action/UpdatePerformanceLevelsAction.java b/src/weaver/interfaces/poc/action/UpdatePerformanceLevelsAction.java new file mode 100644 index 0000000..67bc753 --- /dev/null +++ b/src/weaver/interfaces/poc/action/UpdatePerformanceLevelsAction.java @@ -0,0 +1,60 @@ +package weaver.interfaces.poc.action; + +import weaver.conn.RecordSet; +import weaver.general.BaseBean; +import weaver.interfaces.workflow.action.Action; +import weaver.soa.workflow.request.*; + +import java.util.HashMap; +import java.util.Map; + +/** + * @author:dxfeng + * @createTime: 2024/05/10 + * @version: 1.0 + */ +public class UpdatePerformanceLevelsAction implements Action { + @Override + public String execute(RequestInfo requestInfo) { + BaseBean baseBean = new BaseBean(); + try { + Map mainDataMap = new HashMap<>(); + MainTableInfo mainTableInfo = requestInfo.getMainTableInfo(); + Property[] properties = mainTableInfo.getProperty(); + for (Property property : properties) { + mainDataMap.put(property.getName(), property.getValue()); + } + // 绩效活动 + String jxhd = mainDataMap.get("jxhd"); + + DetailTableInfo detailTableInfo = requestInfo.getDetailTableInfo(); + // 明细表二 + DetailTable detailTable1 = detailTableInfo.getDetailTable(1); + String updateSql = "update uf_khfa set khdj = ? where requestId is null and jxhd = ? and khzzdf = ? and xm = ?"; + RecordSet rs = new RecordSet(); + Row[] rows = detailTable1.getRow(); + for (Row row : rows) { + Map detailMap = new HashMap<>(); + Cell[] cells = row.getCell(); + for (Cell cell : cells) { + detailMap.put(cell.getName(), cell.getValue()); + } + String khzzdf = detailMap.get("khzzdf"); + String xm = detailMap.get("ryxm"); + String khdj = detailMap.get("khdj"); + baseBean.writeLog("khdj==" + khdj); + baseBean.writeLog("jxhd==" + jxhd); + baseBean.writeLog("khzzdf==" + khzzdf); + baseBean.writeLog("xm==" + xm); + // 更新考核方案表登记 + rs.executeUpdate(updateSql, khdj, jxhd, khzzdf, xm); + } + return SUCCESS; + } catch (Exception e) { + baseBean.writeLog(e); + return FAILURE_AND_CONTINUE; + } + } + + +}