| | |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.util.Map; |
| | | |
| | | @RestController |
| | |
| | | full = Boolean.parseBoolean(params.get("full").toString()); |
| | | } |
| | | } |
| | | BigDecimal weight = parseAllocateWeight(params.get("weight")); |
| | | if (Cools.isEmpty(barcode)) { |
| | | return R.error("料箱码不能为空!!"); |
| | | } |
| | |
| | | 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("空板出库:从指定空板库位生成出库任务至目标站点") |