| | |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} else { |
| | | wrapper.orderBy("create_time", false); |
| | | wrapper.orderBy("settle").orderBy("create_time", false); |
| | | } |
| | | return R.ok(packService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | |
| | | pack.setCreateBy(getUserId()); |
| | | pack.setCreateTime(now); |
| | | if (!packService.insert(pack)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | throw new CoolException("response.server_internal_error_contact_admin"); |
| | | } |
| | | Mat mat = new Mat(); |
| | | mat.setTagId(tagService.getTop().getId()); |
| | |
| | | mat.setStatus(1); |
| | | mat.setCreateTime(now); |
| | | mat.setUpdateTime(now); |
| | | mat.setMemo("打包上线"); |
| | | mat.setMemo("response.pack_online"); |
| | | if (!matService.insert(mat)) { |
| | | throw new CoolException("服务器内部错误,请联系管理员"); |
| | | throw new CoolException("response.server_internal_error_contact_admin"); |
| | | } |
| | | return R.ok(); |
| | | return R.ok("response.save_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pack/update/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth |
| | | public R update(Pack pack){ |
| | | if (Cools.isEmpty(pack) || null==pack.getId()){ |
| | | return R.error(); |
| | | return R.error("response.param_error"); |
| | | } |
| | | pack.setUpdateBy(getUserId()); |
| | | pack.setUpdateTime(new Date()); |
| | | packService.updateById(pack); |
| | | return R.ok(); |
| | | return R.ok("response.update_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pack/delete/auth") |
| | |
| | | for (Long id : ids){ |
| | | packService.deleteById(id); |
| | | } |
| | | return R.ok(); |
| | | return R.ok("response.delete_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/pack/export/auth") |
| | |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<Pack> wrapper = new EntityWrapper<Pack>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != packService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(Pack.class, String.valueOf(param.get("key")))); |
| | | R r = R.parse(BaseRes.REPEAT); |
| | | r.put("data", getComment(Pack.class, String.valueOf(param.get("key")))); |
| | | return r; |
| | | } |
| | | return R.ok(); |
| | | return R.ok("response.operation_success"); |
| | | } |
| | | |
| | | } |