Merge branch '0.8.X' of http://49.232.154.205:10100/DeXun/klp-oa into 0.8.X
This commit is contained in:
@@ -402,18 +402,32 @@ public class WmsCoilPendingActionServiceImpl implements IWmsCoilPendingActionSer
|
||||
* 开始处理操作
|
||||
*/
|
||||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public Boolean startProcess(Long actionId) {
|
||||
WmsCoilPendingAction action = new WmsCoilPendingAction();
|
||||
action.setActionId(actionId);
|
||||
action.setActionStatus(1); // 处理中
|
||||
action.setProcessTime(new Date());
|
||||
// 1. 查询待操作记录
|
||||
WmsCoilPendingAction wmsCoilPendingAction = baseMapper.selectById(actionId);
|
||||
if (wmsCoilPendingAction == null) {
|
||||
throw new ServiceException("待操作记录不存在");
|
||||
}
|
||||
|
||||
// 2. 检查状态:已完成的操作不能再次开始
|
||||
if (wmsCoilPendingAction.getActionStatus() != null && wmsCoilPendingAction.getActionStatus() == 2) {
|
||||
throw new ServiceException("钢卷已被加工, 该操作已完成");
|
||||
}
|
||||
|
||||
// 3. 更新状态为处理中,并记录操作人和时间
|
||||
WmsCoilPendingAction updateAction = new WmsCoilPendingAction();
|
||||
updateAction.setActionId(actionId);
|
||||
updateAction.setActionStatus(1); // 处理中
|
||||
updateAction.setProcessTime(new Date());
|
||||
try {
|
||||
action.setOperatorId(LoginHelper.getUserId());
|
||||
action.setOperatorName(LoginHelper.getUsername());
|
||||
updateAction.setOperatorId(LoginHelper.getUserId());
|
||||
updateAction.setOperatorName(LoginHelper.getUsername());
|
||||
} catch (Exception e) {
|
||||
// 如果获取登录用户失败,不影响主流程
|
||||
}
|
||||
return baseMapper.updateById(action) > 0;
|
||||
|
||||
return baseMapper.updateById(updateAction) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user