| | |
| | | return R.ok(wrkMastLogService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/inventoryFlow/list/auth") |
| | | // @ManagerAuth(memo = "库存移动流水记录") |
| | | public R inventoryFlowList(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam(required = false)String condition, |
| | | @RequestParam Map<String, Object> param){ |
| | | excludeTrash(param); |
| | | if (Cools.isEmpty(param.get("io_time"))) { |
| | | param.put("startTime",""); |
| | | param.put("endTime",""); |
| | | } else { |
| | | String ioTime = (String) param.get("io_time"); |
| | | if (ioTime.contains(RANGE_TIME_LINK)){ |
| | | String[] dates = ioTime.split(RANGE_TIME_LINK); |
| | | param.put("startTime",dates[0]); |
| | | param.put("endTime",dates[1]); |
| | | } |
| | | } |
| | | return wrkMastLogService.inventoryFlowList(curr,limit,param); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | String val = String.valueOf(entry.getValue()); |
| | |
| | | wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | if ("manu_type".equals(entry.getKey())) { |
| | | wrapper.like(entry.getKey(), val); |
| | | } else { |
| | | wrapper.eq(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | } |
| | |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<WrkMastLog> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("id", condition); |
| | | Page<WrkMastLog> page = wrkMastLogService.selectPage(new Page<>(0, 10), wrapper); |
| | | if (!Cools.isEmpty(condition)) { |
| | | wrapper.where("CAST(wrk_no AS VARCHAR(20)) LIKE {0}", "%" + condition + "%"); |
| | | } |
| | | Page<WrkMastLog> page = wrkMastLogService.selectPage(new Page<>(1, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (WrkMastLog wrkMastLog : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", wrkMastLog.getId()); |
| | | map.put("value", wrkMastLog.getId()); |
| | | map.put("id", wrkMastLog.getWrkNo()); |
| | | map.put("value", wrkMastLog.getWrkNo()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |