cl
13 小时以前 8943a4e9f5ee1455c56ac4af60d941fa23731051
rsf-server/src/main/java/com/vincent/rsf/server/api/controller/WcsController.java
@@ -28,6 +28,7 @@
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import java.math.BigDecimal;
import java.util.Map;
@RestController
@@ -172,6 +173,7 @@
                full = Boolean.parseBoolean(params.get("full").toString());
            }
        }
        BigDecimal weight = parseAllocateWeight(params.get("weight"));
        if (Cools.isEmpty(barcode)) {
            return R.error("料箱码不能为空!!");
        }
@@ -181,7 +183,24 @@
        if (type == null) {
            return R.error("入库类型不能为空!!");
        }
        return wcsService.allocateLocation(barcode, staNo, type, full);
        return wcsService.allocateLocation(barcode, staNo, type, full, weight);
    }
    private static BigDecimal parseAllocateWeight(Object raw) {
        if (raw == null) {
            return null;
        }
        if (raw instanceof BigDecimal) {
            return (BigDecimal) raw;
        }
        if (raw instanceof Number) {
            return new BigDecimal(raw.toString());
        }
        String s = raw.toString().trim();
        if (s.isEmpty()) {
            return null;
        }
        return new BigDecimal(s);
    }
    @ApiOperation("空板出库:从指定空板库位生成出库任务至目标站点")