| | |
| | | import com.vincent.rsf.server.system.utils.SerialRuleUtils; |
| | | import com.vincent.rsf.server.system.utils.SystemAuthUtils; |
| | | import lombok.Synchronized; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.slf4j.Logger; |
| | | import org.slf4j.LoggerFactory; |
| | |
| | | import java.util.*; |
| | | import java.util.stream.Collectors; |
| | | |
| | | @Slf4j |
| | | @Service("taskService") |
| | | public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task> implements TaskService { |
| | | |
| | |
| | | */ |
| | | @Synchronized |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void complateInTask(List<Task> tasks) throws Exception { |
| | | Long loginUserId = SystemAuthUtils.getLoginUserId(); |
| | | for (Task task : tasks) { |
| | | try { |
| | | if (task.getTaskType().equals(TaskType.TASK_TYPE_IN.type)) { |
| | | //1.入库 |
| | | complateInstock(task, loginUserId); |
| | |
| | | //移库 |
| | | moveInStock(task, loginUserId); |
| | | } |
| | | |
| | | } catch (Exception ex) { |
| | | log.error(ex.getMessage(), ex); |
| | | } |
| | | } |
| | | } |
| | | |
| | |
| | | */ |
| | | @Synchronized |
| | | @Override |
| | | @Transactional(rollbackFor = Exception.class) |
| | | public void completeTask(List<Task> tasks) { |
| | | Long loginUserId = SystemAuthUtils.getLoginUserId(); |
| | | for (Task task : tasks) { |
| | |
| | | try { |
| | | complateOutStock(task, loginUserId); |
| | | } catch (Exception e) { |
| | | throw new CoolException(e.getMessage()); |
| | | log.error(e.getMessage(), e); |
| | | // throw new CoolException(e.getMessage()); |
| | | } |
| | | } |
| | | } |