归档位置

new
JiilingLee 1 year ago
parent e46c996889
commit bf0f874a83

@ -6,6 +6,12 @@ import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.security.core.LoginUser; import cn.iocoder.yudao.framework.security.core.LoginUser;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils; import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.module.archives.controller.admin.common.CommonConstants; import cn.iocoder.yudao.module.archives.controller.admin.common.CommonConstants;
import cn.iocoder.yudao.module.setting.dal.dataobject.depot.DepotDO;
import cn.iocoder.yudao.module.setting.dal.dataobject.depotcabinet.DepotCabinetDO;
import cn.iocoder.yudao.module.setting.dal.dataobject.organization.OrganizationDO;
import cn.iocoder.yudao.module.setting.dal.mysql.depot.DepotMapper;
import cn.iocoder.yudao.module.setting.dal.mysql.depotcabinet.DepotCabinetMapper;
import cn.iocoder.yudao.module.setting.dal.mysql.organization.OrganizationMapper;
import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO; import cn.iocoder.yudao.module.system.dal.dataobject.dept.DeptDO;
import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO; import cn.iocoder.yudao.module.system.dal.dataobject.user.AdminUserDO;
import cn.iocoder.yudao.module.system.dal.mysql.dept.DeptMapper; import cn.iocoder.yudao.module.system.dal.mysql.dept.DeptMapper;
@ -42,6 +48,12 @@ public class RecordServiceImpl implements RecordService {
private AdminUserMapper userMapper; private AdminUserMapper userMapper;
@Resource @Resource
private DeptMapper deptMapper; private DeptMapper deptMapper;
@Resource
private OrganizationMapper organizationMapper;
@Resource
private DepotMapper depotMapper;
@Resource
private DepotCabinetMapper depotCabinetMapper;
@Override @Override
public Long createRecord(RecordCreateReqVO createReqVO) { public Long createRecord(RecordCreateReqVO createReqVO) {
@ -62,6 +74,28 @@ public class RecordServiceImpl implements RecordService {
} }
record.setCreateBy(adminUserDO.getNickname()); record.setCreateBy(adminUserDO.getNickname());
record.setFileStatus(CommonConstants.ARCHIVES_FILE_STATUS_START); record.setFileStatus(CommonConstants.ARCHIVES_FILE_STATUS_START);
//位置
Long organizationId = record.getOrganizationId();
Long depotId = record.getDepotId();
Long cabinetId = record.getCabinetId();
OrganizationDO organizationDO = organizationMapper.selectById(organizationId);
DepotDO depotDO = depotMapper.selectById(depotId);
DepotCabinetDO depotCabinetDO = depotCabinetMapper.selectById(cabinetId);
String position="";
if (organizationDO != null){
position=position+organizationDO.getOrganizationName();
if (depotDO != null){
position=position+"/"+depotDO.getName();
if (depotCabinetDO != null){
position= position+"/"+depotCabinetDO.getName();
}else {
position= position+"/默认档案柜";
}
}else {
position=position+"/默认库房/默认档案柜";
}
}
record.setSite(position);
recordMapper.insert(record); recordMapper.insert(record);
// 返回 // 返回
return record.getId(); return record.getId();
@ -73,6 +107,28 @@ public class RecordServiceImpl implements RecordService {
validateRecordExists(updateReqVO.getId()); validateRecordExists(updateReqVO.getId());
// 更新 // 更新
RecordDO updateObj = RecordConvert.INSTANCE.convert(updateReqVO); RecordDO updateObj = RecordConvert.INSTANCE.convert(updateReqVO);
//位置
Long organizationId = updateObj.getOrganizationId();
Long depotId = updateObj.getDepotId();
Long cabinetId = updateObj.getCabinetId();
OrganizationDO organizationDO = organizationMapper.selectById(organizationId);
DepotDO depotDO = depotMapper.selectById(depotId);
DepotCabinetDO depotCabinetDO = depotCabinetMapper.selectById(cabinetId);
String position="";
if (organizationDO != null){
position=position+organizationDO.getOrganizationName();
if (depotDO != null){
position=position+"/"+depotDO.getName();
if (depotCabinetDO != null){
position= position+"/"+depotCabinetDO.getName();
}else {
position= position+"/默认档案柜";
}
}else {
position=position+"/默认库房/默认档案柜";
}
}
updateObj.setSite(position);
recordMapper.updateById(updateObj); recordMapper.updateById(updateObj);
} }

Loading…
Cancel
Save