| | |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.OrderDomainParam; |
| | | import com.zy.asrs.entity.param.PakOutDTO; |
| | | import com.zy.asrs.entity.result.LocDetlAll; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.common.config.AdminInterceptor; |
| | |
| | | return R.ok(manPakOutService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/ManPakOut/list/auth1") |
| | | @ManagerAuth |
| | | public R list1(@RequestParam(defaultValue = "1")Integer curr, |
| | | @RequestParam(defaultValue = "10")Integer limit, |
| | | @RequestParam(required = false)String orderByField, |
| | | @RequestParam(required = false)String orderByType, |
| | | @RequestParam Map<String, Object> param){ |
| | | EntityWrapper<ManPakOut> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert1(param, wrapper); |
| | | |
| | | return R.ok(manPakOutService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | | @RequestMapping(value = "/ManPakOut/detailed/auth") |
| | | @ManagerAuth |
| | | public R detailed(@RequestParam(defaultValue = "1")Integer curr, |
| | |
| | | EntityWrapper<ManPakOut> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | |
| | | String docnum = String.valueOf(param.get("doc_num")); |
| | | if (Cools.isEmpty(docnum) || docnum.equals("null")) { |
| | | docnum = null; |
| | | } |
| | | Date stime = null; |
| | | Date etime = null; |
| | | if(param.get("create_time") != null){ |
| | | String[] dates = param.get("create_time").toString().split(RANGE_TIME_LINK); |
| | | stime = DateUtils.convert(dates[0]); |
| | | etime = DateUtils.convert(dates[1]); |
| | | } |
| | | |
| | | List<PakOutDTO> pakOutDTOS = manPakOutService.selectPakOut(docnum, curr, limit); |
| | | Long userId = getUserId(); |
| | | if(getUser().getRoleId() == 2 || getUser().getRoleId() == 24){ |
| | | userId = null; |
| | | } |
| | | |
| | | String custName = Cools.isEmpty(param.get("cust_name")) ? "" : param.get("cust_name").toString(); |
| | | |
| | | List<PakOutDTO> pakOutDTOS = manPakOutService.selectPakOut(docnum, stime, etime, curr, limit,userId,custName); |
| | | for (PakOutDTO pakOutDTO:pakOutDTOS){ |
| | | List<ManPakOut> manPakOuts = manPakOutService.selectList(new EntityWrapper<ManPakOut>().eq("doc_num", pakOutDTO.getDoc_num())); |
| | | for (ManPakOut manPakOut:manPakOuts){ |
| | |
| | | |
| | | } |
| | | |
| | | |
| | | int count = manPakOutService.selectPakOutCount(docnum, curr, limit); |
| | | int count = manPakOutService.selectPakOutCount(docnum, stime, etime,curr, limit,userId,custName); |
| | | Page<PakOutDTO> page = new Page<>(); |
| | | // 最后按状态未出库->已出库排序 |
| | | // page.setRecords(pakOutDTOS.stream().sorted(Comparator.comparingInt(PakOutDTO::getStatus)).collect(Collectors.toList())); |
| | | page.setRecords(pakOutDTOS); |
| | | page.setTotal(count); |
| | | return R.ok(page); |
| | |
| | | wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | } else { |
| | | wrapper.like(entry.getKey(), val); |
| | | } |
| | | } |
| | | } |
| | | |
| | | private <T> void convert1(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | 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(), val); |
| | | } |
| | | } |
| | | } |
| | |
| | | response.getOutputStream().close(); |
| | | return R.ok(); |
| | | } |
| | | |
| | | } |