晶测 问题流程BUG处理

This commit is contained in:
dxfeng 2025-05-16 15:08:59 +08:00
parent cf7eaa5936
commit 4a77c173c1
1 changed files with 40 additions and 1 deletions

View File

@ -20,6 +20,13 @@ import java.util.Map;
public class RecruitCheckStaffAction implements Action {
@Override
public String execute(RequestInfo requestInfo) {
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
Property[] properties = mainTableInfo.getProperty();
Map<String,String> mainDataMap = new HashMap<>();
for (Property property : properties) {
mainDataMap.put(property.getName(),property.getValue());
}
DetailTableInfo detailTableInfo = requestInfo.getDetailTableInfo();
DetailTable detailTable = detailTableInfo.getDetailTable(0);
@ -34,7 +41,7 @@ public class RecruitCheckStaffAction implements Action {
// 校验当前明细行的数据是否满足编制要求不满足则返回错误信息
String szbm = detailMap.get("szbm");
String zprs = detailMap.get("zprs");
checkDepartmentStaff(szbm, Convert.toInt(zprs, 0));
checkDepartmentStaff(szbm, Convert.toInt(zprs, 0),mainDataMap.get("nd"));
}
} catch (CustomizeRunTimeException e) {
requestInfo.getRequestManager().setMessagecontent(e.getMessage());
@ -77,4 +84,36 @@ public class RecruitCheckStaffAction implements Action {
throw new CustomizeRunTimeException("[" + departmentMark + "]未查询到编制信息,请检查编制数据");
}
}
public static boolean checkDepartmentStaff(String departmentId, int staffNum,String year) {
RecordSet rs = new RecordSet();
rs.writeLog("departmentId==" + departmentId);
rs.writeLog("staffNum==" + staffNum);
rs.writeLog("year==" + year);
DepartmentComInfo departmentComInfo = new DepartmentComInfo();
String departmentMark = departmentComInfo.getDepartmentmark(departmentId);
if (StringUtils.isBlank(departmentMark)) {
departmentMark = departmentId;
}
rs.executeQuery("select a.id, a.staff_num , permanent_num , freeze_num from jcl_org_staff a inner join jcl_org_staffplan b on a.plan_id = b.id and b.plan_year =? and b.control_dimension = 2 and a.delete_type = 0 and b.delete_type = 0 where a.ec_department = ? ", year, departmentId);
int counts = rs.getCounts();
if (counts > 1) {
throw new CustomizeRunTimeException("[" + departmentMark + "]查询到多个编制信息,请检查编制数据");
}
if (rs.next()) {
int staffNumLimit = Convert.toInt(rs.getString("staff_num"), 0);
int permanentNumLimit = Convert.toInt(rs.getString("permanent_num"), 0);
int freezeNumLimit = Convert.toInt(rs.getString("freeze_num"), 0);
// 编制数-在编数-冻结数-招聘人数如果小于0则不满足编制要求
int checkNum = staffNumLimit - permanentNumLimit - freezeNumLimit - staffNum;
if (checkNum < 0) {
throw new CustomizeRunTimeException("[" + departmentMark + "]招聘人数超出剩余编制数,请检查招聘数据");
}
return true;
} else {
throw new CustomizeRunTimeException("[" + departmentMark + "]未查询到编制信息,请检查编制数据");
}
}
}