Commit da38b03d authored by 赵啸非's avatar 赵啸非

修改员工部门选择信息

parent acdc81a7
......@@ -109,7 +109,6 @@
>
</el-switch>
</div>
</div>
<Field
label="所属部门"
......@@ -120,6 +119,7 @@
placeholder="请选择所属部门"
/>
</div>
<form-buttons
@submit="submitForm"
noCancelBtn
......
......@@ -113,14 +113,31 @@ public class StaffServiceImpl extends AbstractCRUDCacheServiceImpl<StaffDao, Sta
// return "1000"+data.getWorkNum();
}
@Override
protected void updateBefore(StaffEntity entity, Context context) throws AppException {
super.updateBefore(entity, context);
if(!ObjectUtils.isEmpty(entity.getDeptId())){
DeptEntity deptEntity = deptService.get(entity.getDeptId());
entity.setDeptName(deptEntity==null?"":deptEntity.getDeptName());
}
}
@Override
protected void saveBefore(StaffEntity entity, Context context) throws AppException {
int count = this.count(new StaffQuery().workNum(entity.getWorkNum()), context);
if (count > 0) {
throw new AppException("工号重复!工号:" + entity.getWorkNum());
}
if(!ObjectUtils.isEmpty(entity.getDeptId())){
DeptEntity deptEntity = deptService.get(entity.getDeptId());
entity.setDeptName(deptEntity==null?"":deptEntity.getDeptName());
}
}
@Override
public StaffInfoVo queryAll(Context context) {
StaffInfoVo staffInfoVo = new StaffInfoVo();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment