| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "updateOrder")
|
| | | public void updateOrder(String callback, Long id, Integer moveType, PrintWriter out) {
|
| | | public void updateOrder(String callback, Long id, Integer moveType, Integer sex, PrintWriter out) {
|
| | | try {
|
| | | homeNavbarService.updateOrder(id, moveType);
|
| | | homeNavbarService.updateOrder(id, moveType, sex);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | } catch (HomeNavbarException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | |
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "query")
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, PrintWriter out) {
|
| | |
|
| | | public void query(String callback, Integer pageIndex, Integer pageSize, String key, Integer sex, PrintWriter out) {
|
| | | if (pageIndex == null || pageIndex < 1) {
|
| | | pageIndex = 1;
|
| | | }
|
| | |
| | | }
|
| | |
|
| | | try {
|
| | | List<HomeNavbar> list = homeNavbarService.listQuery((pageIndex - 1) * pageSize, pageSize, key);
|
| | |
|
| | | List<HomeNavbar> list = homeNavbarService.listQuery((pageIndex - 1) * pageSize, pageSize, key, sex);
|
| | | if (list == null || list.size() == 0) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("暂无数据"));
|
| | | return;
|
| | | }
|
| | |
|
| | | long count = homeNavbarService.countlistQuery(key);
|
| | | |
| | | long count = homeNavbarService.countlistQuery(key, sex);
|
| | | int totalPage = (int) (count % pageSize == 0 ? count / pageSize : count / pageSize + 1);
|
| | | PageEntity pe = new PageEntity(pageIndex, pageSize, count, totalPage);
|
| | |
|
| | |
| | | data.put("result_list", gson.toJson(list));
|
| | |
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult(data));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作异常"));
|
| | | e.printStackTrace();
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| | |
|
| | |
| | | */
|
| | | @RequestMapping(value = "delete")
|
| | | public void delete(String callback, String idArray, PrintWriter out) {
|
| | |
|
| | | try {
|
| | | if (StringUtil.isNullOrEmpty(idArray)) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("请选择操作的数据"));
|
| | |
| | | }
|
| | |
|
| | | int count = homeNavbarService.deleteBatchByPrimaryKey(list);
|
| | | |
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("成功删除["+ count +"]条数据"));
|
| | |
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("删除失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | |
| | | /**
|
| | | * 修改状态
|
| | | * @param callback
|
| | | * @param id
|
| | | * @param out
|
| | | */
|
| | | @RequestMapping(value = "switchState")
|
| | | public void switchState(String callback, Long id, PrintWriter out) {
|
| | | try {
|
| | | homeNavbarService.switchState(id);
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadTrueResult("操作成功"));
|
| | | } catch (HomeNavbarException e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult(e.getMsg()));
|
| | | } catch (Exception e) {
|
| | | JsonUtil.printMode(out, callback, JsonUtil.loadFalseResult("操作失败"));
|
| | | e.printStackTrace();
|
| | | }
|
| | | }
|
| | | }
|