| | |
| | | Integer bayNo = parseInteger(row.get("bay_no"), "bay_no", true); |
| | | Integer levNo = parseInteger(row.get("lev_no"), "lev_no", true); |
| | | String locNo = buildLocNo(zone, rowNo, bayNo, levNo); |
| | | if (locService.selectByLocNo(locNo) != null) { |
| | | continue; |
| | | Loc loc = locService.selectByLocNo(locNo); |
| | | if (loc == null) { |
| | | loc.setZoneId(zone.getId()); |
| | | loc.setUuid(locNo); |
| | | loc.setLocNo(locNo); |
| | | loc.setRowNo(rowNo); |
| | | loc.setBayNo(bayNo); |
| | | loc.setLevNo(levNo); |
| | | loc.setStatus(StatusType.ENABLE.val); |
| | | loc.setCreateBy(userId); |
| | | loc.setCreateTime(now); |
| | | } |
| | | |
| | | Long locStsId = resolveLocStsId(readCell(row, "loc_sts")); |
| | |
| | | Integer compDirect = parseInteger(row.get("comp_direct"), "comp_direct", false); |
| | | Double offset = parseDouble(row.get("offset"), "offset"); |
| | | |
| | | Loc loc = new Loc(); |
| | | loc.setZoneId(zone.getId()); |
| | | loc.setUuid(locNo); |
| | | loc.setLocNo(locNo); |
| | | loc.setRowNo(rowNo); |
| | | loc.setBayNo(bayNo); |
| | | loc.setLevNo(levNo); |
| | | |
| | | loc.setLocSts(locStsId); |
| | | loc.setLocType(locTypeId); |
| | |
| | | loc.setCompDirect(compDirect); |
| | | loc.setOffset(offset); |
| | | |
| | | loc.setStatus(StatusType.ENABLE.val); |
| | | loc.setCreateBy(userId); |
| | | loc.setCreateTime(now); |
| | | |
| | | loc.setUpdateBy(userId); |
| | | loc.setUpdateTime(now); |
| | | |
| | | if (loc.getId()==null){ |
| | | if (!locService.save(loc)) { |
| | | throw new CoolException(locNo + " save fail !"); |
| | | } |
| | | }else { |
| | | if (!locService.updateById(loc)) { |
| | | throw new CoolException(locNo + " update fail !"); |
| | | } |
| | | } |
| | | |
| | | } |
| | | return R.ok(); |
| | | } |
| | |
| | | |
| | | private Long resolveLocStsId(String identifier) { |
| | | if (Cools.isEmpty(identifier)) { |
| | | throw new CoolException("loc_sts is required"); |
| | | //throw new CoolException("loc_sts is required"); |
| | | return null; |
| | | } |
| | | LocStsType locStsType = LocStsType.valueOf(identifier); |
| | | if (locStsType == null) { |