退货单和一些小修改
This commit is contained in:
parent
5432392a39
commit
a718b7537c
@ -5,6 +5,7 @@ import cn.hutool.core.collection.CollectionUtil;
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import cn.iocoder.yudao.common.RecordTypeEnum;
|
||||
import cn.iocoder.yudao.common.RepairErrorCodeConstants;
|
||||
import cn.iocoder.yudao.common.RepairRoleEnum;
|
||||
import cn.iocoder.yudao.common.SoStatusEnum;
|
||||
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
|
||||
import cn.iocoder.yudao.module.base.service.RepairRecordsService;
|
||||
@ -144,6 +145,12 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
||||
}
|
||||
}
|
||||
|
||||
// 如果没有选择操作的人就取当前操作人
|
||||
if (ObjectUtil.isEmpty(repairSoRespVO.getUserId())) {
|
||||
repairSoRespVO.setUserId(SecurityFrameworkUtils.getLoginUserId());
|
||||
repairSoRespVO.setUserName(SecurityFrameworkUtils.getLoginUserNickname());
|
||||
}
|
||||
|
||||
// 新增主表
|
||||
// 如果是采购单,就把状态变为部分入库
|
||||
if (repairSoRespVO.getSoType() != null && repairSoRespVO.getSoType().equals("01")) {
|
||||
@ -187,14 +194,20 @@ public class DlRepairSoServiceImpl extends ServiceImpl<DlRepairSoMapper, DlRepai
|
||||
@Override
|
||||
@DSTransactional
|
||||
public void voidRepairSo(DlRepairSoReqVO repairSoReqVO) {
|
||||
int update = baseMapper.update(new LambdaUpdateWrapper<DlRepairSo>()
|
||||
.set(DlRepairSo::getSoStatus, SoStatusEnum.DEPRECATED.getCode())
|
||||
.and(i ->
|
||||
i.eq(DlRepairSo::getId, repairSoReqVO.getId())
|
||||
.ne(DlRepairSo::getSoStatus, SoStatusEnum.DEPRECATED.getCode())
|
||||
.ne(DlRepairSo::getSoStatus, SoStatusEnum.PICKED.getCode())
|
||||
.ne(DlRepairSo::getSoStatus, SoStatusEnum.RETURNED.getCode())
|
||||
));
|
||||
LambdaUpdateWrapper<DlRepairSo> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.set(DlRepairSo::getSoStatus, SoStatusEnum.DEPRECATED.getCode());
|
||||
String userRole = ticketsService.getUserRole();
|
||||
if (RepairRoleEnum.WAREHOUSE.getCode().equals(userRole)) {
|
||||
wrapper.eq(DlRepairSo::getId, repairSoReqVO.getId());
|
||||
} else {
|
||||
wrapper.and(i ->
|
||||
i.eq(DlRepairSo::getId, repairSoReqVO.getId())
|
||||
.ne(DlRepairSo::getSoStatus, SoStatusEnum.DEPRECATED.getCode())
|
||||
.ne(DlRepairSo::getSoStatus, SoStatusEnum.PICKED.getCode())
|
||||
.ne(DlRepairSo::getSoStatus, SoStatusEnum.RETURNED.getCode())
|
||||
);
|
||||
}
|
||||
int update = baseMapper.update(wrapper);
|
||||
if (update == 0) {
|
||||
throw exception0(500, "该单据已有其他人操作");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user