|
|
@ -11,12 +11,14 @@ import com.engine.organization.entity.DeleteParam;
|
|
|
|
import com.engine.organization.entity.staff.bo.StaffBO;
|
|
|
|
import com.engine.organization.entity.staff.bo.StaffBO;
|
|
|
|
import com.engine.organization.entity.staff.param.StaffSearchParam;
|
|
|
|
import com.engine.organization.entity.staff.param.StaffSearchParam;
|
|
|
|
import com.engine.organization.entity.staff.po.StaffPO;
|
|
|
|
import com.engine.organization.entity.staff.po.StaffPO;
|
|
|
|
|
|
|
|
import com.engine.organization.entity.staff.po.StaffsPO;
|
|
|
|
import com.engine.organization.entity.staff.vo.StaffTableVO;
|
|
|
|
import com.engine.organization.entity.staff.vo.StaffTableVO;
|
|
|
|
import com.engine.organization.mapper.comp.CompMapper;
|
|
|
|
import com.engine.organization.mapper.comp.CompMapper;
|
|
|
|
import com.engine.organization.mapper.department.DepartmentMapper;
|
|
|
|
import com.engine.organization.mapper.department.DepartmentMapper;
|
|
|
|
import com.engine.organization.mapper.job.JobMapper;
|
|
|
|
import com.engine.organization.mapper.job.JobMapper;
|
|
|
|
import com.engine.organization.mapper.staff.StaffMapper;
|
|
|
|
import com.engine.organization.mapper.staff.StaffMapper;
|
|
|
|
import com.engine.organization.mapper.staff.StaffPlanMapper;
|
|
|
|
import com.engine.organization.mapper.staff.StaffPlanMapper;
|
|
|
|
|
|
|
|
import com.engine.organization.mapper.staff.StaffsMapper;
|
|
|
|
import com.engine.organization.service.StaffService;
|
|
|
|
import com.engine.organization.service.StaffService;
|
|
|
|
import com.engine.organization.util.*;
|
|
|
|
import com.engine.organization.util.*;
|
|
|
|
import com.engine.organization.util.db.DBType;
|
|
|
|
import com.engine.organization.util.db.DBType;
|
|
|
@ -89,8 +91,25 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public int updateStaff(StaffSearchParam param) {
|
|
|
|
public int updateStaff(StaffSearchParam param) {
|
|
|
|
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
HasRightUtil.hasRight(user, RIGHT_NAME, false);
|
|
|
|
StaffPO staffPlanPO = StaffBO.convertParamToPO(param, (long) user.getUID());
|
|
|
|
StaffPO staffByID = getStaffMapper().getStaffByID(param.getId());
|
|
|
|
return getStaffMapper().updateStaff(staffPlanPO);
|
|
|
|
StaffPO staffPO = StaffBO.convertParamToPO(param, (long) user.getUID());
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Integer changeNum = param.getChangeNum();
|
|
|
|
|
|
|
|
if (null == changeNum) {
|
|
|
|
|
|
|
|
// 插入明细表数据
|
|
|
|
|
|
|
|
StaffsPO staffsPO = StaffsPO.builder().staffId(staffPO.getId()).businessType(1).changeNum(staffPO.getStaffNum() - staffByID.getStaffNum()).businessSource(1).build();
|
|
|
|
|
|
|
|
MapperProxyFactory.getProxy(StaffsMapper.class).insertIgnoreNull(staffsPO);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
// 插入明细表数据
|
|
|
|
|
|
|
|
StaffsPO staffsPO = StaffsPO.builder().staffId(staffPO.getId()).businessType(2).changeNum(changeNum).businessSource(1).build();
|
|
|
|
|
|
|
|
MapperProxyFactory.getProxy(StaffsMapper.class).insertIgnoreNull(staffsPO);
|
|
|
|
|
|
|
|
// 更新编制表
|
|
|
|
|
|
|
|
staffPO.setStaffNum(staffPO.getStaffNum() + changeNum);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
StaffBO.buildStaffDesc(staffPO);
|
|
|
|
|
|
|
|
// 更新主表
|
|
|
|
|
|
|
|
return getStaffMapper().updateStaff(staffPO);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -183,6 +202,9 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|
|
|
SearchConditionItem controlPolicyItem = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, "控制策略", "controlPolicy");
|
|
|
|
SearchConditionItem controlPolicyItem = OrganizationFormItemUtil.selectItem(user, selectOptions, 2, 16, 6, false, "控制策略", "controlPolicy");
|
|
|
|
controlPolicyItem.setViewAttr(3);
|
|
|
|
controlPolicyItem.setViewAttr(3);
|
|
|
|
controlPolicyItem.setRules("required|string");
|
|
|
|
controlPolicyItem.setRules("required|string");
|
|
|
|
|
|
|
|
SearchConditionItem descriptionItem = OrganizationFormItemUtil.textareaItem(user, 2, 16, true, 2, 60, "描述说明", "description");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 编辑状态下赋值操作
|
|
|
|
// 编辑状态下赋值操作
|
|
|
|
String id = Util.null2String(params.get("id"));
|
|
|
|
String id = Util.null2String(params.get("id"));
|
|
|
@ -196,22 +218,23 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|
|
|
planIdItem.setBrowserConditionParam(planIdItemBean);
|
|
|
|
planIdItem.setBrowserConditionParam(planIdItemBean);
|
|
|
|
|
|
|
|
|
|
|
|
BrowserBean compIdItemBean = compIdItem.getBrowserConditionParam();
|
|
|
|
BrowserBean compIdItemBean = compIdItem.getBrowserConditionParam();
|
|
|
|
List<Map<String, Object>> compIdMaps = getCompMapper().listCompsByIds(DeleteParam.builder().ids(staffPO.getPlanId().toString()).build().getIds());
|
|
|
|
List<Map<String, Object>> compIdMaps = getCompMapper().listCompsByIds(DeleteParam.builder().ids(staffPO.getCompId().toString()).build().getIds());
|
|
|
|
compIdItemBean.setReplaceDatas(compIdMaps);
|
|
|
|
compIdItemBean.setReplaceDatas(compIdMaps);
|
|
|
|
compIdItem.setBrowserConditionParam(compIdItemBean);
|
|
|
|
compIdItem.setBrowserConditionParam(compIdItemBean);
|
|
|
|
|
|
|
|
|
|
|
|
BrowserBean deptIdItemBean = deptIdItem.getBrowserConditionParam();
|
|
|
|
BrowserBean deptIdItemBean = deptIdItem.getBrowserConditionParam();
|
|
|
|
List<Map<String, Object>> deptIdMaps = getDepartmentMapper().listDeptsByIds(DeleteParam.builder().ids(staffPO.getPlanId().toString()).build().getIds());
|
|
|
|
List<Map<String, Object>> deptIdMaps = getDepartmentMapper().listDeptsByIds(DeleteParam.builder().ids(staffPO.getDeptId().toString()).build().getIds());
|
|
|
|
deptIdItemBean.setReplaceDatas(deptIdMaps);
|
|
|
|
deptIdItemBean.setReplaceDatas(deptIdMaps);
|
|
|
|
deptIdItem.setBrowserConditionParam(deptIdItemBean);
|
|
|
|
deptIdItem.setBrowserConditionParam(deptIdItemBean);
|
|
|
|
|
|
|
|
|
|
|
|
BrowserBean jobIdItemBean = jobIdItem.getBrowserConditionParam();
|
|
|
|
BrowserBean jobIdItemBean = jobIdItem.getBrowserConditionParam();
|
|
|
|
List<Map<String, Object>> jobIdMaps = getJobMapper().listJobsByIds(DeleteParam.builder().ids(staffPO.getPlanId().toString()).build().getIds());
|
|
|
|
List<Map<String, Object>> jobIdMaps = getJobMapper().listJobsByIds(DeleteParam.builder().ids(staffPO.getJobId().toString()).build().getIds());
|
|
|
|
jobIdItemBean.setReplaceDatas(jobIdMaps);
|
|
|
|
jobIdItemBean.setReplaceDatas(jobIdMaps);
|
|
|
|
jobIdItem.setBrowserConditionParam(jobIdItemBean);
|
|
|
|
jobIdItem.setBrowserConditionParam(jobIdItemBean);
|
|
|
|
|
|
|
|
|
|
|
|
staffNumItem.setValue(staffPO.getStaffNum());
|
|
|
|
staffNumItem.setValue(staffPO.getStaffNum());
|
|
|
|
controlPolicyItem.setValue(staffPO.getControlPolicy());
|
|
|
|
controlPolicyItem.setValue(staffPO.getControlPolicy()+"");
|
|
|
|
|
|
|
|
descriptionItem.setValue(staffPO.getDescription());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
selectItems.add(planIdItem);
|
|
|
|
selectItems.add(planIdItem);
|
|
|
|
selectItems.add(compIdItem);
|
|
|
|
selectItems.add(compIdItem);
|
|
|
@ -219,6 +242,14 @@ public class StaffServiceImpl extends Service implements StaffService {
|
|
|
|
selectItems.add(jobIdItem);
|
|
|
|
selectItems.add(jobIdItem);
|
|
|
|
selectItems.add(staffNumItem);
|
|
|
|
selectItems.add(staffNumItem);
|
|
|
|
selectItems.add(controlPolicyItem);
|
|
|
|
selectItems.add(controlPolicyItem);
|
|
|
|
|
|
|
|
selectItems.add(descriptionItem);
|
|
|
|
|
|
|
|
String operateType = (String)params.get("operateType");
|
|
|
|
|
|
|
|
if ("2".equals(operateType)) {
|
|
|
|
|
|
|
|
selectItems.forEach(item->item.setViewAttr(1));
|
|
|
|
|
|
|
|
SearchConditionItem changeNumItem = OrganizationFormItemUtil.inputNumberItem(user, 2, 16, 3, "调整数量", "changeNum");
|
|
|
|
|
|
|
|
staffNumItem.setRules("required");
|
|
|
|
|
|
|
|
selectItems.add(changeNumItem);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
|
|
|
|
addGroups.add(new SearchConditionGroup("基本信息", true, selectItems));
|
|
|
|
apiDatas.put("condition", addGroups);
|
|
|
|
apiDatas.put("condition", addGroups);
|
|
|
|