| | |
| | | import com.core.common.*; |
| | | import com.zy.asrs.entity.*; |
| | | import com.zy.asrs.entity.param.OrderDomainParam; |
| | | import com.zy.asrs.entity.param.PakOutDTO; |
| | | import com.zy.asrs.service.*; |
| | | import com.zy.common.CodeRes; |
| | | import com.zy.common.config.AdminInterceptor; |
| | |
| | | EntityWrapper<ManPakOut> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} else { |
| | | wrapper.orderBy("create_time",false); |
| | | } |
| | | |
| | | return R.ok(manPakOutService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | } |
| | | |
| | |
| | | EntityWrapper<ManPakOut> wrapper = new EntityWrapper<>(); |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} else { |
| | | wrapper.orderBy("create_time",false); |
| | | |
| | | String docnum = String.valueOf(param.get("doc_num")); |
| | | if (Cools.isEmpty(docnum) || docnum.equals("null")) { |
| | | docnum = null; |
| | | } |
| | | wrapper.isNotNull("name"); |
| | | Page<ManPakOut> manPakOutPage = manPakOutService.selectPage(new Page<>(curr, limit), wrapper); |
| | | return R.ok(manPakOutPage); |
| | | 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, stime, etime, curr, limit,getUserId()); |
| | | for (PakOutDTO pakOutDTO:pakOutDTOS){ |
| | | List<ManPakOut> manPakOuts = manPakOutService.selectList(new EntityWrapper<ManPakOut>().eq("doc_num", pakOutDTO.getDoc_num())); |
| | | for (ManPakOut manPakOut:manPakOuts){ |
| | | if (manPakOut.getCount() < manPakOut.getAnfme()){ |
| | | pakOutDTO.setStatus(0); |
| | | break; |
| | | } |
| | | } |
| | | if (pakOutDTO.getStatus() == null){ |
| | | pakOutDTO.setStatus(1); |
| | | } |
| | | |
| | | } |
| | | |
| | | int count = manPakOutService.selectPakOutCount(docnum, stime, etime,curr, limit,getUserId()); |
| | | 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); |
| | | } |
| | | |
| | | private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |