| | |
| | | return R.ok(basCrnpService.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 = "/basCrnp/add/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "堆垛机添加") |
| | | public R add(BasCrnp basCrnp) { |
| | | basCrnp.setModiUser(getUserId()); |
| | | basCrnp.setModiTime(new Date()); |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/basCrnp/update/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "堆垛机修改") |
| | | public R update(BasCrnp basCrnp){ |
| | | if (Cools.isEmpty(basCrnp) || null==basCrnp.getCrnNo()){ |
| | | return R.error(); |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/basCrnp/delete/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "堆垛机删除") |
| | | public R delete(@RequestParam String param){ |
| | | List<BasCrnp> list = JSONArray.parseArray(param, BasCrnp.class); |
| | | if (Cools.isEmpty(list)){ |
| | |
| | | } |
| | | |
| | | @RequestMapping(value = "/basCrnp/export/auth") |
| | | @ManagerAuth |
| | | @ManagerAuth(memo = "堆垛机导出") |
| | | public R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | EntityWrapper<BasCrnp> wrapper = new EntityWrapper<>(); |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/basCrnp/getCrnInfoList") |
| | | public R getCrnInfoList() { |
| | | List<BasCrnp> basCrnps = basCrnpService.selectList(new EntityWrapper<BasCrnp>()); |
| | | ArrayList<HashMap<String, Object>> list = new ArrayList<>(); |
| | | for (BasCrnp basCrnp : basCrnps) { |
| | | HashMap<String, Object> map = new HashMap<>(); |
| | | map.put("crnNo", basCrnp.getCrnNo()); |
| | | map.put("error", basCrnp.getCrnErr()); |
| | | map.put("errorMsg", basCrnp.getCrnErr$()); |
| | | list.add(map); |
| | | } |
| | | return R.ok().add(list); |
| | | } |
| | | |
| | | } |