| | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.zy.asrs.common.wms.entity.LocDetl; |
| | | import com.zy.asrs.common.wms.entity.WaitPakin; |
| | | import com.zy.asrs.common.wms.entity.WaitPakinLog; |
| | | import com.zy.asrs.common.wms.service.WaitPakinLogService; |
| | |
| | | return R.ok(waitPakinLogService.getById(String.valueOf(id))); |
| | | } |
| | | |
| | | @RequestMapping(value = "/waitPakinLog/export/auth1") |
| | | @ManagerAuth(memo = "库位明细导出") |
| | | public synchronized R export(@RequestBody JSONObject param){ |
| | | List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | QueryWrapper<WaitPakinLog> wrapper = new QueryWrapper<>(); |
| | | Map<String, Object> map = excludeTrash(param.getJSONObject("waitPakinLog")); |
| | | 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<WaitPakinLog> list = waitPakinLogService.list(wrapper); |
| | | return R.ok(exportSupport(list, fields)); |
| | | } |
| | | private <T> void convert(Map<String, Object> map, QueryWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | if(Cools.eq(entry.getKey(),"curr") |
| | | || Cools.eq(entry.getKey(),"limit") |
| | | || Cools.eq(entry.getKey(),"unreason") |
| | | || Cools.eq(entry.getKey(),"orderByField") |
| | | || Cools.eq(entry.getKey(),"orderByType") |
| | | || Cools.eq(entry.getKey(),"row") |
| | | || Cools.eq(entry.getKey(),"condition")){ |
| | | continue; |
| | | } |
| | | |
| | | if(Cools.isEmpty(entry.getValue())){ |
| | | continue; |
| | | } |
| | | |
| | | 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 { |
| | | if (entry.getKey().equals("locNo")) { |
| | | wrapper.eq("loc_no", String.valueOf(entry.getValue())); |
| | | } else { |
| | | wrapper.like(entry.getKey(), String.valueOf(entry.getValue())); |
| | | } |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | @RequestMapping(value = "/waitPakinLog/page/auth") |
| | | @ManagerAuth |
| | | public R page(@RequestParam(defaultValue = "1") Integer curr, |