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