|
|
|
@ -101,19 +101,13 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
|
|
|
|
|
@Override |
|
|
|
|
public boolean insertGoodsAllocation( BasicdataGoodsAllocationDTO basicdataGoodsAllocationDto) { |
|
|
|
|
BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity(); |
|
|
|
|
List<String> nodeInfo = basicdataGoodsAllocationDto.getNodeInfo(); |
|
|
|
|
if (Func.isEmpty(nodeInfo)){ |
|
|
|
|
log.error("参数不合法:{}"+nodeInfo); |
|
|
|
|
if (Func.isEmpty(basicdataGoodsAllocationDto)){ |
|
|
|
|
log.error("参数不合法:{}"+basicdataGoodsAllocationDto); |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
BeanUtils.copyProperties(basicdataGoodsAllocationDto,basicdataGoodsAllocationEntity); |
|
|
|
|
BladeUser user = AuthUtil.getUser(); |
|
|
|
|
Long userId = user.getUserId(); |
|
|
|
|
basicdataGoodsAllocationEntity.setWarehouseId( nodeInfo.get(0)); |
|
|
|
|
basicdataGoodsAllocationEntity.setGoodsAreaId( nodeInfo.get(1)); |
|
|
|
|
basicdataGoodsAllocationEntity.setGoodsShelfId( nodeInfo.get(2)); |
|
|
|
|
basicdataGoodsAllocationEntity.setEnableStatus("1"); |
|
|
|
|
basicdataGoodsAllocationEntity.setStatus(1); |
|
|
|
|
basicdataGoodsAllocationEntity.setIsDeleted(0); |
|
|
|
@ -124,7 +118,6 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
|
|
|
|
|
basicdataGoodsAllocationEntity.setUpdateTime(new Date()); |
|
|
|
|
basicdataGoodsAllocationEntity.setUpdateUser(userId); |
|
|
|
|
basicdataGoodsAllocationEntity.setTenantId(user.getTenantId()); |
|
|
|
|
|
|
|
|
|
boolean result = SqlHelper.retBool(goodsAllocationMapper.insert(basicdataGoodsAllocationEntity)); |
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -143,31 +136,13 @@ public class BasicdataGoodsAllocationServiceImpl extends BaseServiceImpl<Basicda
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public boolean updateGoodsAllocation(BasicdataGoodsAllocationDTO basicdataGoodsAllocationDto) { |
|
|
|
|
List<String> nodeInfo = basicdataGoodsAllocationDto.getNodeInfo(); |
|
|
|
|
boolean result = false; |
|
|
|
|
if (Func.isEmpty(nodeInfo)){ |
|
|
|
|
if (Func.isEmpty(basicdataGoodsAllocationDto)){ |
|
|
|
|
return result; |
|
|
|
|
}else { |
|
|
|
|
} |
|
|
|
|
BasicdataGoodsAllocationEntity basicdataGoodsAllocationEntity = new BasicdataGoodsAllocationEntity(); |
|
|
|
|
BeanUtils.copyProperties(basicdataGoodsAllocationDto,basicdataGoodsAllocationEntity); |
|
|
|
|
if (nodeInfo.size()==1){ |
|
|
|
|
basicdataGoodsAllocationEntity.setWarehouseId(nodeInfo.get(0)); |
|
|
|
|
basicdataGoodsAllocationEntity.setGoodsAreaId(""); |
|
|
|
|
basicdataGoodsAllocationEntity.setGoodsShelfId(""); |
|
|
|
|
}else if (nodeInfo.size()==2){ |
|
|
|
|
basicdataGoodsAllocationEntity.setWarehouseId(nodeInfo.get(0)); |
|
|
|
|
basicdataGoodsAllocationEntity.setWarehouseId(nodeInfo.get(1)); |
|
|
|
|
basicdataGoodsAllocationEntity.setGoodsShelfId(""); |
|
|
|
|
|
|
|
|
|
}else if (nodeInfo.size()==3){ |
|
|
|
|
basicdataGoodsAllocationEntity.setWarehouseId(nodeInfo.get(0)); |
|
|
|
|
basicdataGoodsAllocationEntity.setGoodsAreaId(nodeInfo.get(1)); |
|
|
|
|
basicdataGoodsAllocationEntity.setGoodsShelfId(nodeInfo.get(2)); |
|
|
|
|
}else { |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
result = SqlHelper.retBool(goodsAllocationMapper.updateById(basicdataGoodsAllocationEntity)); |
|
|
|
|
} |
|
|
|
|
return result; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|