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
|
@Override
|
||||||
|
@Transactional(rollbackFor = Exception.class)
|
||||||
public Boolean startProcess(Long actionId) {
|
public Boolean startProcess(Long actionId) {
|
||||||
WmsCoilPendingAction action = new WmsCoilPendingAction();
|
// 1. 查询待操作记录
|
||||||
action.setActionId(actionId);
|
WmsCoilPendingAction wmsCoilPendingAction = baseMapper.selectById(actionId);
|
||||||
action.setActionStatus(1); // 处理中
|
if (wmsCoilPendingAction == null) {
|
||||||
action.setProcessTime(new Date());
|
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 {
|
try {
|
||||||
action.setOperatorId(LoginHelper.getUserId());
|
updateAction.setOperatorId(LoginHelper.getUserId());
|
||||||
action.setOperatorName(LoginHelper.getUsername());
|
updateAction.setOperatorName(LoginHelper.getUsername());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
// 如果获取登录用户失败,不影响主流程
|
// 如果获取登录用户失败,不影响主流程
|
||||||
}
|
}
|
||||||
return baseMapper.updateById(action) > 0;
|
|
||||||
|
return baseMapper.updateById(updateAction) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user