自动化立体仓库 - WMS系统
tqs
2022-10-29 b392ca2326ddefda33845611f9c7499d0fd6fcef
src/main/java/com/zy/asrs/controller/LocDetlController.java
@@ -22,8 +22,10 @@
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.*;
@@ -115,7 +117,9 @@
        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 +"%'");
@@ -269,6 +273,7 @@
    /**
     * 获取库存总数
     *
     * @return
     */
    @RequestMapping("/locDetl/count")
@@ -297,28 +302,37 @@
        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());
@@ -332,7 +346,6 @@
                if (now.compareTo(maxDate) > 0) {
                    result.add(locDetl);
                }
            }catch (Exception e){
                continue;
            }