| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.servlet.http.HttpServletResponse; |
| | | import javax.xml.crypto.Data; |
| | | import java.io.IOException; |
| | | import java.net.URLEncoder; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | |
| | |
| | | excludeTrash(param); |
| | | convert(param, wrapper); |
| | | allLike(LocDetl.class, param.keySet(), wrapper, condition); |
| | | if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | if (!Cools.isEmpty(orderByField)) { |
| | | wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType)); |
| | | } |
| | | if (!row.equals("")){ |
| | | wrapper.and() |
| | | .where("loc_no like '" +row +"%'"); |
| | |
| | | |
| | | /** |
| | | * 获取库存总数 |
| | | * |
| | | * @return |
| | | */ |
| | | @RequestMapping("/locDetl/count") |
| | |
| | | for (LocDetl locDetl : groupLocDetl) { |
| | | Mat mat = matService.selectOne(new EntityWrapper<Mat>() |
| | | .eq("matnr", locDetl.getMatnr())); |
| | | locDetl.setStoreMax(mat.getStoreMax()); |
| | | locDetl.setStoreMaxDate(mat.getStoreMaxDate()); |
| | | locDetl.setStoreMin(mat.getStoreMin()); |
| | | if (Cools.isEmpty(mat) |
| | | || Cools.isEmpty(mat.getStoreMax()) |
| | | || Cools.isEmpty(mat.getStoreMaxDate()) |
| | | || Cools.isEmpty(mat.getStoreMin())) { |
| | | continue; |
| | | } else if (Cools.isEmpty(locDetl.getBatch())) { |
| | | continue; |
| | | } else if (locDetl.getBatch().length() != 8) { |
| | | continue; |
| | | } |
| | | try { |
| | | SimpleDateFormat simple = new SimpleDateFormat("yyyyMMdd"); |
| | | Date maxDate = simple.parse(locDetl.getBatch()); |
| | | long time = maxDate.getTime(); |
| | | Date now = new Date(); |
| | | long time1 = now.getTime(); |
| | | locDetl.setNowTime((int)((time1 - time)/(1000*60*60*24))); |
| | | } catch (ParseException e) { |
| | | e.printStackTrace(); |
| | | } |
| | | if (locDetl.getAnfme() > mat.getStoreMax()){ |
| | | result.add(locDetl); |
| | | continue; |
| | | } |
| | | if (locDetl.getAnfme() < mat.getStoreMin()){ |
| | | } else if (locDetl.getAnfme() < mat.getStoreMin()) { |
| | | result.add(locDetl); |
| | | continue; |
| | | } |
| | | |
| | | |
| | | if (Cools.isEmpty(locDetl.getBatch())) { |
| | | continue; |
| | | } |
| | | if (locDetl.getBatch().length() != 8){ |
| | | continue; |
| | | } |
| | | try{ |
| | | SimpleDateFormat simple = new SimpleDateFormat("yyyyMMdd"); |
| | | Date maxDate = simple.parse(locDetl.getBatch()); |
| | |
| | | if (now.compareTo(maxDate) > 0) { |
| | | result.add(locDetl); |
| | | } |
| | | |
| | | }catch (Exception e){ |
| | | continue; |
| | | } |