|
|
|
@ -40,7 +40,8 @@ public class StaffChangeAction implements Action {
|
|
|
|
|
@Override
|
|
|
|
|
public String execute(RequestInfo requestInfo) {
|
|
|
|
|
if (StringUtils.isBlank(changeType)) {
|
|
|
|
|
return "编制调整失败,未配置对应调整方式";
|
|
|
|
|
requestInfo.getRequestManager().setMessagecontent("编制调整失败,未配置对应调整方式!");
|
|
|
|
|
return FAILURE_AND_CONTINUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Integer requestId = Integer.parseInt(requestInfo.getRequestid());
|
|
|
|
@ -53,9 +54,9 @@ public class StaffChangeAction implements Action {
|
|
|
|
|
MainTableInfo mainTableInfo = requestInfo.getMainTableInfo();
|
|
|
|
|
Property[] property = mainTableInfo.getProperty();
|
|
|
|
|
// 取表单数据赋值
|
|
|
|
|
for (int i = 0; i < property.length; i++) {
|
|
|
|
|
String name = property[i].getName();
|
|
|
|
|
String value = Util.null2String(property[i].getValue());
|
|
|
|
|
for (Property item : property) {
|
|
|
|
|
String name = item.getName();
|
|
|
|
|
String value = Util.null2String(item.getValue());
|
|
|
|
|
if (StringUtils.isNotBlank(name) && StringUtils.isNotBlank(value)) {
|
|
|
|
|
switch (name) {
|
|
|
|
|
case "fb": // 分部
|
|
|
|
@ -77,10 +78,12 @@ public class StaffChangeAction implements Action {
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
if (null == changeNum) {
|
|
|
|
|
return "编制变动数必填";
|
|
|
|
|
requestInfo.getRequestManager().setMessagecontent("编制变动数必填!");
|
|
|
|
|
return FAILURE_AND_CONTINUE;
|
|
|
|
|
}
|
|
|
|
|
if (changeNum < 0) {
|
|
|
|
|
return "编制变动数需大于0";
|
|
|
|
|
requestInfo.getRequestManager().setMessagecontent("编制变动数需大于0!");
|
|
|
|
|
return FAILURE_AND_CONTINUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// 根据分部、部门、岗位 定位具体编制信息,按照更新时间倒序,取最新的一条数据
|
|
|
|
@ -93,32 +96,37 @@ public class StaffChangeAction implements Action {
|
|
|
|
|
switch (changeType) {
|
|
|
|
|
case "3":// 冻结,比如招聘中,面试中,入职办理中等
|
|
|
|
|
if (staffPO.getFreezeNum() + changeNum > staffNum) {
|
|
|
|
|
return "冻结数不能大于编制数";
|
|
|
|
|
requestInfo.getRequestManager().setMessagecontent("冻结数不能大于编制数!");
|
|
|
|
|
return FAILURE_AND_CONTINUE;
|
|
|
|
|
}
|
|
|
|
|
// 设置冻结数
|
|
|
|
|
staffPO.setFreezeNum(staffPO.getFreezeNum() + changeNum);
|
|
|
|
|
break;
|
|
|
|
|
case "4":// 冻结释放,比如面试不通过,offer不接受等
|
|
|
|
|
if (changeNum > staffPO.getFreezeNum()) {
|
|
|
|
|
return "调整不能大于冻结数";
|
|
|
|
|
requestInfo.getRequestManager().setMessagecontent("冻结释放数不能大于冻结数!");
|
|
|
|
|
return FAILURE_AND_CONTINUE;
|
|
|
|
|
}
|
|
|
|
|
staffPO.setFreezeNum(staffPO.getFreezeNum() - changeNum);
|
|
|
|
|
break;
|
|
|
|
|
case "5":// 扣减,比如正式入职,调入等
|
|
|
|
|
staffPO.setPermanentNum(staffPO.getPermanentNum() + changeNum);
|
|
|
|
|
if (staffPO.getPermanentNum() > staffPO.getStaffNum()) {
|
|
|
|
|
return "在编数不能大于编制数";
|
|
|
|
|
requestInfo.getRequestManager().setMessagecontent("在编数不能大于编制数!");
|
|
|
|
|
return FAILURE_AND_CONTINUE;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case "6":// 减员释放,比如离职、调出等
|
|
|
|
|
staffPO.setPermanentNum(staffPO.getPermanentNum() - changeNum);
|
|
|
|
|
if (staffPO.getPermanentNum() < 0) {
|
|
|
|
|
return "调整数量不可大于在编数";
|
|
|
|
|
requestInfo.getRequestManager().setMessagecontent("调整数量不可大于在编数!");
|
|
|
|
|
return FAILURE_AND_CONTINUE;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case "1":// 编制
|
|
|
|
|
case "2":// 变更
|
|
|
|
|
default:
|
|
|
|
|
requestInfo.getRequestManager().setMessagecontent("流程操作事件changeType配置错误,请联系管理员!");
|
|
|
|
|
return FAILURE_AND_CONTINUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -142,7 +150,7 @@ public class StaffChangeAction implements Action {
|
|
|
|
|
// new Thread(new StaffTriggerRunnable(staffPO)).start();
|
|
|
|
|
return SUCCESS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
requestInfo.getRequestManager().setMessagecontent("未找到对应维度的编制信息!");
|
|
|
|
|
return FAILURE_AND_CONTINUE;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|