The concurrency problem of moving the order of list data up and down

there are Sort sort value fields in the data table, and the table is sorted according to the sort value increment, as shown in figure

.

realize the conversion of position according to the sort value of exchanging the upper and lower pieces of data

but the problem now is that if there are many individual operations moving the order of the data table at the same time,

the order and sort values will be disrupted, what should I do?

Mar.23,2021

first of all, I don't think this problem seems to be a technical one. In terms of business, is it reasonable for many people to order their operations at the same time? Should the sorting function be devolved to specialized personnel?
if we have to solve this problem technically, for example, Zhang San swapped 1Magazine 2 and Li Si swapped 1 and 3, then what is the final order? Should there be a set of business rules?
then reconsider: 1, Zhang San in the operation, lock other people's operation, other people can not operate 2, Zhang San operation is completed, others see Zhang San's operation results in real time. So this system involves real-time information interaction between front and rear, is it overdesigned?
it is recommended that the subject consider whether to communicate again as appropriate.

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e8f975-126f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e8f975-126f.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?