| | |
| | | return R.ok(rowLastnoService.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); |
| | | } |
| | | } |
| | | } |
| | |
| | | rowLastno.setAppeUser(getUserId()); |
| | | rowLastno.setAppeTime(new Date()); |
| | | rowLastnoService.insert(rowLastno); |
| | | return R.ok(); |
| | | return R.ok("response.save_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/rowLastno/update/auth") |
| | | @ManagerAuth |
| | | public R update(RowLastno rowLastno){ |
| | | if (Cools.isEmpty(rowLastno) || null==rowLastno.getWhsType()){ |
| | | return R.error(); |
| | | return R.error("response.param_error"); |
| | | } |
| | | rowLastno.setModiUser(getUserId()); |
| | | rowLastno.setModiTime(new Date()); |
| | | rowLastnoService.updateById(rowLastno); |
| | | return R.ok(); |
| | | return R.ok("response.update_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/rowLastno/delete/auth") |
| | |
| | | public R delete(@RequestParam String param){ |
| | | List<RowLastno> list = JSONArray.parseArray(param, RowLastno.class); |
| | | if (Cools.isEmpty(list)){ |
| | | return R.error(); |
| | | return R.error("response.param_error"); |
| | | } |
| | | for (RowLastno entity : list){ |
| | | rowLastnoService.delete(new EntityWrapper<>(entity)); |
| | | } |
| | | return R.ok(); |
| | | return R.ok("response.delete_success"); |
| | | } |
| | | |
| | | @RequestMapping(value = "/rowLastno/export/auth") |
| | |
| | | public R query(@RequestBody JSONObject param) { |
| | | Wrapper<RowLastno> wrapper = new EntityWrapper<RowLastno>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | if (null != rowLastnoService.selectOne(wrapper)){ |
| | | return R.parse(BaseRes.REPEAT).add(getComment(RowLastno.class, String.valueOf(param.get("key")))); |
| | | R r = R.parse(BaseRes.REPEAT); |
| | | r.put("data", getComment(RowLastno.class, String.valueOf(param.get("key")))); |
| | | return r; |
| | | } |
| | | return R.ok(); |
| | | } |