|  |  |  | 
|---|
|  |  |  | @RequestParam(required = false)String orderByField, | 
|---|
|  |  |  | @RequestParam(required = false)String orderByType, | 
|---|
|  |  |  | @RequestParam(required = false)String condition, | 
|---|
|  |  |  | @RequestParam Map<String, Object> param){ | 
|---|
|  |  |  | excludeTrash(param); | 
|---|
|  |  |  | @RequestParam Map<String, Object> param, | 
|---|
|  |  |  | @RequestParam(required = false)Boolean unreason){ | 
|---|
|  |  |  | if (!Cools.isEmpty(unreason) && unreason) { | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return R.ok(locDetlService.selectPage(new Page<>(curr, limit), new EntityWrapper<LocDetl>() | 
|---|
|  |  |  | .where(" DATALENGTH( batch ) != 11 or\n" + | 
|---|
|  |  |  | "            batch LIKE '%[a-z]%'"))); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | param.remove("unreason"); | 
|---|
|  |  |  | String row = ""; | 
|---|
|  |  |  | EntityWrapper<LocDetl> wrapper = new EntityWrapper<>(); | 
|---|
|  |  |  | if (param.get("row") != null) { | 
|---|
|  |  |  | String chooseRow = (String) param.get("row"); | 
|---|
|  |  |  | if (chooseRow.length() == 1) { | 
|---|
|  |  |  | row = "0" + chooseRow; | 
|---|
|  |  |  | param.remove("row"); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | row = chooseRow; | 
|---|
|  |  |  | param.remove("row"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | excludeTrash(param); | 
|---|
|  |  |  | convert(param, wrapper); | 
|---|
|  |  |  | allLike(LocDetl.class, param.keySet(), wrapper, condition); | 
|---|
|  |  |  | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} | 
|---|
|  |  |  | if (!row.equals("")){ | 
|---|
|  |  |  | wrapper.and() | 
|---|
|  |  |  | .where("loc_no like '" +row +"%'"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | return R.ok(locDetlService.selectPage(new Page<>(curr, limit), wrapper)); | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | @RequestMapping(value = "/locDetl/export/auth") | 
|---|
|  |  |  | @ManagerAuth(memo = "库位明细导出") | 
|---|
|  |  |  | public R export(@RequestBody JSONObject param){ | 
|---|
|  |  |  | public synchronized R export(@RequestBody JSONObject param){ | 
|---|
|  |  |  | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); | 
|---|
|  |  |  | EntityWrapper<LocDetl> wrapper = new EntityWrapper<>(); | 
|---|
|  |  |  | Map<String, Object> map = excludeTrash(param.getJSONObject("locDetl")); | 
|---|
|  |  |  | String row = ""; | 
|---|
|  |  |  | if (map.get("row") != null) { | 
|---|
|  |  |  | String chooseRow = (String) map.get("row"); | 
|---|
|  |  |  | if (chooseRow.length() == 1) { | 
|---|
|  |  |  | row = "0" + chooseRow; | 
|---|
|  |  |  | map.remove("row"); | 
|---|
|  |  |  | }else { | 
|---|
|  |  |  | row = chooseRow; | 
|---|
|  |  |  | map.remove("row"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | convert(map, wrapper); | 
|---|
|  |  |  | if (!row.equals("")){ | 
|---|
|  |  |  | wrapper.and() | 
|---|
|  |  |  | .where("loc_no like '" +row +"%'"); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | List<LocDetl> list = locDetlService.selectList(wrapper); | 
|---|
|  |  |  | return R.ok(exportSupport(list, fields)); | 
|---|
|  |  |  | } | 
|---|