| | |
| | | @ManagerAuth |
| | | public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false, defaultValue = "stsNo")String orderByField, |
| | | @RequestParam(required = false, defaultValue = "asc")String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | EntityWrapper<BasCrnStatus> wrapper = new EntityWrapper<>(); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} else { |
| | | wrapper.orderBy("sts_no", true); |
| | | } |
| | | return R.ok(basCrnStatusService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | private void convert(Map<String, Object> map, EntityWrapper wrapper){ |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if (entry.getKey().endsWith(">")) { |
| | | wrapper.ge(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | | } else if (entry.getKey().endsWith("<")) { |
| | | wrapper.le(Cools.deleteChar(entry.getKey()), DateUtils.convert(String.valueOf(entry.getValue()))); |
| | | String val = String.valueOf(entry.getValue()); |
| | | if (val.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = val.split(RANGE_TIME_LINK); |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.eq(entry.getKey(), String.valueOf(entry.getValue())); |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/basCrnStatus/add/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "堆垛机状态添加") |
| | | public R add(BasCrnStatus basCrnStatus) { |
| | | basCrnStatus.setModiUser(getUserId()); |
| | | basCrnStatus.setModiTime(new Date()); |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/basCrnStatus/update/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "堆垛机状态修改") |
| | | public R update(BasCrnStatus basCrnStatus){ |
| | | if (Cools.isEmpty(basCrnStatus) || null==basCrnStatus.getStsNo()){ |
| | | return R.error(); |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/basCrnStatus/delete/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "堆垛机状态删除") |
| | | public R delete(@RequestParam String param){ |
| | | List<BasCrnStatus> list = JSONArray.parseArray(param, BasCrnStatus.class); |
| | | if (Cools.isEmpty(list)){ |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/basCrnStatus/export/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "堆垛机状态导出") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<BasCrnStatus> wrapper = new EntityWrapper<>(); |