|
|
|
@ -35,7 +35,7 @@ import java.util.Map;
|
|
|
|
|
* queue service |
|
|
|
|
*/ |
|
|
|
|
@Service |
|
|
|
|
public class QueueService extends BaseService{ |
|
|
|
|
public class QueueService extends BaseService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
@ -55,20 +55,21 @@ public class QueueService extends BaseService{
|
|
|
|
|
|
|
|
|
|
List<Queue> queueList = queueMapper.queryAllQueue(); |
|
|
|
|
result.put(Constants.DATA_LIST, queueList); |
|
|
|
|
putMsg(result,Status.SUCCESS); |
|
|
|
|
putMsg(result, Status.SUCCESS); |
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* query queue list paging |
|
|
|
|
* |
|
|
|
|
* @param loginUser |
|
|
|
|
* @param searchVal |
|
|
|
|
* @param pageNo |
|
|
|
|
* @param pageSize |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
public Map<String, Object> queryList(User loginUser,String searchVal, Integer pageNo, Integer pageSize) { |
|
|
|
|
public Map<String, Object> queryList(User loginUser, String searchVal, Integer pageNo, Integer pageSize) { |
|
|
|
|
Map<String, Object> result = new HashMap<>(5); |
|
|
|
|
if (checkAdmin(loginUser, result)) { |
|
|
|
|
return result; |
|
|
|
@ -76,29 +77,42 @@ public class QueueService extends BaseService{
|
|
|
|
|
|
|
|
|
|
Integer count = queueMapper.countQueuePaging(searchVal); |
|
|
|
|
|
|
|
|
|
PageInfo<Queue> pageInfo = new PageInfo<>(pageNo,pageSize); |
|
|
|
|
PageInfo<Queue> pageInfo = new PageInfo<>(pageNo, pageSize); |
|
|
|
|
|
|
|
|
|
List<Queue> queueList = queueMapper.queryQueuePaging(searchVal,pageInfo.getStart(),pageSize); |
|
|
|
|
List<Queue> queueList = queueMapper.queryQueuePaging(searchVal, pageInfo.getStart(), pageSize); |
|
|
|
|
|
|
|
|
|
pageInfo.setTotalCount(count); |
|
|
|
|
pageInfo.setLists(queueList); |
|
|
|
|
result.put(Constants.DATA_LIST, pageInfo); |
|
|
|
|
putMsg(result,Status.SUCCESS); |
|
|
|
|
putMsg(result, Status.SUCCESS); |
|
|
|
|
|
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Map<String, Object> createQueue(User loginUser,String queue, String queueName) { |
|
|
|
|
/** |
|
|
|
|
* create queue |
|
|
|
|
* |
|
|
|
|
* @param loginUser |
|
|
|
|
* @param queue |
|
|
|
|
* @param queueName |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
public Map<String, Object> createQueue(User loginUser, String queue, String queueName) { |
|
|
|
|
Map<String, Object> result = new HashMap<>(5); |
|
|
|
|
if (checkAdmin(loginUser, result)) { |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (checkQueueExists(queue)){ |
|
|
|
|
if (checkQueueExists(queue)) { |
|
|
|
|
putMsg(result, Status.QUEUE_EXIST, queue); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
if (checkQueueExists(queueName)) { |
|
|
|
|
putMsg(result, Status.QUEUE_NAME_EXIST, queueName); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
Queue queueObj = new Queue(); |
|
|
|
|
Date now = new Date(); |
|
|
|
|
|
|
|
|
@ -113,17 +127,25 @@ public class QueueService extends BaseService{
|
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
public Map<String, Object> updateQueue(User loginUser,int id,String queue, String queueName) { |
|
|
|
|
/** |
|
|
|
|
* update queue |
|
|
|
|
* |
|
|
|
|
* @param loginUser |
|
|
|
|
* @param id |
|
|
|
|
* @param queue |
|
|
|
|
* @param queueName |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
public Map<String, Object> updateQueue(User loginUser, int id, String queue, String queueName) { |
|
|
|
|
Map<String, Object> result = new HashMap<>(5); |
|
|
|
|
if (checkAdmin(loginUser, result)) { |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Queue queueObj = queueMapper.queryById(id); |
|
|
|
|
if (queueObj == null) { |
|
|
|
|
putMsg(result,Status.QUEUE_NOT_EXIST,id); |
|
|
|
|
putMsg(result, Status.QUEUE_NOT_EXIST, id); |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|